Skip to content

feat: auto-provision copy-offload template VM from CentOS Stream 9 cloud image #438

Description

@rgolangh

Related

Jira: MTV-5047

Problem

Copy-offload tests require a pre-existing VM template (xcopy-template-test) in vSphere with cloud-init configured. Users must manually create this template, which is the biggest onboarding friction for first-time users.

Solution

The test suite auto-provisions the xcopy-template-test template VM in vSphere if it doesn't exist. When users supply their own template via default_vm_name in providers.json, auto-provisioning is skipped.

Deliverables

  • Create utilities/vmware_template_provision.py — download CentOS Stream 9 qcow2 → convert to VMDK → upload to datastore → create VM with GuestInfo cloud-init → mark as template
  • Create resources/cloud-init/user-data.yaml — bundled cloud-init (cloud-user/atomic, SSH, open-vm-tools, 50% disk fill)
  • Add custom exceptions to exceptions/exceptions.py
  • Add session-scoped copyoffload_template_vm fixture to tests/copyoffload/conftest.py
  • Refactor wait_for_cloud_init() to use cloud-init status --wait instead of polling for /cloud-init.finish
  • Add qemu-img to Dockerfile
  • Update copy-offload guide documentation

Design

  • Image: CentOS Stream 9 GenericCloud (XFS, free, RHEL-compatible)
  • Credentials: cloud-user / atomic (hardcoded in bundled userdata)
  • Cloud-init delivery: VMware GuestInfo datasource (no CD-ROM)
  • Cloud-init completion: cloud-init status --wait via SSH
  • Template name: xcopy-template-test
  • User-supplied template: If default_vm_name is set, skip auto-provisioning; fail with clear error if VM not found
  • After cloud-init: Mark VM as vSphere template via MarkAsTemplate()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions