Live Migration failed
Scenario
Using live migration
, the user is attempting to migrate a virtual machine from one node to another.
The primary goal is to investigate the cause of the live migration failure and take corrective action to successfully migrate the exercise6 virtual machine to another node. Your task is to identify the root cause and resolve the issue.
|
The steps to fix exercise6 are:
Console
-
Login to OpenShift console using the assigned user account.
userx
{password}
-
Go to Virtualization - VirtualMachines - Select the project for the assigned user account - look for VM called
exercise6
.
-
Open the Virtual Machine
exercise6
to get it’s details.
-
Try to migrate the virtual machine using Live Migration. Migration is going to fail.
-
Examine the logs of the
virt-launcher-exercise6
pod to identify the root cause.-
Go to the project for the assigned user account and then look for the failed pod.
-
-
Check the pod logs. The issue occurs because the virtual machine disks are configured as read-only, preventing migration.
{"component":"virt-launcher","level":"error","msg":"Operation not supported: Cannot migrate empty or read-only disk vdb","pos":"qemuMigrationDstStartNBDServer:628","subcomponent":"libvirt","thread":"33","timestamp":"2024-11-20T11:44:26.459000Z"}
-
Stop the virtual machine to edit it’s configuration.
-
Edit the virtual machine and remove the fields
readonly: true
from the VM disks. Go to theYAML
section and change the fieldspec.template.spec.domain.devices.disks.readonly
to false.
devices:
disks:
- disk:
bus: virtio
name: rootdisk
- disk:
bus: virtio
readonly: false
name: cloudinitdisk
interfaces:
-
Start again the virtual machine. Check the node where the virtual machine is placed.
-
Migrate virtual machine.
-
The virtual machine should be migrated to another node successfully.
lab grade exercise6
Command line (CLI)
-
Login to Openshift server API using the assigned user account with
oc
command if not logged in.
{login_command}
-
Go to the assigned namespace-userx
oc project namespace-userx
-
Check there is a virtual machine running in this namespace. The output should be similar to the following one:
oc get vmi
NAME AGE PHASE IP NODENAME READY exercise6 11m Running 10.132.2.46 worker-cluster-1 True
-
Migrate the virtual machine using the
virtctl
command.
virtctl migrate exercise6
-
Check the migration status by retreiving the
VirtualMachineInstanceMigration
object. The output should indicate that the migration is in theFailed
phase.
oc get VirtualMachineInstanceMigration
NAME PHASE VMI kubevirt-migrate-vm Failed exercise6
-
Stop the virtual machine.
virtctl stop exercise6
-
Edit the virtual machine and remove the fields
readonly: true
from the VM disks. Change the fieldspec.template.spec.domain.devices.disks.readonly
to false.
oc edit vm exercise6
devices:
disks:
- disk:
bus: virtio
name: rootdisk
- disk:
bus: virtio
readonly: false
name: cloudinitdisk
interfaces:
-
Start again the virtual machine.
virtctl start exercise6
-
Check the node where the virtual machine is placed.
oc get vmi
NAME AGE PHASE IP NODENAME READY exercise6 98s Running 10.132.2.48 worker-cluster-vmnjk-1 True
-
Migrate the virtual machine.
virtctl migrate exercise6
-
Check the migration status by retreiving the
VirtualMachineInstanceMigration
object. Now, the output should indicate that the migration is in theSucceeded
phase.
oc get VirtualMachineInstanceMigration
NAME PHASE VMI kubevirt-migrate-vm Succeeded exercise6
-
Check the node where the vortual machine is now placed
oc get vmi
NAME AGE PHASE IP NODENAME READY exercise6 3m50s Running 10.135.1.196 worker-cluster-vmnjk-3 True
What you learned
In this exercise, you learned that virtual machines readonly
disks attached cannot be live migrated between nodes in OpenShift Virtualization.
This limitation occurs because live migration involves creating a new instance of the virtual machine on the target node,
which fails due to the RWO disk’s single-node access restriction.