1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00

CNV-45436

This commit is contained in:
sbeskin
2025-02-19 10:13:04 +02:00
committed by openshift-cherrypick-robot
parent 6410b91409
commit 719be6facf
18 changed files with 18 additions and 30 deletions

View File

@@ -25,7 +25,7 @@ metadata:
name: vm-ephemeral
namespace: example-namespace
spec:
running: false
runStrategy: Halted
template:
metadata:
labels:

View File

@@ -22,7 +22,7 @@ kind: VirtualMachine
metadata:
name: vm-server
spec:
running: true
runStrategy: Always
template:
spec:
domain:

View File

@@ -40,7 +40,7 @@ spec:
name: u1.medium
preference:
name: fedora
running: true
runStrategy: Always
template:
metadata:
labels:

View File

@@ -8,11 +8,6 @@
You can configure a run strategy for a virtual machine (VM) by using the command line.
[IMPORTANT]
====
The `spec.runStrategy` and `spec.running` keys are mutually exclusive. A VM configuration that contains values for both keys is invalid.
====
.Procedure
* Edit the `VirtualMachine` resource by running the following command:

View File

@@ -23,7 +23,7 @@ kind: VirtualMachine
metadata:
name: realtime-vm
spec:
running: true
runStrategy: Always
template:
metadata:
annotations:

View File

@@ -40,7 +40,7 @@ metadata:
name: example-vm
namespace: example-namespace
spec:
running: true
runStrategy: Always
template:
spec:
domain:

View File

@@ -47,7 +47,7 @@ metadata:
kubevirt.io/vm: vm-dv-clone
name: vm-dv-clone <1>
spec:
running: false
runStrategy: Halted
template:
metadata:
labels:

View File

@@ -25,7 +25,7 @@ metadata:
name: example-vm
namespace: example-namespace
spec:
running: false
runStrategy: Halted
template:
metadata:
labels:

View File

@@ -38,7 +38,7 @@ This example manifest does not configure VM authentication.
name: u1.medium <3>
preference:
name: rhel.9 <4>
running: true
runStrategy: Always
template:
spec:
domain:

View File

@@ -27,7 +27,7 @@ metadata:
kubevirt.io/vm: vm-dv-clone
name: vm-dv-clone <1>
spec:
running: false
runStrategy: Halted
template:
metadata:
labels:

View File

@@ -25,7 +25,7 @@ metadata:
kubevirt.io/vm: vm2-rhel84-watchdog
name: <vm-name>
spec:
running: false
runStrategy: Halted
template:
metadata:
labels:

View File

@@ -9,7 +9,7 @@
The `spec.runStrategy` key has four possible values:
`Always`::
The virtual machine instance (VMI) is always present when a virtual machine (VM) is created on another node. A new VMI is created if the original stops for any reason. This is the same behavior as `running: true`.
The virtual machine instance (VMI) is always present when a virtual machine (VM) is created on another node. A new VMI is created if the original stops for any reason.
`RerunOnFailure`::
The VMI is re-created on another node if the previous instance fails. The instance is not re-created if the VM stops successfully, such as when it is shut down.
@@ -18,7 +18,7 @@ The VMI is re-created on another node if the previous instance fails. The instan
You control the VMI state manually with the `start`, `stop`, and `restart` virtctl client commands. The VM is not automatically restarted.
`Halted`::
No VMI is present when a VM is created. This is the same behavior as `running: false`.
No VMI is present when a VM is created.
Different combinations of the `virtctl start`, `stop` and `restart` commands affect the run strategy.

View File

@@ -19,7 +19,7 @@ kind: VirtualMachine
metadata:
name: with-limits
spec:
running: false
runStrategy: Halted
template:
spec:
domain:

View File

@@ -22,7 +22,7 @@ kind: VirtualMachine
metadata:
name: vm-fedora
spec:
running: true
runStrategy: Always
template:
spec:
schedulerName: my-scheduler <1>

View File

@@ -18,7 +18,7 @@ spec:
name: u1.medium
preference:
name: rhel.9
running: true
runStrategy: Always
template:
spec:
domain:

View File

@@ -18,7 +18,7 @@ spec:
name: u1.medium
preference:
name: rhel.9
running: true
runStrategy: Always
template:
spec:
domain:

View File

@@ -26,7 +26,7 @@ You can define a watchdog to monitor the health of the guest operating system by
The watchdog device monitors the agent and performs one of the following actions if the guest operating system is unresponsive:
* `poweroff`: The VM powers down immediately. If `spec.running` is set to `true` or `spec.runStrategy` is not set to `manual`, then the VM reboots.
* `poweroff`: The VM powers down immediately. If `spec.runStrategy` is not set to `manual`, the VM reboots.
* `reset`: The VM reboots in place and the guest operating system cannot react.
+
[NOTE]

View File

@@ -82,14 +82,7 @@ endif::openshift-rosa,openshift-dedicated[]
[id="run-strategies"]
== Run strategies
A virtual machine (VM) configured with `spec.running: true` is immediately restarted. The `spec.runStrategy` key provides greater flexibility for determining how a VM behaves under certain conditions.
[IMPORTANT]
====
The `spec.runStrategy` and `spec.running` keys are mutually exclusive. Only one of them can be used.
A VM configuration with both keys is invalid.
====
The `spec.runStrategy` key determines how a VM behaves under certain conditions.
include::modules/virt-runstrategies-vms.adoc[leveloffset=+2]