|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * virt/upgrading-virt.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="virt-preventing-workload-updates-during-eus-update_{context}"] |
| 7 | += Preventing workload updates during an EUS-to-EUS update |
| 8 | + |
| 9 | +When you update from one Extended Update Support (EUS) version to the next, you must manually disable automatic workload updates to prevent {VirtProductName} from migrating or evicting workloads during the update process. |
| 10 | + |
| 11 | +.Prerequisites |
| 12 | + |
| 13 | +* You are running an EUS version of {product-title} and want to update to the next EUS version. You have not yet updated to the odd-numbered version in between. |
| 14 | +
|
| 15 | +* You read "Preparing to perform an EUS-to-EUS update" and learned the caveats and requirements that pertain to your {product-title} cluster. |
| 16 | +
|
| 17 | +* You paused the worker nodes' machine config pools as directed by the {product-title} documentation. |
| 18 | +
|
| 19 | +* Your {VirtProductName} subscription uses the *Automatic* approval strategy. |
| 20 | ++ |
| 21 | +[NOTE] |
| 22 | +==== |
| 23 | +If you use the *Manual* approval strategy, you must approve all pending updates in the web console. This is discouraged because your cluster becomes unsupported if your {VirtProductName} and {product-title} versions are out of sync. For more details, refer to the "Manually approving a pending Operator update" section. |
| 24 | +==== |
| 25 | +
|
| 26 | +.Procedure |
| 27 | + |
| 28 | +. Back up the current `workloadUpdateMethods` configuration by running the following command: |
| 29 | ++ |
| 30 | +[source,terminal] |
| 31 | +---- |
| 32 | +$ WORKLOAD_UPDATE_METHODS=$(oc get kv kubevirt-kubevirt-hyperconverged -n openshift-cnv -o jsonpath='{.spec.workloadUpdateStrategy.workloadUpdateMethods}') |
| 33 | +---- |
| 34 | + |
| 35 | +. Turn off all workload update methods by running the following command: |
| 36 | ++ |
| 37 | +[source,terminal] |
| 38 | +---- |
| 39 | +$ oc patch hco kubevirt-hyperconverged -n openshift-cnv --type json -p '[{"op":"replace","path":"/spec/workloadUpdateStrategy/workloadUpdateMethods", "value":[]}]' |
| 40 | +---- |
| 41 | ++ |
| 42 | +.Example output |
| 43 | +[source,terminal] |
| 44 | +---- |
| 45 | +hyperconverged.hco.kubevirt.io/kubevirt-hyperconverged patched |
| 46 | +---- |
| 47 | + |
| 48 | +. Ensure that the `HyperConverged` Operator is `Upgradeable` before you continue. Enter the following command and monitor the output: |
| 49 | ++ |
| 50 | +[source,terminal] |
| 51 | +---- |
| 52 | +$ oc get hco kubevirt-hyperconverged -n openshift-cnv -o json | jq ".status.conditions" |
| 53 | +---- |
| 54 | ++ |
| 55 | +.Example output |
| 56 | +[%collapsible] |
| 57 | +==== |
| 58 | +[source,json] |
| 59 | +---- |
| 60 | +[ |
| 61 | + { |
| 62 | + "lastTransitionTime": "2022-12-09T16:29:11Z", |
| 63 | + "message": "Reconcile completed successfully", |
| 64 | + "observedGeneration": 3, |
| 65 | + "reason": "ReconcileCompleted", |
| 66 | + "status": "True", |
| 67 | + "type": "ReconcileComplete" |
| 68 | + }, |
| 69 | + { |
| 70 | + "lastTransitionTime": "2022-12-09T20:30:10Z", |
| 71 | + "message": "Reconcile completed successfully", |
| 72 | + "observedGeneration": 3, |
| 73 | + "reason": "ReconcileCompleted", |
| 74 | + "status": "True", |
| 75 | + "type": "Available" |
| 76 | + }, |
| 77 | + { |
| 78 | + "lastTransitionTime": "2022-12-09T20:30:10Z", |
| 79 | + "message": "Reconcile completed successfully", |
| 80 | + "observedGeneration": 3, |
| 81 | + "reason": "ReconcileCompleted", |
| 82 | + "status": "False", |
| 83 | + "type": "Progressing" |
| 84 | + }, |
| 85 | + { |
| 86 | + "lastTransitionTime": "2022-12-09T16:39:11Z", |
| 87 | + "message": "Reconcile completed successfully", |
| 88 | + "observedGeneration": 3, |
| 89 | + "reason": "ReconcileCompleted", |
| 90 | + "status": "False", |
| 91 | + "type": "Degraded" |
| 92 | + }, |
| 93 | + { |
| 94 | + "lastTransitionTime": "2022-12-09T20:30:10Z", |
| 95 | + "message": "Reconcile completed successfully", |
| 96 | + "observedGeneration": 3, |
| 97 | + "reason": "ReconcileCompleted", |
| 98 | + "status": "True", |
| 99 | + "type": "Upgradeable" <1> |
| 100 | + } |
| 101 | +] |
| 102 | +---- |
| 103 | +==== |
| 104 | +<1> The {VirtProductName} Operator has the `Upgradeable` status. |
| 105 | +
|
| 106 | +. Manually update your cluster from the source EUS version to the next minor version of {product-title}: |
| 107 | ++ |
| 108 | +[source,terminal] |
| 109 | ++ |
| 110 | +---- |
| 111 | +$ oc adm upgrade |
| 112 | +---- |
| 113 | ++ |
| 114 | +.Verification |
| 115 | +* Check the current version by running the following command: |
| 116 | ++ |
| 117 | +[source,terminal] |
| 118 | +---- |
| 119 | +$ oc get clusterversion |
| 120 | +---- |
| 121 | ++ |
| 122 | +[NOTE] |
| 123 | +==== |
| 124 | +Updating {product-title} to the next version is a prerequisite for updating {VirtProductName}. For more details, refer to the "Updating clusters" section of the {product-title} documentation. |
| 125 | +==== |
| 126 | + |
| 127 | +. With the default *Automatic* approval strategy, {VirtProductName} automatically updates to the corresponding version after you update {product-title}. Monitor the {VirtProductName} update by running the following command: |
| 128 | ++ |
| 129 | +[source,terminal] |
| 130 | +---- |
| 131 | +$ oc get csv -n openshift-cnv |
| 132 | +---- |
| 133 | + |
| 134 | +. Continue to monitor as {VirtProductName} updates to the z-stream versions that are available for the non-EUS version. |
| 135 | + |
| 136 | +. Confirm that {VirtProductName} successfully updated to the latest z-stream release of the non-EUS version by running the following command: |
| 137 | ++ |
| 138 | +[source,terminal] |
| 139 | +---- |
| 140 | +$ oc get hco kubevirt-hyperconverged -n openshift-cnv -o json | jq ".status.versions" |
| 141 | +---- |
| 142 | ++ |
| 143 | +.Example output |
| 144 | +[source,terminal,subs="attributes+"] |
| 145 | +---- |
| 146 | +[ |
| 147 | + { |
| 148 | + "name": "operator", |
| 149 | + "version": "{HCOVersion}" |
| 150 | + } |
| 151 | +] |
| 152 | +---- |
| 153 | + |
| 154 | +. Wait until the `HyperConverged` Operator has the `Upgradeable` status before you perform the next update. Enter the following command and monitor the output: |
| 155 | ++ |
| 156 | +[source,terminal] |
| 157 | +---- |
| 158 | +$ oc get hco kubevirt-hyperconverged -n openshift-cnv -o json | jq ".status.conditions" |
| 159 | +---- |
| 160 | + |
| 161 | +. Update to the target EUS version. |
| 162 | +.. Update {product-title} to the target EUS version. Confirm that the update succeeded by checking the cluster version: |
| 163 | ++ |
| 164 | +[source,terminal] |
| 165 | +---- |
| 166 | +$ oc get clusterversion |
| 167 | +---- |
| 168 | +.. After {product-title} updates, {VirtProductName} automatically updates to the target EUS version. Monitor the update by running the following command: |
| 169 | ++ |
| 170 | +[source,terminal] |
| 171 | +---- |
| 172 | +$ oc get csv -n openshift-cnv |
| 173 | +---- |
| 174 | ++ |
| 175 | +The update completes when the `VERSION` field matches the target EUS version and the `PHASE` field reads `Succeeded`. |
| 176 | + |
| 177 | +. Restore the workload update methods configuration that you backed up: |
| 178 | ++ |
| 179 | +[source,terminal] |
| 180 | +---- |
| 181 | +$ oc patch hco kubevirt-hyperconverged -n openshift-cnv --type json -p "[{\"op\":\"add\",\"path\":\"/spec/workloadUpdateStrategy/workloadUpdateMethods\", \"value\":$WORKLOAD_UPDATE_METHODS}]" |
| 182 | +---- |
| 183 | ++ |
| 184 | +.Example output |
| 185 | +[source,terminal] |
| 186 | +---- |
| 187 | +hyperconverged.hco.kubevirt.io/kubevirt-hyperconverged patched |
| 188 | +---- |
| 189 | ++ |
| 190 | +.Verification |
| 191 | + |
| 192 | +* Check the status of VM migration by running the following command: |
| 193 | ++ |
| 194 | +[source,terminal] |
| 195 | +---- |
| 196 | +$ oc get vmim -A |
| 197 | +---- |
| 198 | +
|
| 199 | +.Next steps |
| 200 | + |
| 201 | +* You can now unpause the worker nodes' machine config pools. |
0 commit comments