Migrating virtual machines to Virtuozzo Hybrid Infrastructure offline

If the network connection between the virt-v2v appliance VM and VMware vCenter is inferior, you can manually copy the VMs to a USB drive, connect it to the virt-v2v appliance VM, and convert them to Virtuozzo Hybrid Infrastructure.

Take note of the following before you proceed:

  • You can migrate VMs created on vCenter 5.0 or newer.
  • Remove VMware tools from Windows VMs before the migration to avoid issues on boot afterwards. VMware tools will be removed from Linux guests automatically.

To migrate a VM from VMware vCenter offline, do the following:

  1. Copy all of the VM files, including vmdk and vmx, to a USB drive.
  2. Attach the USB drive to a host in the same local network as the appliance VM.
  3. Log in to the appliance VM as the admin user with the SSH key.
  4. Get root privileges, for example, with sudo -i.
  5. Copy VM files to the appliance VM, for example, using rsync or scp.
  6. Set OpenStack credentials:

    # source user-openrc.sh
    
  7. Migrate the VM to a volume in Virtuozzo Hybrid Infrastructure specifying a storage policy. To list available storage policies, run vinfra service compute storage-policy list in Virtuozzo Hybrid Infrastructure. For example:

    # virt-v2v -i libvirtxml <VM_config> -o openstack \
    -oo server-id=635ae4cc-4c01-461a-ae63-91ca4187a7b1 -os <policy_name>

    Where <VM_config> is the VM configuration file in the vmx format and <policy_name> is the storage policy for the converted volume.

  8. Find out the new volume’s ID or name. For example:

    # openstack --insecure volume list
    +---------------------+------+-----------+------+-------------+
    | ID                  | Name | Status    | Size | Attached to |
    +---------------------+------+-----------+------+-------------+
    | 024b6843-2de3-<...> | sda1 | available |   64 |             |
    +---------------------+------+-----------+------+-------------+
    
  9. If the VM used UEFI firmware, manually set the correct OS distribution and UEFI firmware type for the converted volume. To list available distributions, run vinfra service compute show in Virtuozzo Hybrid Infrastructure. For example:

    # openstack --insecure volume set sda1 --image-property os_distro=win2k8
    # openstack --insecure volume set sda1 --image-property hw_firmware_type=uefi
  10. In Virtuozzo Hybrid Infrastructure, create a virtual machine based on the new volume. For example:

    # vinfra service compute server create migratedvm --network id=private \
    --network id=public --volume source=volume,id=sda1,size=64 --flavor medium
    

After the migration, it is recommended to install the guest tools inside the VM as described in "Installing guest tools" in the Administrator Guide. The guest tools installation will prevent possible problems with guest OS interaction via the VNC console.