Migrate a VM to a VMO cluster
During large scale Kubernetes adoptions, workloads are often rehosted or migrated instead of being redeployed from scratch. This process allows system administrators to copy the application, together with its data, to a Kubernetes cluster. However, the migration of VMs can be time consuming if done manually, so it is often automated with open-source tools such as Forklift.
The Palette CLI provides the ability to migrate Virtual Machines (VMs) from VMware vSphere to Palette VMO.
Limitations
-
You can only migrate VMs hosted in VMware vSphere.
-
Only VMs whose operating systems are included under
virt-v2v
supported guest systems can be migrated. -
The network type Multus CNI requires a Network Attachment Definition (NAD) to exist in the migration target namespace in the destination cluster. The NAD name must also match the name assigned to the migration. The migration name is assigned during the wizard, which is started by the Palette CLI's
vmo migrate-vm
command.
Prerequisites
-
A Healthy VMO cluster. Refer to the Create a VMO Profile for further guidance.
- The VMO cluster must have access to VMware and the VM you want to migrate.
warningIf you need to provision
Block
storage volumes during the VM migration process, add the following custom configuration to your VMO cluster OS pack. Applying this configuration may cause a cluster repave. For more information, refer to Repave Behaviors and ConfigurationsAdditionally, we recommend provisioning volumes with the
ReadWriteMany
access mode to ensure that VMs can be live migrated.kubeadmconfig:
preKubeadmCommands:
# Start containerd with new configuration
- systemctl daemon-reload
- systemctl restart containerd
files:
- targetPath: /etc/containerd/config.toml
targetOwner: "root:root"
targetPermissions: "0644"
content: |
## template: jinja
# Use config version 2 to enable new configuration fields.
version = 2
imports = ["/etc/containerd/conf.d/*.toml"]
[plugins]
[plugins."io.containerd.grpc.v1.cri"]
sandbox_image = "registry.k8s.io/pause:3.9"
device_ownership_from_security_context = true
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
SystemdCgroup = true -
A VMware vSphere user account with the necessary permissions to manage the VMs you want to migrate.
- Migration can optionally accelerated by providing credentials for the ESXi hosts where the VMs reside.
-
One or more VMs hosted in VMware vSphere. Only VMs whose operating systems are included under
virt-v2v
supported guest systems can be migrated.- The VMs must be powered off before migration.
- Ensure that VMs operating Windows are shut down at the virtualized OS level.
- If you are migrating more than one VM in the same plan, they must all share the same network.
-
The Palette CLI installed and setup. Refer to the Installation guide for further details.
- The Palette CLI must have access to both the VMO cluster and the machines to be migrated.
-
The kubectl command-line tool should also be installed. Refer to the kubectl installation guide to learn more.