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.
Limitations
- You can migrate VMs created on vCenter 5.0 or newer.
Prerequisites
- Authentication is configured in the appliance VM, as described in Setting up authentication in the appliance virtual machine.
- 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
- Copy all of the VM files, including
vmdk
andvmx
, to a USB drive. - Attach the USB drive to a host in the same local network as the appliance VM.
- Log in to the appliance VM as the
admin
user with the SSH key. - Get root privileges, for example, with
sudo -i
. - Copy VM files to the appliance VM, for example, using
rsync
orscp
. -
Set OpenStack credentials:
# source user-openrc.sh
-
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 thevmx
format and<policy_name>
is the storage policy for the converted volume. -
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 | | +---------------------+------+-----------+------+-------------+
-
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
-
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. The guest tools installation will prevent possible problems with guest OS interaction via the VNC console.