mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
CA-304656: Stop users from applying automated updates that will bring the server to a verson incompatible with the current XenCenter version.
When running the XenCenter version precheck, calculate the higher server version that will be installed (by looking at the update sequence) and use this for checking the XenCenter version compatibility. Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
parent
23b0517cb7
commit
71333fcf90
@ -348,12 +348,6 @@ namespace XenAdmin.Wizards.PatchingWizard
|
|||||||
{
|
{
|
||||||
var groups = new List<CheckGroup>();
|
var groups = new List<CheckGroup>();
|
||||||
|
|
||||||
//XenCenter version check
|
|
||||||
if (UpdateAlert != null && UpdateAlert.NewServerVersion != null)
|
|
||||||
{
|
|
||||||
groups.Add(new CheckGroup(Messages.CHECKING_XENCENTER_VERSION, new List<Check> {new XenCenterVersionCheck(UpdateAlert.NewServerVersion)}));
|
|
||||||
}
|
|
||||||
|
|
||||||
//HostLivenessCheck checks
|
//HostLivenessCheck checks
|
||||||
var livenessChecks = new List<Check>();
|
var livenessChecks = new List<Check>();
|
||||||
foreach (Host host in applicableServers)
|
foreach (Host host in applicableServers)
|
||||||
@ -392,6 +386,8 @@ namespace XenAdmin.Wizards.PatchingWizard
|
|||||||
|
|
||||||
groups.Add(new CheckGroup(Messages.CHECKING_STORAGE_CONNECTIONS_STATUS, pbdChecks));
|
groups.Add(new CheckGroup(Messages.CHECKING_STORAGE_CONNECTIONS_STATUS, pbdChecks));
|
||||||
|
|
||||||
|
XenServerVersion highestNewVersion = null;
|
||||||
|
|
||||||
//Disk space, reboot required and can evacuate host checks for automated and version updates
|
//Disk space, reboot required and can evacuate host checks for automated and version updates
|
||||||
if (WizardMode != WizardMode.SingleUpdate)
|
if (WizardMode != WizardMode.SingleUpdate)
|
||||||
{
|
{
|
||||||
@ -444,9 +440,18 @@ namespace XenAdmin.Wizards.PatchingWizard
|
|||||||
rebootChecks.Add(new HostNeedsRebootCheck(host, restartHostPatches));
|
rebootChecks.Add(new HostNeedsRebootCheck(host, restartHostPatches));
|
||||||
if (restartHostPatches.Any(p => !p.ContainsLivepatch))
|
if (restartHostPatches.Any(p => !p.ContainsLivepatch))
|
||||||
evacuateChecks.Add(new AssertCanEvacuateCheck(host));
|
evacuateChecks.Add(new AssertCanEvacuateCheck(host));
|
||||||
|
|
||||||
|
foreach (var p in us[host])
|
||||||
|
{
|
||||||
|
var newVersion = Updates.XenServerVersions.FirstOrDefault(v => v.PatchUuid != null && v.PatchUuid.Equals(p.Uuid, StringComparison.OrdinalIgnoreCase));
|
||||||
|
if (newVersion != null && (highestNewVersion == null || newVersion.Version > highestNewVersion.Version))
|
||||||
|
highestNewVersion = newVersion;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
groups.Add(new CheckGroup(Messages.PATCHINGWIZARD_PRECHECKPAGE_CHECKING_DISK_SPACE, diskChecks));
|
groups.Add(new CheckGroup(Messages.PATCHINGWIZARD_PRECHECKPAGE_CHECKING_DISK_SPACE, diskChecks));
|
||||||
if (rebootChecks.Count > 0)
|
if (rebootChecks.Count > 0)
|
||||||
groups.Add(new CheckGroup(Messages.CHECKING_SERVER_NEEDS_REBOOT, rebootChecks));
|
groups.Add(new CheckGroup(Messages.CHECKING_SERVER_NEEDS_REBOOT, rebootChecks));
|
||||||
@ -454,6 +459,14 @@ namespace XenAdmin.Wizards.PatchingWizard
|
|||||||
groups.Add(new CheckGroup(Messages.CHECKING_CANEVACUATE_STATUS, evacuateChecks));
|
groups.Add(new CheckGroup(Messages.CHECKING_CANEVACUATE_STATUS, evacuateChecks));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//XenCenter version check
|
||||||
|
if (highestNewVersion != null || UpdateAlert?.NewServerVersion != null)
|
||||||
|
{
|
||||||
|
// add XenCenter version check as the first group
|
||||||
|
groups.Insert(0, new CheckGroup(Messages.CHECKING_XENCENTER_VERSION,
|
||||||
|
new List<Check> { new XenCenterVersionCheck(highestNewVersion ?? UpdateAlert.NewServerVersion) }));
|
||||||
|
}
|
||||||
|
|
||||||
//GFS2 check for version updates
|
//GFS2 check for version updates
|
||||||
if (WizardMode == WizardMode.NewVersion)
|
if (WizardMode == WizardMode.NewVersion)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user