mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-23 20:36:33 +01:00
CA-381102 and other update process corrections.
- Put the servers in maintenance mode before applying the updates. - Updated host do not disappear completely from the metadata hence we need to skip them from the update plan. Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
This commit is contained in:
parent
7fb1bd4eb6
commit
5e860b03f7
@ -137,7 +137,7 @@ namespace XenAdmin.Wizards.PatchingWizard
|
||||
foreach (var server in allHosts)
|
||||
{
|
||||
var hostUpdateInfo = updateInfo.HostsWithUpdates.FirstOrDefault(c => c.HostOpaqueRef == server.opaque_ref);
|
||||
if (hostUpdateInfo == null)
|
||||
if (hostUpdateInfo?.UpdateIDs?.Length == 0)
|
||||
continue;
|
||||
|
||||
hostPlans.Add(GetCdnUpdatePlanActionsForHost(server, updateInfo, hostUpdateInfo));
|
||||
|
@ -37,6 +37,8 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
|
||||
{
|
||||
public class ApplyCdnUpdatesPlanAction : HostPlanAction
|
||||
{
|
||||
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private readonly CdnPoolUpdateInfo _updateInfo;
|
||||
|
||||
public ApplyCdnUpdatesPlanAction(Host host, CdnPoolUpdateInfo updateInfo)
|
||||
@ -49,6 +51,13 @@ namespace XenAdmin.Wizards.PatchingWizard.PlanActions
|
||||
{
|
||||
var host = GetResolvedHost();
|
||||
|
||||
if (host.enabled)
|
||||
{
|
||||
log.DebugFormat("Disabling host {0}", host.Name());
|
||||
AddProgressStep(string.Format(Messages.UPDATES_WIZARD_ENTERING_MAINTENANCE_MODE, host.Name()));
|
||||
Host.disable(session, HostXenRef.opaque_ref);
|
||||
}
|
||||
|
||||
AddProgressStep(string.Format(Messages.UPDATES_WIZARD_APPLYING_UPDATES_FROM_CDN, host.Name()));
|
||||
new ApplyUpdatesFromCdnAction(host, _updateInfo).RunSync(session);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user