// Module included in the following assemblies:
//
// updating/updating_a_cluster/updating-hardware-on-nodes-running-in-vsphere.adoc

:_mod-docs-content-type: PROCEDURE
[id="update-vsphere-virtual-hardware-on-compute-nodes_{context}"]
= Updating the virtual hardware for compute nodes on vSphere

[role="_abstract"]
You can update the virtual hardware for compute nodes on vSphere.

To reduce the risk of downtime, it is recommended that compute nodes be updated serially.

[NOTE]
====
Multiple compute nodes can be updated in parallel given workloads are tolerant of having multiple nodes in a `NotReady` state. It is the responsibility of the administrator to ensure that the required compute nodes are available.
====

.Prerequisites

* You have cluster administrator permissions to execute the required permissions in the vCenter instance hosting your {product-title} cluster.
* Your vSphere ESXi hosts are version 8.0 Update 1 or later, or VWware vSphere Foundation 9, or VMware Cloud Foundation 9.

.Procedure

. List the compute nodes in your cluster by running the following command:
+
[source,terminal]
----
$ oc get nodes -l node-role.kubernetes.io/worker
----
+
.Example output
[source,terminal]
----
NAME              STATUS   ROLES    AGE   VERSION
compute-node-0    Ready    worker   30m   v1.35.4
compute-node-1    Ready    worker   30m   v1.35.4
compute-node-2    Ready    worker   30m   v1.35.4
----
+
Note the names of your compute nodes.

. Mark the compute node as unschedulable by running the following command:
+
[source,terminal]
----
$ oc adm cordon <compute_node>
----

. Evacuate the pods from the compute node. There are several ways to do this. For example, you can evacuate all or selected pods on a node by running the following command:
+
[source,terminal]
----
$ oc adm drain <compute_node> [--pod-selector=<pod_selector>]
----
+
See "Evacuating pods on nodes" for other options to evacuate pods from a node.

. Shut down the virtual machine (VM) associated with the compute node. Do this in the vSphere client by right-clicking the VM and selecting *Power* -> *Shut Down Guest OS*. Do not shut down the VM using *Power Off* because it might not shut down safely.

. Update the VM in the vSphere client. Follow link:https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vm_admin.doc/GUID-60768C2F-72E1-42E0-8A17-CA76849F2950.html[Upgrade the Compatibility of a Virtual Machine Manually] (VMware vSphere documentation).

. Power on the VM associated with the compute node. Do this in the vSphere client by right-clicking the VM and selecting *Power On*.

. Run the following command and wait for the node to report as `Ready`:
+
[source,terminal]
----
$ oc wait --for=condition=Ready node/<compute_node>
----

. Mark the compute node as schedulable again by running the following command:
+
[source,terminal]
----
$ oc adm uncordon <compute_node>
----

. Repeat this procedure for each compute node in your cluster.
