You can import a VMware virtual machine or template. If you import a template, a virtual machine based on the template is created.

Importing a VMware virtual machine or template is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red Hat Technology Preview features, see https://access.redhat.com/support/offerings/techpreview/.

Prerequisites
  • The VMware virtual machine is powered off.

  • The VMware Virtual Disk Development Kit (VDDK) has been uploaded to the namespace in which you are importing the virtual machine.

Uploading the VMware Virtual Disk Development Kit

Procedure
  1. In a browser, navigate to VMware Documentation and log in.

  2. Click VMware SDK & API Product Documentation to expand.

  3. Click VMware Virtual Disk Development Kit (VDDK).

  4. Click Latest Releases and select the latest VDDK release.

  5. Click Download SDKs to download the VDDK archive file.

  6. Save the VDDK archive file in an HTTP-accessible location.

  7. Switch to the namespace where you will import the virtual machine:

    $ oc project <namespace>
  8. Upload VDDK to the namespace:

    $ cat <<EOF | oc apply -f -
    apiVersion: cdi.kubevirt.io/v1alpha1
    kind: DataVolume
    metadata:
      name: "vddk-pvc"
    spec:
      source:
        http:
          url: "<http://www.example.com/VDDK_archive_file>" (1)
      contentType: "archive"
      pvc:
        storageClassName: nfs-sc
        accessModes:
        - ReadWriteMany
        resources:
          requests:
            storage: "200Mi"
    EOF
    1 <url> is the path of the VDDK archive file.

Importing the VMware virtual machine or template

Procedure
  1. Click WorkloadsVirtual Machines from the side menu.

  2. Click Create Virtual Machine and select Create with Wizard.

  3. Perform the following procedure in the Basic Settings screen:

    1. Click Provision Source and select Import.

    2. Click Provider and select VMware.

    3. Click vCenter Instance and select Connect to New Instance or a saved vCenter instance.

      • If you select Connect to New Instance, provide values in the following fields and click Check and Save:

        • vCenter Hostname

        • vCenter User Name

        • vCenter Password

          The wizard connects to the vCenter instance and saves the credentials.

          If you clear the Save as New vCenter Instance check box and click Check, the wizard connects to the vCenter instance without saving the credentials.

      • If you select a saved vCenter instance, the wizard connects to it by using the saved credentials.

    4. Click VM to import and select a virtual machine or template.

      The Name and Operating System are filled in automatically with the attributes of the selected virtual machine or template.

    5. Specify the Memory (GB) and number of CPUs if you use the default flavor, Custom.

      Optionally, you can select an existing Flavor.

    6. Select a Workload Profile.

    7. Click Next.

  4. Perform the following procedure in the Networking screen:

    1. Click NETWORK CONFIGURATION and select Pod Networking.

    2. Select a BINDING METHOD.

    3. Click the ✓ button to save the update.

    4. Click Next.

  5. Perform the following procedure in the Storage screen:

    1. Click each disk and select a STORAGE CLASS. If you do not select a storage class, container-native virtualization uses the default storage class to create the virtual machine.

    2. Click the ✓ button to save the update.

    3. Select a Bootable Disk if you have more than one bootable disk.

    4. Click Create Virtual Machine >.

      The Result screen displays the resources created for the virtual machine.

  6. Click Close.

To view the progress of the import:

  1. Click WorkloadsPods from the side menu.

  2. Click the conversion pod, kubevirt-v2v-conversion-<id>, to view the pod details.

  3. In the Overview tab, click ANNOTATIONS for the v2vConversionProgress value.

If an error occurs, you can check the conversion pod log:

  1. Click WorkloadsPods from the side menu.

  2. Click the conversion pod, kubevirt-v2v-conversion-<id>, to view the pod details.

  3. Click Logs to view the conversion pod log.

Refer to the virtual machine wizard fields section for more information on the wizard fields.

Updating the imported virtual machine’s NIC name

Update the imported virtual machine’s NIC name to conform to container-native virtualization naming conventions.

Procedure
  1. Log in to the imported virtual machine.

  2. Go to the /etc/sysconfig/network-scripts directory.

  3. Rename the network configuration file with the new NIC name (a single NIC is called eth0):

    $ mv original_NIC ifcfg-ethx
  4. Update the following parameters in the network configuration file:

    NAME=ethx
    DEVICE=ethx
  5. Restart the network:

    $ systemctl restart network

Virtual machine wizard fields

Virtual machine wizard fields

Name Parameter Description

Name

The name can contain lower-case letters (a-z), numbers (0-9), and hyphens (-), up to a maximum of 253 characters. The first and last characters must be alphanumeric. The name must not contain upper-case letters, spaces, periods (.), or special characters.

Description

Optional description field.

Template

Template from which to create the virtual machine. Selecting a template will automatically complete other fields.

Provision Source

PXE

Provision virtual machine from PXE menu. Requires a PXE-capable NIC in the cluster.

URL

Provision virtual machine from an image available from an HTTP or S3 endpoint.

Container

Provision virtual machine from a bootable operating system container located in a registry accessible from the cluster. Example: kubevirt/cirros-registry-disk-demo.

Cloned Disk

Provision source is a cloned disk.

Import

Import virtual machine from a supported provider.

Operating System

A list of operating systems available in the cluster. This is the primary operating system for the virtual machine. If you select Import as the Provider Source, the operating system is filled in automatically, based on the operating system of the VMware virtual machine being imported.

Flavor

small, medium, large, tiny, Custom

Presets that determine the amount of CPU and memory allocated to the virtual machine.

Workload Profile

desktop

A virtual machine configuration for use on a desktop.

generic

A virtual machine configuration that balances performance and compatibility for a broad range of workloads.

high performance

A virtual machine configuration that is optimized for high-performance loads.

Start virtual machine on creation

Select to automatically start the virtual machine upon creation.

Use cloud-init

Select to enable the cloud-init fields.

Cloud-init fields

Name Description

Hostname

Sets a specific host name for the virtual machine.

Authenticated SSH Keys

The user’s public key that is copied to ~/.ssh/authorized_keys on the virtual machine.

Use custom script

Replaces other options with a field in which you paste a custom cloud-init script.

Networking fields

Name Description

Create NIC

Create a new NIC for the virtual machine.

NIC NAME

Name for the NIC.

MAC ADDRESS

MAC address for the network interface. If a MAC address is not specified, an ephemeral address is generated for the session.

NETWORK CONFIGURATION

List of available NetworkAttachmentDefinition objects.

BINDING METHOD

List of available binding methods. For the default Pod network, masquerade is the only recommended binding method. For secondary networks, use the bridge binding method. The masquerade method is not supported for non-default networks.

PXE NIC

List of PXE-capable networks. Only visible if PXE has been selected as the Provision Source.

Storage fields

Name Description

Create Disk

Create a new disk for the virtual machine.

Attach Disk

Select an existing disk, from a list of available PVCs, to attach to the virtual machine.

DISK NAME

Name of the disk. The name can contain lower-case letters (a-z), numbers (0-9), hyphens (-), and periods (.), up to a maximum of 253 characters. The first and last characters must be alphanumeric. The name must not contain upper-case letters, spaces, or special characters.

SIZE (GB)

Size, in GB, of the disk.

STORAGE CLASS

Name of the underlying StorageClass.

Bootable Disk

List of available disks from which the virtual machine will boot. This is locked to rootdisk if the Provision Source of the virtual machine is URL or Container.