Fix Virtual Machine is not starting
Scenario
The user tried to start the VM, but the process failed to execute successfully.
The primary goal in this scenario is to investigate the cause of the failure and take corrective action to get exercise1 virtual machine back into the Running state. The amount of memory available for the virtual machine in this lab is 8GB.
|
The steps to fix the exercise1 are:
Console
-
Login to OpenShift console using the assigned user account.
userx
{password}
-
Go to Virtualization - Virtual Machines and check the VM status.
-
Check the Virtual Machine is failing with error
ErrorUnschedulable
.
-
Go to tab
YAML
and check the status of the Virtual Machine. It is failing with error message:
message: '0/6 nodes are available: 3 Insufficient memory, 3 node(s) had untolerated taint {node-role.kubernetes.io/master: }. preemption: 0/6 nodes are available: 3 No preemption victims found for incoming pod, 3 Preemption is not helpful for scheduling.'
-
Check the memory assigned for the Virtual Machine in the field
spec.domain.memory.guest
.
memory:
guest: 128Gi
-
Edit the
yaml
file to change the assigned value to 8Gi.
memory:
guest: 8Gi
-
Save the updated configuration file and restart the virtual machine.
-
Wait for the virtual machine to start and check that now the virtual machine is in
Running
state.
lab grade exercise1
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 and it’s status. The output should be similar to the following one:
oc get pod,vm
NAME READY STATUS RESTARTS AGE pod/virt-launcher-exercise1 0/1 Pending 0 2m16s NAME AGE STATUS READY virtualmachine.kubevirt.io/exercise1 85m ErrorUnschedulable False
-
Check which the the Virtual Machine status to get more details about the error:
oc describe vm exercise1
status: Conditions: Last Probe Time: 2024-11-26T16:08:54Z Last Transition Time: 2024-11-26T16:08:54Z Message: Guest VM is not reported as running Reason: GuestNotRunning Status: False Type: Ready Last Probe Time: <nil> Last Transition Time: <nil> Message: All of the VMI's DVs are bound and not running Reason: AllDVsReady Status: True Type: DataVolumesReady Last Probe Time: <nil> Last Transition Time: 2024-11-26T16:08:54Z Message: 0/6 nodes are available: 3 Insufficient memory, 3 node(s) had untolerated taint {node-role.kubernetes.io/master: }. preemption: 0/6 nodes are available: 3 No preemption victims found for incoming pod, 3 Preemption is not helpful for scheduling. Reason: Unschedulable Status: False Type: PodScheduled Created: true Desired Generation: 3 Observed Generation: 3 Printable Status: ErrorUnschedulable Run Strategy: Always
-
Inspect the virtual machine and check the memory assigned to it in the field
spec.domain.memory.guest
.
oc get vm exercise1 -oyaml
memory:
guest: 128Gi
-
Edit the virtual machine to assign 8Gi memory.
oc edit vm exercise1
memory:
guest: 8Gi
-
Restart the virtual machine
virtctl restart exercise1
-
Wait until the virtual machine is started and make sure it is in
running
state
oc get pod,vm
NAME READY STATUS RESTARTS AGE pod/virt-launcher-exercise1 1/1 Running 0 55s NAME AGE STATUS READY virtualmachine.kubevirt.io/exercise1 96m Running True