1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/virt/nodes/virt-node-maintenance.adoc
2025-10-07 12:26:32 -04:00

97 lines
4.5 KiB
Plaintext

:_mod-docs-content-type: ASSEMBLY
[id="virt-node-maintenance"]
= Node maintenance
include::_attributes/common-attributes.adoc[]
:context: virt-node-maintenance
toc::[]
Nodes can be placed into maintenance mode by using the `oc adm` utility or `NodeMaintenance` custom resources (CRs).
[NOTE]
====
The `node-maintenance-operator` (NMO) is no longer shipped with {VirtProductName}. It is deployed as a standalone Operator from the software catalog in the {product-title} web console or by using the OpenShift CLI (`oc`).
For more information on remediation, fencing, and maintaining nodes, see the link:https://access.redhat.com/documentation/en-us/workload_availability_for_red_hat_openshift/23.2/html-single/remediation_fencing_and_maintenance/index#about-remediation-fencing-maintenance[Workload Availability for Red Hat OpenShift] documentation.
====
[IMPORTANT]
====
Virtual machines (VMs) must have a persistent volume claim (PVC) with a shared `ReadWriteMany` (RWX) access mode to be live migrated.
====
The Node Maintenance Operator watches for new or deleted `NodeMaintenance` CRs. When a new `NodeMaintenance` CR is detected, no new workloads are scheduled and the node is cordoned off from the rest of the cluster. All pods that can be evicted are evicted from the node. When a `NodeMaintenance` CR is deleted, the node that is referenced in the CR is made available for new workloads.
[NOTE]
====
Using a `NodeMaintenance` CR for node maintenance tasks achieves the same results as the `oc adm cordon` and `oc adm drain` commands using standard {product-title} custom resource processing.
====
[id="eviction-strategies"]
== Eviction strategies
Placing a node into maintenance marks the node as unschedulable and drains all the VMs and pods from it.
You can configure eviction strategies for virtual machines (VMs) or for the cluster.
VM eviction strategy::
The VM `LiveMigrate` eviction strategy ensures that a virtual machine instance (VMI) is not interrupted if the node is placed into maintenance or drained. VMIs with this eviction strategy will be live migrated to another node.
+
You can configure eviction strategies for virtual machines (VMs) by using the {product-title} web console or the xref:../../virt/live_migration/virt-configuring-live-migration.adoc#virt-configuring-a-live-migration-policy_virt-configuring-live-migration[command line].
+
[IMPORTANT]
====
The default eviction strategy is `LiveMigrate`. A non-migratable VM with a `LiveMigrate` eviction strategy might prevent nodes from draining or block an infrastructure upgrade because the VM is not evicted from the node. This situation causes a migration to remain in a `Pending` or `Scheduling` state unless you shut down the VM manually.
You must set the eviction strategy of non-migratable VMs to `LiveMigrateIfPossible`, which does not block an upgrade, or to `None`, for VMs that should not be migrated.
====
// Hiding in ROSA/OSD as TP not supported
ifndef::openshift-rosa,openshift-dedicated[]
Cluster eviction strategy::
You can configure an eviction strategy for the cluster to prioritize workload continuity or infrastructure upgrade.
.Cluster eviction strategies
[cols="1,2,1,1",options="header"]
|====
|Eviction strategy |Description |Interrupts workflow |Blocks upgrades
|`LiveMigrate` ^1^ |Prioritizes workload continuity over upgrades. |No |Yes ^2^
|`LiveMigrateIfPossible` |Prioritizes upgrades over workload continuity to ensure that the environment is updated. |Yes |No
|`None` ^3^ |Shuts down VMs with no eviction strategy. |Yes |No
|====
[.small]
--
1. Default eviction strategy for multi-node clusters.
2. If a VM blocks an upgrade, you must shut down the VM manually.
3. Default eviction strategy for {sno}.
--
endif::openshift-rosa,openshift-dedicated[]
include::modules/virt-configuring-vm-eviction-strategy-cli.adoc[leveloffset=+2]
// Hiding in ROSA/OSD as Tech Preview features are not suppotred
ifndef::openshift-rosa,openshift-dedicated[]
include::modules/virt-configuring-cluster-eviction-strategy-cli.adoc[leveloffset=+2]
endif::openshift-rosa,openshift-dedicated[]
[id="run-strategies"]
== Run strategies
The `spec.runStrategy` key determines how a VM behaves under certain conditions.
include::modules/virt-runstrategies-vms.adoc[leveloffset=+2]
include::modules/virt-configuring-runstrategy-vm.adoc[leveloffset=+2]
include::modules/virt-maintaining-bare-metal-nodes.adoc[leveloffset=+1]
[role="_additional-resources"]
[id="additional-resources_virt-node-maintenance"]
== Additional resources
* xref:../../virt/live_migration/virt-about-live-migration.adoc#virt-about-live-migration[About live migration]