From 719be6facfba325c745be8585fb9a7979dbfc866 Mon Sep 17 00:00:00 2001 From: sbeskin Date: Wed, 19 Feb 2025 10:13:04 +0200 Subject: [PATCH] CNV-45436 --- modules/virt-accessing-rdp-console.adoc | 2 +- modules/virt-attaching-vm-to-ovn-secondary-nw-cli.adoc | 2 +- modules/virt-configuring-downward-metrics.adoc | 2 +- modules/virt-configuring-runstrategy-vm.adoc | 5 ----- modules/virt-configuring-vm-real-time.adoc | 2 +- modules/virt-connecting-vm-secondarynw-using-fqdn.adoc | 2 +- ...-new-vm-from-cloned-pvc-using-datavolumetemplate.adoc | 2 +- modules/virt-creating-service-cli.adoc | 2 +- modules/virt-creating-vm-cli.adoc | 2 +- ...virt-creating-vm-cloned-pvc-data-volume-template.adoc | 2 +- modules/virt-defining-watchdog-device-vm.adoc | 2 +- modules/virt-runstrategies-vms.adoc | 4 ++-- modules/virt-setting-resource-quota-limits-for-vms.adoc | 2 +- modules/virt-vm-custom-scheduler.adoc | 2 +- snippets/virt-dynamic-key.yaml | 2 +- snippets/virt-static-key.yaml | 2 +- virt/monitoring/virt-monitoring-vm-health.adoc | 2 +- virt/nodes/virt-node-maintenance.adoc | 9 +-------- 18 files changed, 18 insertions(+), 30 deletions(-) diff --git a/modules/virt-accessing-rdp-console.adoc b/modules/virt-accessing-rdp-console.adoc index 4e0aa7436bba..ec5c2feb29b9 100644 --- a/modules/virt-accessing-rdp-console.adoc +++ b/modules/virt-accessing-rdp-console.adoc @@ -25,7 +25,7 @@ metadata: name: vm-ephemeral namespace: example-namespace spec: - running: false + runStrategy: Halted template: metadata: labels: diff --git a/modules/virt-attaching-vm-to-ovn-secondary-nw-cli.adoc b/modules/virt-attaching-vm-to-ovn-secondary-nw-cli.adoc index 987774ce0661..10e5b2180330 100644 --- a/modules/virt-attaching-vm-to-ovn-secondary-nw-cli.adoc +++ b/modules/virt-attaching-vm-to-ovn-secondary-nw-cli.adoc @@ -22,7 +22,7 @@ kind: VirtualMachine metadata: name: vm-server spec: - running: true + runStrategy: Always template: spec: domain: diff --git a/modules/virt-configuring-downward-metrics.adoc b/modules/virt-configuring-downward-metrics.adoc index 797ba6eebb8a..f988d08a3964 100644 --- a/modules/virt-configuring-downward-metrics.adoc +++ b/modules/virt-configuring-downward-metrics.adoc @@ -40,7 +40,7 @@ spec: name: u1.medium preference: name: fedora - running: true + runStrategy: Always template: metadata: labels: diff --git a/modules/virt-configuring-runstrategy-vm.adoc b/modules/virt-configuring-runstrategy-vm.adoc index e56d84c4703d..c585c95950c1 100644 --- a/modules/virt-configuring-runstrategy-vm.adoc +++ b/modules/virt-configuring-runstrategy-vm.adoc @@ -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: diff --git a/modules/virt-configuring-vm-real-time.adoc b/modules/virt-configuring-vm-real-time.adoc index 3dd0f52f30d7..a3483d04413f 100644 --- a/modules/virt-configuring-vm-real-time.adoc +++ b/modules/virt-configuring-vm-real-time.adoc @@ -23,7 +23,7 @@ kind: VirtualMachine metadata: name: realtime-vm spec: - running: true + runStrategy: Always template: metadata: annotations: diff --git a/modules/virt-connecting-vm-secondarynw-using-fqdn.adoc b/modules/virt-connecting-vm-secondarynw-using-fqdn.adoc index 55ab60138cb5..be2b6ff6e8b4 100644 --- a/modules/virt-connecting-vm-secondarynw-using-fqdn.adoc +++ b/modules/virt-connecting-vm-secondarynw-using-fqdn.adoc @@ -40,7 +40,7 @@ metadata: name: example-vm namespace: example-namespace spec: - running: true + runStrategy: Always template: spec: domain: diff --git a/modules/virt-creating-new-vm-from-cloned-pvc-using-datavolumetemplate.adoc b/modules/virt-creating-new-vm-from-cloned-pvc-using-datavolumetemplate.adoc index b1d2cad5a1d7..0de6292020c1 100644 --- a/modules/virt-creating-new-vm-from-cloned-pvc-using-datavolumetemplate.adoc +++ b/modules/virt-creating-new-vm-from-cloned-pvc-using-datavolumetemplate.adoc @@ -47,7 +47,7 @@ metadata: kubevirt.io/vm: vm-dv-clone name: vm-dv-clone <1> spec: - running: false + runStrategy: Halted template: metadata: labels: diff --git a/modules/virt-creating-service-cli.adoc b/modules/virt-creating-service-cli.adoc index 126fc7b17ef3..847714d437c2 100644 --- a/modules/virt-creating-service-cli.adoc +++ b/modules/virt-creating-service-cli.adoc @@ -25,7 +25,7 @@ metadata: name: example-vm namespace: example-namespace spec: - running: false + runStrategy: Halted template: metadata: labels: diff --git a/modules/virt-creating-vm-cli.adoc b/modules/virt-creating-vm-cli.adoc index c69f8b212d4b..de67ef21bd30 100644 --- a/modules/virt-creating-vm-cli.adoc +++ b/modules/virt-creating-vm-cli.adoc @@ -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: diff --git a/modules/virt-creating-vm-cloned-pvc-data-volume-template.adoc b/modules/virt-creating-vm-cloned-pvc-data-volume-template.adoc index cb47006fee68..a7f323abdd28 100644 --- a/modules/virt-creating-vm-cloned-pvc-data-volume-template.adoc +++ b/modules/virt-creating-vm-cloned-pvc-data-volume-template.adoc @@ -27,7 +27,7 @@ metadata: kubevirt.io/vm: vm-dv-clone name: vm-dv-clone <1> spec: - running: false + runStrategy: Halted template: metadata: labels: diff --git a/modules/virt-defining-watchdog-device-vm.adoc b/modules/virt-defining-watchdog-device-vm.adoc index f2959f889ea7..cb6854361acb 100644 --- a/modules/virt-defining-watchdog-device-vm.adoc +++ b/modules/virt-defining-watchdog-device-vm.adoc @@ -25,7 +25,7 @@ metadata: kubevirt.io/vm: vm2-rhel84-watchdog name: spec: - running: false + runStrategy: Halted template: metadata: labels: diff --git a/modules/virt-runstrategies-vms.adoc b/modules/virt-runstrategies-vms.adoc index 39eb8483ca2f..6a68799b55e3 100644 --- a/modules/virt-runstrategies-vms.adoc +++ b/modules/virt-runstrategies-vms.adoc @@ -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. diff --git a/modules/virt-setting-resource-quota-limits-for-vms.adoc b/modules/virt-setting-resource-quota-limits-for-vms.adoc index 4f802b689735..7123c09479da 100644 --- a/modules/virt-setting-resource-quota-limits-for-vms.adoc +++ b/modules/virt-setting-resource-quota-limits-for-vms.adoc @@ -19,7 +19,7 @@ kind: VirtualMachine metadata: name: with-limits spec: - running: false + runStrategy: Halted template: spec: domain: diff --git a/modules/virt-vm-custom-scheduler.adoc b/modules/virt-vm-custom-scheduler.adoc index 7d973f8713f0..83de4f57a503 100644 --- a/modules/virt-vm-custom-scheduler.adoc +++ b/modules/virt-vm-custom-scheduler.adoc @@ -22,7 +22,7 @@ kind: VirtualMachine metadata: name: vm-fedora spec: - running: true + runStrategy: Always template: spec: schedulerName: my-scheduler <1> diff --git a/snippets/virt-dynamic-key.yaml b/snippets/virt-dynamic-key.yaml index cd5b8eae9eb2..2caf565d526f 100644 --- a/snippets/virt-dynamic-key.yaml +++ b/snippets/virt-dynamic-key.yaml @@ -18,7 +18,7 @@ spec: name: u1.medium preference: name: rhel.9 - running: true + runStrategy: Always template: spec: domain: diff --git a/snippets/virt-static-key.yaml b/snippets/virt-static-key.yaml index 14d2bf1e7a59..b80495a807a9 100644 --- a/snippets/virt-static-key.yaml +++ b/snippets/virt-static-key.yaml @@ -18,7 +18,7 @@ spec: name: u1.medium preference: name: rhel.9 - running: true + runStrategy: Always template: spec: domain: diff --git a/virt/monitoring/virt-monitoring-vm-health.adoc b/virt/monitoring/virt-monitoring-vm-health.adoc index ab7a199d6409..1134e6a6476c 100644 --- a/virt/monitoring/virt-monitoring-vm-health.adoc +++ b/virt/monitoring/virt-monitoring-vm-health.adoc @@ -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] diff --git a/virt/nodes/virt-node-maintenance.adoc b/virt/nodes/virt-node-maintenance.adoc index 04a2acfd9489..9bdce4d490f1 100644 --- a/virt/nodes/virt-node-maintenance.adoc +++ b/virt/nodes/virt-node-maintenance.adoc @@ -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]