Host Maintenance
Before you reboot or shut down a host in a PaletteAI VM Launchpad cluster, drain the host with kubectl so that its
virtual machines (VMs) live-migrate to other nodes. When you reboot or shut down a host from Local UI, Local UI drains
the host first, but the host powers off even if that drain fails. The VMs on the host then stop instead of migrating,
and Local UI does not report the failed drain. Refer to Known Issues for
details.
kubectl drain waits while the VMs on the host live-migrate and the other pods leave the host. By default, it has no
time limit. After the drain finishes, Local UI has nothing left to evict when it reboots or shuts down the host.
Prerequisites
-
A VM Launchpad cluster with more than one node and enough free CPU and memory on the other nodes to run the VMs from the host that you plan to reboot or shut down.
-
VMs that must keep running can live-migrate. Each VM uses the LiveMigrate eviction strategy, either set on the VM or inherited from the cluster's Default eviction strategy of Live migrate. Every disk of the VM uses the
ReadWriteManyaccess mode. Refer to KubeVirt Configuration and Live Migration. -
kubectlaccess to the VM Launchpad cluster. From the cluster Overview tab, download the Kubeconfig file.
Drain and Reboot or Shut Down a Host
Work on one host at a time. Finish this procedure, including Validate, before you start on the next host.
Set the KUBECONFIG environment variable to point to the kubeconfig file of your VM Launchpad cluster. Run every
command on this page in the same terminal session, or set the variable again in a new one.
export KUBECONFIG=<path-to-kubeconfig>
Replace <path-to-kubeconfig> with the path to the kubeconfig file.
-
List the nodes of the cluster, and note the name of the node for the host you want to reboot or shut down.
kubectl get nodes -
List the VMs on the node, and note their names. The
NODENAMEcolumn lists the node that each VM runs on, and theLIVE-MIGRATABLEcolumn showsTruefor a VM that can live-migrate.kubectl get vmi --all-namespaces --output wideA VM that shows
Falseand uses the LiveMigrate eviction strategy blocks the drain. Stop that VM before you drain the node, and start it again after the host is back online. Refer to Start, Stop, Restart. -
Drain the node. The command turns off scheduling on the node and evicts its pods. It finishes when the VMs on the node have live-migrated to other nodes.
kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data --forceReplace
<node-name>with the name of the node.While the VMs migrate, the output repeats
error when evicting podsmessages that end withEviction triggered evacuation of VMI. You can ignore these messages. The drain is complete when the output showsnode/<node-name> drained. -
Confirm that no VMs remain on the node. No row in the
NODENAMEcolumn shows the name of the node.kubectl get vmi --all-namespaces --output wide -
Confirm that the migrations succeeded. For each VM that you noted in step 2, a migration whose name begins with
kubevirt-evacuation-showsSucceededin thePHASEcolumn. TheVMIcolumn names the VM. The list can also include earlier migrations.kubectl get vmim --all-namespaces -
Reboot or shut down the host from Local UI. Refer to Reboot, Shutdown, and Reset Edge Host.
-
After the host reboots, or after you power it on again following a shutdown, check whether scheduling is still turned off on the node.
kubectl get node <node-name>Replace
<node-name>with the name of the node.If the
STATUScolumn includesSchedulingDisabled, turn scheduling back on for the node.kubectl uncordon <node-name>Replace
<node-name>with the name of the node.
Validate
-
Confirm that the node is ready and schedulable.
kubectl get node <node-name>Replace
<node-name>with the name of the node. TheSTATUScolumn showsReadywithoutSchedulingDisabled. -
Confirm that your VMs are running.
kubectl get vm --all-namespacesThe
STATUScolumn showsRunningfor each VM that you expect to run.