Skip to content

Commit

Permalink
Don't set a CustomCompatibilityVersion on ClusterUpgrade
Browse files Browse the repository at this point in the history
When doing multiple ClusterUpgrades without rebooting the VM in the mean
time, we end up with a next-run config containing an unneeded
CustomCompatibilityVersion set.

This is caused by the fact that oVirt sets the
CustomCompatibilityVersion of the VM after clusterupgrade.
When the VM is then rebooted before the next clusterupgrade, its all
fine.
But if we do a next upgrade without the reboot, the code takes the
current CustomCompatibilityVersion set for its next-run config, which is
invalid!

This patch removes the CustomCompatibilityVersion when vm was updated
during a cluster upgrade and the existing next-run config did not have a
CustomCompatibilityVersion set.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=2094729
Signed-off-by: Jean-Louis Dupond jean-louis@dupond.be
  • Loading branch information
dupondje committed Jun 30, 2022
1 parent c9b4ead commit d9c6d8c
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,17 @@ public void createNextRunSnapshot(
newVm.setClusterBiosType(existingVm.getClusterBiosType());
newVm.setClusterArch(existingVm.getClusterArch());

/**
* When running a cluster update, we should not copy the CustomCompatibilityVersion
* Only set one when there is already one set in the previous next-run config
*/
if (runSnap != null && objectWithEditableDeviceFields.getClusterLevelChangeFromVersion() != null) {
VM nextRunVM = snapshotVmConfigurationHelper.getVmFromConfiguration(runSnap);
if (nextRunVM != null && nextRunVM.getCustomCompatibilityVersion() == null) {
newVm.setCustomCompatibilityVersion(null);
}
}

Set<String> changedFields = getChangedFieldsForStatus(
existingVm.getStaticData(),
newVm.getStaticData(),
Expand Down

0 comments on commit d9c6d8c

Please sign in to comment.