CA-108379: Hotfix prechecks encourage VMs to be suspended unnecessarily if HA is enabled - Fixed

- Added three Warning classes (HAEnabledWarning, WLBEnabledWarning, HostNotLiveWarning), used in the Pre-checks page of the Install wizard (also in the Rolling Pool Upgrade wizard) to indicate that a check was skipped and the reason why.
- If HA or WLB is on, we show this as an error in the "HA and WLB status" check and the "VM migration status" checks will be skipped (with a warning displayed) for all the hosts in the pool.
- Similarly, if a host if unreachable, we show this as an error in the "Host liveness status" check and the following checks for that host will be skipped (and warning displayed).

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
Mihaela Stoica 2014-07-14 16:00:43 +01:00
parent 9825ffc41f
commit 80348d854e
11 changed files with 129 additions and 10 deletions

View File

@ -31,6 +31,7 @@
using System;
using System.Collections.Generic;
using XenAdmin.Diagnostics.Problems.PoolProblem;
using XenAdmin.Network;
using XenAPI;
using XenAdmin.Diagnostics.Problems;
@ -211,7 +212,17 @@ namespace XenAdmin.Diagnostics.Checks
public override Problem RunCheck()
{
if (!Host.IsLive)
return new HostNotLive(this, Host);
return new HostNotLiveWarning(this, Host);
Pool pool = Helpers.GetPool(Host.Connection);
if (pool != null)
{
if (pool.ha_enabled)
return new HAEnabledWarning(this, pool, Host);
if (Helpers.WlbEnabled(pool.Connection))
return new WLBEnabledWarning(this, pool, Host);
}
return CheckHost();
}

View File

@ -49,7 +49,7 @@ namespace XenAdmin.Diagnostics.Checks
public override Problem RunCheck()
{
if (!Host.IsLive)
return new HostNotLive(this, Host);
return new HostNotLiveWarning(this, Host);
//vCPU configuration check
foreach (var vm in Host.Connection.Cache.VMs.Where(vm => vm.is_a_real_vm))

View File

@ -49,7 +49,7 @@ namespace XenAdmin.Diagnostics.Checks
public override Problem RunCheck()
{
if (!Host.IsLive)
return new HostNotLive(this, Host);
return new HostNotLiveWarning(this, Host);
Pool pool = Helpers.GetPoolOfOne(Host.Connection);
if (pool == null)

View File

@ -50,7 +50,7 @@ namespace XenAdmin.Diagnostics.Checks
public override Problem RunCheck()
{
if (!Host.IsLive)
return new HostNotLive(this, Host);
return new HostNotLiveWarning(this, Host);
if (Helpers.SanibelOrGreater(Host) && !Helpers.CreedenceOrGreater(Host)
&& hotfixFactory.Hotfix(HotfixFactory.HotfixableServerVersion.SanibelToClearwater).ShouldBeAppliedTo(Host))

View File

@ -51,7 +51,7 @@ namespace XenAdmin.Diagnostics.Checks
public override Problem RunCheck()
{
if (!Host.IsLive)
return new HostNotLive(this, Host);
return new HostNotLiveWarning(this, Host);
IEnumerable<VM> runningOrPausedVMs = GetRunningOrPausedVMs(Host);
IEnumerable<SR> brokenSRs = PBD.GetSRs(PBD.GetUnpluggedPBDsFor(runningOrPausedVMs));

View File

@ -59,7 +59,7 @@ namespace XenAdmin.Diagnostics.Checks
public override Problem RunCheck()
{
if (!Host.IsLive)
return new HostNotLive(this, Host);
return new HostNotLiveWarning(this, Host);
if (!Host.Connection.IsConnected)
throw new EndOfStreamException(Helpers.GetName(Host.Connection));

View File

@ -74,4 +74,28 @@ namespace XenAdmin.Diagnostics.Problems.HostProblem
return canStartHost;
}
}
class HostNotLiveWarning : Warning
{
private readonly Host host;
public HostNotLiveWarning(Check check, Host host)
: base(check)
{
this.host = host;
}
public override string Title
{
get { return Check.Description; }
}
public override string Description
{
get
{
return string.Format(Messages.UPDATES_WIZARD_HOST_NOT_LIVE_WARNING, host);
}
}
}
}

View File

@ -30,14 +30,10 @@
*/
using System;
using System.Windows.Forms;
using XenAdmin.Diagnostics.Checks;
using XenAPI;
using XenAdmin.Core;
using System.ComponentModel;
using XenAdmin.Actions;
using System.Collections.Generic;
using XenAdmin.Network;
namespace XenAdmin.Diagnostics.Problems.PoolProblem
@ -81,4 +77,30 @@ namespace XenAdmin.Diagnostics.Problems.PoolProblem
}
}
}
class HAEnabledWarning : Warning
{
private readonly Pool pool;
private readonly Host host;
public HAEnabledWarning(Check check, Pool pool, Host host)
: base(check)
{
this.pool = pool;
this.host = host;
}
public override string Title
{
get { return Check.Description; }
}
public override string Description
{
get
{
return string.Format(Messages.UPDATES_WIZARD_HA_ON_WARNING, host, pool);
}
}
}
}

View File

@ -74,4 +74,30 @@ namespace XenAdmin.Diagnostics.Problems.PoolProblem
}
}
class WLBEnabledWarning : Warning
{
private readonly Pool pool;
private readonly Host host;
public WLBEnabledWarning(Check check, Pool pool, Host host)
: base(check)
{
this.pool = pool;
this.host = host;
}
public override string Title
{
get { return Check.Description; }
}
public override string Description
{
get
{
return string.Format(Messages.UPDATES_WIZARD_WLB_ON_WARNING, host, pool);
}
}
}
}

View File

@ -30692,6 +30692,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to {0}: Check skipped because HA is enabled on pool {1}..
/// </summary>
public static string UPDATES_WIZARD_HA_ON_WARNING {
get {
return ResourceManager.GetString("UPDATES_WIZARD_HA_ON_WARNING", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Click here to exit maintenance mode.
/// </summary>
@ -30737,6 +30746,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to {0}: Check skipped because the server is unreachable..
/// </summary>
public static string UPDATES_WIZARD_HOST_NOT_LIVE_WARNING {
get {
return ResourceManager.GetString("UPDATES_WIZARD_HOST_NOT_LIVE_WARNING", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Click here to install tools.
/// </summary>
@ -31074,6 +31092,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to {0}: Check skipped because WLB is enabled on pool {1}..
/// </summary>
public static string UPDATES_WIZARD_WLB_ON_WARNING {
get {
return ResourceManager.GetString("UPDATES_WIZARD_WLB_ON_WARNING", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Updating performance monitoring configuration.
/// </summary>

View File

@ -10608,6 +10608,9 @@ Check your settings and try again.</value>
<data name="UPDATES_WIZARD_HA_ON_TITLE" xml:space="preserve">
<value>HA is enabled on '{0}'</value>
</data>
<data name="UPDATES_WIZARD_HA_ON_WARNING" xml:space="preserve">
<value>{0}: Check skipped because HA is enabled on pool {1}.</value>
</data>
<data name="UPDATES_WIZARD_HOST_EXIT_MAINTENANCE_MODE" xml:space="preserve">
<value>Click here to exit maintenance mode</value>
</data>
@ -10623,6 +10626,9 @@ Check your settings and try again.</value>
<data name="UPDATES_WIZARD_HOST_NOT_LIVE_TITLE" xml:space="preserve">
<value>Server '{0}' unreachable</value>
</data>
<data name="UPDATES_WIZARD_HOST_NOT_LIVE_WARNING" xml:space="preserve">
<value>{0}: Check skipped because the server is unreachable.</value>
</data>
<data name="UPDATES_WIZARD_INSTALL_TOOLS" xml:space="preserve">
<value>Click here to install tools</value>
</data>
@ -10738,6 +10744,9 @@ Check your settings and try again.</value>
<data name="UPDATES_WIZARD_VM_HAS_VGPU" xml:space="preserve">
<value>The VM '{0}' has one or more virtual GPUs.</value>
</data>
<data name="UPDATES_WIZARD_WLB_ON_WARNING" xml:space="preserve">
<value>{0}: Check skipped because WLB is enabled on pool {1}.</value>
</data>
<data name="UPDATE_EXPORT_ALL_OR_FILTERED" xml:space="preserve">
<value>You have applied filters to the list of updates. Do you wish to export all updates from every connected server, or only the updates you have chosen to view?</value>
</data>