You can import a single VMware virtual machine or template into your OpenShift Container Platform cluster.

If you import a VMware template, the wizard creates a virtual machine based on the template.

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

Creating a VDDK image

The VMware Virtual Disk Development Kit (VDDK) SDK is used to copy VMware virtual disks.

You can download VDDK, convert it into an image, push the image to a private container repository, and add it to the v2v-vmware ConfigMap.

Prerequisites
  • You must have a VMware account to download VDDK.

  • You must be logged in to your private container repository.

    Storing the VDDK image in a public repository may violate the terms of the VMware license.

Procedure
  1. Create a temporary directory for VDDK:

    $ mkdir /tmp/my_vddk && cd /tmp/my_vddk
  2. In a browser, navigate to VMware Documentation.

  3. Click VMware SDK & API Product DocumentationVMware Virtual Disk Development Kit (VDDK).

  4. Select the latest VDDK release and click Download SDKs.

  5. Extract the archive within your temporary directory:

    $ tar -xzf VMware-vix-disklib-<version>.x86_64.tar.gz
  6. Create a Dockerfile:

    $ cat > Dockerfile <<EOF
    FROM busybox:latest
    COPY vmware-vix-disklib-distrib /vmware-vix-disklib-distrib
    RUN mkdir -p /opt
    ENTRYPOINT ["cp", "-r", "/vmware-vix-disklib-distrib", "/opt"]
    EOF
  7. Build the image:

    $ docker build -f Dockerfile -t <server/username/reponame:tag> (1)
    1 Specify your repository details.
  8. Push the image to your repository:

    $ docker push <server/username/reponame:tag> (1)
    1 Specify your repository details.
  9. Ensure that the image is accessible to your container-native virtualization environment.

  10. Edit the v2v-vmware ConfigMap in the openshift-cnv project:

    $ oc edit configmap v2v-vmware -n openshift-cnv
  11. Add the vddk-init-image parameter to the data stanza:

    ...
    data:
      vddk-init-image: <server/username/reponame:tag> (1)
    1 Specify your repository details.

Importing a VMware virtual machine or template

You can import a VMware virtual machine or template using the virtual machine wizard.

Prerequisites
  • You must create a VDDK image, push it to an image registry, and add it to the v2v-vmware ConfigMap.

  • There must be sufficient storage space for the imported disk.

    If you try to import a virtual machine whose disk size is larger than the available storage space, the operation cannot complete. You will not be able to import another virtual machine or to clean up the storage because there are insufficient resources to support object deletion. To resolve this situation, you must add more object storage devices to the storage backend.

  • The VMware virtual machine must be powered off.

Procedure
  1. In the container-native virtualization web console, click WorkloadsVirtual Machines.

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

  3. In the General screen, perform the following steps:

    1. Select VMware from the Provider list.

    2. Select Connect to New Instance or a saved vCenter instance from the vCenter instance list.

      • If you select Connect to New Instance, fill in the vCenter hostname, Username, and Password.

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

    3. Select a virtual machine or a template to import from the VM or Template to Import list.

    4. Select an operating system.

    5. Select an existing flavor or Custom from the Flavor list.

      If you select Custom, specify the Memory (GB) and the CPUs.

    6. Select a Workload Profile.

    7. If the virtual machine name is already being used by another virtual machine in the namespace, update the name.

    8. Click Next.

  4. In the Networking screen, perform the following steps:

    1. Click the Options menu kebab of a network interface and select Edit.

    2. Enter a valid network interface name.

      The name can contain lowercase 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 uppercase letters, spaces, periods (.), or special characters.

    3. Select the network interface model.

    4. Select the network definition.

    5. Select the network interface type.

    6. Enter the MAC address.

    7. Click Save and then click Next.

  5. In the Storage screen, perform the following steps:

    1. Click the Options menu kebab of a disk and select Edit.

    2. Enter a valid name.

      The name can contain lowercase 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 uppercase letters, spaces, periods (.), or special characters.

    3. Select the interface type.

    4. Select the storage class.

      If you do not select a storage class, container-native virtualization uses the default storage class to create the virtual machine.

    5. Click Save and then click Next.

  6. In the Advanced screen, enter the Hostname and Authorized SSH Keys if you are using cloud-init.

  7. Click Next.

  8. Review your settings and click Create Virtual Machine.

    A Successfully created virtual machine message and a list of resources created for the virtual machine are displayed. The powered off virtual machine appears in WorkloadsVirtual Machines.

  9. Click See virtual machine details to view the dashboard of the imported virtual machine.

    If an error occurs, perform the following steps:

    1. Click WorkloadsPods.

    2. Click the Conversion Pod, for example, kubevirt-v2v-conversion-rhel7-mini-1-27b9h.

    3. Click Logs and check for error messages.

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

Updating the imported VMware virtual machine’s NIC name

You must update the NIC name of a virtual machine imported from VMware to conform to container-native virtualization naming conventions.

Procedure
  1. Log in to the virtual machine.

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

  3. Change the network configuration file name to ifcfg-eth0:

    $ mv vmnic0 ifcfg-eth0 (1)
    1 Additional network configuration files are numbered sequentially, for example, ifcfg-eth1, ifcfg-eth2.
  4. Update the NAME and DEVICE parameters in the network configuration file:

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

    $ systemctl restart network

Troubleshooting a VMware virtual machine import

If an imported virtual machine’s status is Import error: (VMware), you can check the Conversion Pod log for errors:

  1. Obtain the Conversion Pod name:

    $ oc get pods -n <project> | grep v2v (1)
    kubevirt-v2v-conversion-f66f7d-zqkz7            1/1     Running     0          4h49m
    1 Specify the project of your imported virtual machine.
  2. Obtain the Conversion Pod log:

    $ oc logs kubevirt-v2v-conversion-f66f7d-zqkz7 -f -n <project>

Error messages

  • If an imported virtual machine event displays the error message, Readiness probe failed, the following error message appears in the Conversion Pod log:

    INFO - have error: ('virt-v2v error: internal error: invalid argument: libvirt domain ‘v2v_migration_vm_1’ is running or paused. It must be shut down in order to perform virt-v2v conversion',)"

    You must ensure that the virtual machine is shut down before importing it.

Known issues

  • Migration progress status is not displayed in the Cluster Application Migration tool web console. (1830780)

    This issue does not affect the migration itself.

Virtual machine wizard fields

Virtual machine wizard fields

Name Parameter Description

Template

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

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.

Disk

Provision virtual machine from a disk.

Operating System

The primary operating system that is selected for the virtual machine.

Flavor

small, medium, large, tiny, Custom

Presets that determine the amount of CPU and memory allocated to the virtual machine. The presets displayed for Flavor are determined by the operating system.

Memory

Size in GiB of the memory allocated to the virtual machine.

CPUs

The amount of CPU allocated to the virtual machine.

Workload Profile

High Performance

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

Server

A profile optimized to run server workloads.

Desktop

A virtual machine configuration for use on a desktop.

Name

The name can contain lowercase 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 uppercase letters, spaces, periods (.), or special characters.

Description

Optional description field.

Start virtual machine on creation

Select to automatically start the virtual machine upon creation.

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

Name

Name for the Network Interface Card.

Model

Indicates the model of the Network Interface Card. Supported values are e1000, e1000e, ne2k_pci, pcnet, rtl8139, and virtIO.

Network

List of available NetworkAttachmentDefinition objects.

Type

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.

MAC Address

MAC address for the Network Interface Card. If a MAC address is not specified, an ephemeral address is generated for the session.

Storage fields

Name Description

Source

Select a blank disk for the virtual machine or choose from the options available: URL, Container, Attach Cloned Disk, or Attach Disk. To select an existing disk and attach it to the virtual machine, choose Attach Cloned Disk or Attach Disk from a list of available PersistentVolumeClaims (PVCs).

Name

Name of the disk. The name can contain lowercase 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 uppercase letters, spaces, or special characters.

Size (GiB)

Size, in GiB, of the disk.

Interface

Type of disk device. Supported interfaces are virtIO, SATA, and SCSI.

Storage class

The StorageClass that is used to create the disk.