2017-01-16 20:59:50 +01:00
|
|
|
|
/* Copyright (c) Citrix Systems, Inc.
|
2013-06-24 13:41:48 +02:00
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms,
|
|
|
|
|
* with or without modification, are permitted provided
|
|
|
|
|
* that the following conditions are met:
|
|
|
|
|
*
|
|
|
|
|
* * Redistributions of source code must retain the above
|
|
|
|
|
* copyright notice, this list of conditions and the
|
|
|
|
|
* following disclaimer.
|
|
|
|
|
* * Redistributions in binary form must reproduce the above
|
|
|
|
|
* copyright notice, this list of conditions and the
|
|
|
|
|
* following disclaimer in the documentation and/or other
|
|
|
|
|
* materials provided with the distribution.
|
|
|
|
|
*
|
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
|
|
|
|
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
|
|
|
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
|
|
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
|
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using XenAdmin.Controls;
|
|
|
|
|
using XenAdmin.Core;
|
|
|
|
|
using XenAdmin.Diagnostics.Checks;
|
|
|
|
|
using XenAdmin.Diagnostics.Hotfixing;
|
|
|
|
|
using XenAdmin.Wizards.PatchingWizard;
|
|
|
|
|
using XenAPI;
|
|
|
|
|
using System.Linq;
|
2019-10-27 16:52:15 +01:00
|
|
|
|
using XenAdmin.Network;
|
2018-03-05 14:43:56 +01:00
|
|
|
|
using CheckGroup = System.Collections.Generic.KeyValuePair<string, System.Collections.Generic.List<XenAdmin.Diagnostics.Checks.Check>>;
|
|
|
|
|
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
|
|
namespace XenAdmin.Wizards.RollingUpgradeWizard
|
|
|
|
|
{
|
|
|
|
|
public partial class RollingUpgradeWizardPrecheckPage : PatchingWizard_PrecheckPage
|
|
|
|
|
{
|
|
|
|
|
public RollingUpgradeWizardPrecheckPage()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2018-07-06 18:45:00 +02:00
|
|
|
|
ManualUpgrade = true;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
2021-08-31 12:31:16 +02:00
|
|
|
|
private void AddEventHandlersToCoordinators()
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
2021-08-31 12:31:16 +02:00
|
|
|
|
foreach (Host coordinator in SelectedCoordinators)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
2021-08-31 12:31:16 +02:00
|
|
|
|
coordinator.Connection.ConnectionStateChanged += connection_ConnectionChanged;
|
|
|
|
|
coordinator.Connection.CachePopulated += connection_CachePopulated;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-31 12:31:16 +02:00
|
|
|
|
private void RemoveEventHandlersToCoordinators()
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
2021-08-31 12:31:16 +02:00
|
|
|
|
foreach (Host coordinator in SelectedCoordinators)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
2021-08-31 12:31:16 +02:00
|
|
|
|
coordinator.Connection.ConnectionStateChanged -= connection_ConnectionChanged;
|
|
|
|
|
coordinator.Connection.CachePopulated -= connection_CachePopulated;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-27 16:52:15 +01:00
|
|
|
|
private void connection_ConnectionChanged(IXenConnection conn)
|
|
|
|
|
{
|
|
|
|
|
Program.Invoke(this, RefreshRechecks);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void connection_CachePopulated(IXenConnection conn)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
2018-07-03 16:17:57 +02:00
|
|
|
|
Program.Invoke(this, RefreshRechecks);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
2018-03-09 01:31:46 +01:00
|
|
|
|
protected override void PageLoadedCore(PageLoadedDirection direction)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
|
|
|
|
if (direction == PageLoadedDirection.Back)
|
|
|
|
|
{
|
|
|
|
|
RefreshRechecks();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2021-08-31 12:31:16 +02:00
|
|
|
|
var selectedCoordinators = new List<Host>(SelectedCoordinators);
|
|
|
|
|
RemoveEventHandlersToCoordinators();
|
2013-06-24 13:41:48 +02:00
|
|
|
|
SelectedServers.Clear();
|
2021-08-31 12:31:16 +02:00
|
|
|
|
foreach (Host selectedCoordinator in selectedCoordinators)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
2021-08-31 12:31:16 +02:00
|
|
|
|
Host coordinator = selectedCoordinator;
|
|
|
|
|
if (coordinator != null)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
2021-08-31 12:31:16 +02:00
|
|
|
|
Pool pool = Helpers.GetPoolOfOne(coordinator.Connection);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
if (pool != null)
|
2017-09-03 04:33:29 +02:00
|
|
|
|
SelectedServers.AddRange(pool.HostsToUpgrade());
|
2013-06-24 13:41:48 +02:00
|
|
|
|
else
|
2021-08-31 12:31:16 +02:00
|
|
|
|
SelectedServers.Add(coordinator);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2021-08-31 12:31:16 +02:00
|
|
|
|
AddEventHandlersToCoordinators();
|
2013-06-24 13:41:48 +02:00
|
|
|
|
labelPrechecksFirstLine.Text = Messages.ROLLINGUPGRADE_PRECHECKS;
|
|
|
|
|
RefreshRechecks();
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-09 00:55:50 +01:00
|
|
|
|
protected override void PageLeaveCore(PageLoadedDirection direction, ref bool cancel)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
2021-08-31 12:31:16 +02:00
|
|
|
|
RemoveEventHandlersToCoordinators();
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
2018-12-20 13:33:26 +01:00
|
|
|
|
public override void PageCancelled(ref bool cancel)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
2018-12-20 13:33:26 +01:00
|
|
|
|
base.PageCancelled(ref cancel);
|
2019-02-05 13:08:15 +01:00
|
|
|
|
if (cancel)
|
|
|
|
|
return;
|
2021-08-31 12:31:16 +02:00
|
|
|
|
RemoveEventHandlersToCoordinators();
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string PageTitle
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return Messages.UPGRADE_PRECHECKS_TITLE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Text
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return Messages.UPGRADE_PRECHECKS_TEXT;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string HelpID
|
|
|
|
|
{
|
|
|
|
|
get { return "Upgradeprechecks"; }
|
|
|
|
|
}
|
|
|
|
|
|
CP-30335: Rearrange the RPU wizard pages
- Moved Install Location (RollingUpgradeWizard_SelectInstallMethod) page immediatelly after the Upgrade Mode page (and before the Prechecks page)
- Added a new page, called Extras, which contains the updates and supp pack installation options. These options have been moved here from the "Upgrade Mode" and "Ready To Upgrade" pages. This page is also inserted before the Prechecks
- There is no "Ready To Upgrade" page anymore. So the wizard pages are:
- when automatic mode is selected: Before You Start, Select Pools, Upgrade Mode, Installer Location, Extras, Prechecks, Apply Upgrade.
- when manual mode is selected: Before You Start, Select Pools, Upgrade Mode, Extras, Prechecks, Apply Upgrade.
Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
2019-01-17 15:01:49 +01:00
|
|
|
|
public override string NextText(bool isLastPage)
|
|
|
|
|
{
|
|
|
|
|
return Messages.START_UPGRADE;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-05 14:43:56 +01:00
|
|
|
|
protected override List<CheckGroup> GenerateChecks(Pool_patch patch)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
2018-03-05 14:43:56 +01:00
|
|
|
|
var groups = new List<CheckGroup>();
|
2017-03-22 11:59:32 +01:00
|
|
|
|
|
2018-07-06 13:49:16 +02:00
|
|
|
|
List<Host> hostsToUpgrade = new List<Host>();
|
|
|
|
|
List<Host> hostsToUpgradeOrUpdate = new List<Host>();
|
|
|
|
|
foreach (var pool in SelectedPools)
|
|
|
|
|
{
|
|
|
|
|
var poolHostsToUpgrade = pool.HostsToUpgrade();
|
|
|
|
|
hostsToUpgrade.AddRange(poolHostsToUpgrade);
|
2021-05-21 16:13:45 +02:00
|
|
|
|
hostsToUpgradeOrUpdate.AddRange(poolHostsToUpgrade);
|
2018-07-06 13:49:16 +02:00
|
|
|
|
}
|
|
|
|
|
|
2017-03-22 11:59:32 +01:00
|
|
|
|
//XenCenter version check (if any of the selected server version is not the latest)
|
|
|
|
|
var latestCrVersion = Updates.XenServerVersions.FindAll(item => item.LatestCr).OrderByDescending(v => v.Version).FirstOrDefault();
|
|
|
|
|
if (latestCrVersion != null &&
|
2018-07-06 13:49:16 +02:00
|
|
|
|
hostsToUpgradeOrUpdate.Any(host => new Version(Helpers.HostProductVersion(host)) < latestCrVersion.Version))
|
2017-03-22 11:59:32 +01:00
|
|
|
|
{
|
2021-03-16 02:50:45 +01:00
|
|
|
|
groups.Add(new CheckGroup(string.Format(Messages.CHECKING_XENCENTER_VERSION, BrandManager.BrandConsole),
|
2021-06-04 17:35:52 +02:00
|
|
|
|
new List<Check> {new ClientVersionCheck(null)}));
|
2017-03-22 11:59:32 +01:00
|
|
|
|
}
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
2018-07-06 13:49:16 +02:00
|
|
|
|
//HostMaintenanceModeCheck checks - for hosts that will be upgraded or updated
|
2018-02-28 12:20:00 +01:00
|
|
|
|
var livenessChecks = new List<Check>();
|
2018-07-06 13:49:16 +02:00
|
|
|
|
foreach (Host host in hostsToUpgradeOrUpdate)
|
2018-10-09 18:58:33 +02:00
|
|
|
|
livenessChecks.Add(new HostLivenessCheck(host, hostsToUpgrade.Contains(host)));
|
2018-03-05 14:43:56 +01:00
|
|
|
|
groups.Add(new CheckGroup(Messages.CHECKING_HOST_LIVENESS_STATUS, livenessChecks));
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
2019-01-29 15:17:42 +01:00
|
|
|
|
//HotfixesCheck - for hosts that will be upgraded
|
|
|
|
|
var hotfixChecks = new List<Check>();
|
|
|
|
|
foreach (var host in hostsToUpgrade)
|
|
|
|
|
{
|
2020-03-27 02:15:55 +01:00
|
|
|
|
if (HotfixFactory.IsHotfixRequired(host) && !ManualUpgrade)
|
2019-01-29 15:17:42 +01:00
|
|
|
|
hotfixChecks.Add(new HostHasHotfixCheck(host));
|
|
|
|
|
}
|
|
|
|
|
if (hotfixChecks.Count > 0)
|
|
|
|
|
groups.Add(new CheckGroup(Messages.CHECKING_UPGRADE_HOTFIX_STATUS, hotfixChecks));
|
|
|
|
|
|
|
|
|
|
//SafeToUpgrade- and PrepareToUpgrade- checks - in automatic mode only, for hosts that will be upgraded
|
|
|
|
|
if (!ManualUpgrade)
|
|
|
|
|
{
|
2021-03-04 17:47:31 +01:00
|
|
|
|
var safeToUpgradeChecks = (from Host host in hostsToUpgrade
|
|
|
|
|
let check = new SafeToUpgradeCheck(host, InstallMethodConfig)
|
|
|
|
|
where check.CanRun()
|
|
|
|
|
select check as Check).ToList();
|
|
|
|
|
|
|
|
|
|
if (safeToUpgradeChecks.Count > 0)
|
|
|
|
|
groups.Add(new CheckGroup(Messages.CHECKING_SAFE_TO_UPGRADE, safeToUpgradeChecks));
|
2019-01-29 15:17:42 +01:00
|
|
|
|
|
2021-03-04 17:47:31 +01:00
|
|
|
|
var prepareToUpgradeChecks = (from Host host in hostsToUpgrade
|
|
|
|
|
select new PrepareToUpgradeCheck(host, InstallMethodConfig) as Check).ToList();
|
|
|
|
|
|
2021-03-09 16:35:07 +01:00
|
|
|
|
if (prepareToUpgradeChecks.Count > 0)
|
|
|
|
|
groups.Add(new CheckGroup(Messages.CHECKING_PREPARE_TO_UPGRADE, prepareToUpgradeChecks));
|
2019-01-29 15:17:42 +01:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-24 13:59:39 +01:00
|
|
|
|
//vSwitch controller check - for each pool
|
2021-08-31 12:31:16 +02:00
|
|
|
|
var vSwitchChecks = (from Host server in SelectedCoordinators
|
2020-04-01 16:18:26 +02:00
|
|
|
|
let check = new VSwitchControllerCheck(server, InstallMethodConfig, ManualUpgrade)
|
|
|
|
|
where check.CanRun()
|
|
|
|
|
select check as Check).ToList();
|
2020-02-24 13:59:39 +01:00
|
|
|
|
|
2020-04-01 16:18:26 +02:00
|
|
|
|
if (vSwitchChecks.Count > 0)
|
|
|
|
|
groups.Add(new CheckGroup(Messages.CHECKING_VSWITCH_CONTROLLER_GROUP, vSwitchChecks));
|
2020-04-03 00:29:54 +02:00
|
|
|
|
|
2021-03-02 10:53:21 +01:00
|
|
|
|
//Health Check check - for each pool
|
|
|
|
|
var hcChecks = (from Pool pool in SelectedPools
|
|
|
|
|
let check = new HealthCheckServiceCheck(pool, InstallMethodConfig)
|
|
|
|
|
where check.CanRun()
|
|
|
|
|
select check as Check).ToList();
|
|
|
|
|
|
|
|
|
|
if (hcChecks.Count > 0)
|
|
|
|
|
groups.Add(new CheckGroup(Messages.CHECKING_HEALTH_CHECK_SERVICE, hcChecks));
|
|
|
|
|
|
2020-02-22 23:47:36 +01:00
|
|
|
|
//protocol check - for each pool
|
2021-08-31 12:31:16 +02:00
|
|
|
|
var sslChecks = (from Host server in SelectedCoordinators
|
2020-04-02 02:12:03 +02:00
|
|
|
|
let check = new PoolLegacySslCheck(server, InstallMethodConfig, ManualUpgrade)
|
|
|
|
|
where check.CanRun()
|
|
|
|
|
select check as Check).ToList();
|
2020-03-23 05:27:36 +01:00
|
|
|
|
|
2020-02-22 23:47:36 +01:00
|
|
|
|
if (sslChecks.Count > 0)
|
|
|
|
|
groups.Add(new CheckGroup(Messages.CHECKING_SECURITY_PROTOCOL_GROUP, sslChecks));
|
2020-03-23 05:27:36 +01:00
|
|
|
|
|
2021-11-26 00:28:48 +01:00
|
|
|
|
//certificate key length - for each host
|
|
|
|
|
var certKeyLengthChecks = (from Host server in hostsToUpgradeOrUpdate
|
|
|
|
|
let check = new CertificateKeyLengthCheck(server, ManualUpgrade, InstallMethodConfig)
|
|
|
|
|
where check.CanRun()
|
|
|
|
|
select check as Check).ToList();
|
|
|
|
|
|
|
|
|
|
if (certKeyLengthChecks.Count > 0)
|
|
|
|
|
groups.Add(new CheckGroup(Messages.CERTIFICATE_KEY_LENGTH_CHECK_GROUP, certKeyLengthChecks));
|
|
|
|
|
|
2020-03-23 05:27:36 +01:00
|
|
|
|
//power on mode check - for each host
|
2020-04-02 02:12:03 +02:00
|
|
|
|
var iloChecks = (from Host server in hostsToUpgradeOrUpdate
|
|
|
|
|
let check = new PowerOniLoCheck(server, InstallMethodConfig, ManualUpgrade)
|
|
|
|
|
where check.CanRun()
|
|
|
|
|
select check as Check).ToList();
|
2020-03-23 05:27:36 +01:00
|
|
|
|
|
|
|
|
|
if (iloChecks.Count > 0)
|
|
|
|
|
groups.Add(new CheckGroup(Messages.CHECKING_POWER_ON_MODE_GROUP, iloChecks));
|
|
|
|
|
|
2022-02-15 17:20:08 +01:00
|
|
|
|
//Checking DMC
|
|
|
|
|
var dmcChecks = (from Pool pool in SelectedPools
|
|
|
|
|
let check = new DmcCheck(this, pool, InstallMethodConfig, ManualUpgrade)
|
|
|
|
|
where check.CanRun()
|
|
|
|
|
select check as Check).ToList();
|
|
|
|
|
|
|
|
|
|
if (dmcChecks.Count > 0)
|
|
|
|
|
groups.Add(new CheckGroup(Messages.DMC_CHECK_ENABLED, dmcChecks));
|
|
|
|
|
|
2020-04-03 00:39:42 +02:00
|
|
|
|
//Checking PV guests - for hosts that have any PV guests and warn the user before the upgrade.
|
2021-08-31 12:31:16 +02:00
|
|
|
|
var pvChecks = (from Host server in SelectedCoordinators
|
2021-10-08 00:31:42 +02:00
|
|
|
|
let check = new PVGuestsCheck(server, ManualUpgrade, InstallMethodConfig)
|
2020-04-03 00:39:42 +02:00
|
|
|
|
where check.CanRun()
|
|
|
|
|
select check as Check).ToList();
|
|
|
|
|
|
|
|
|
|
if (pvChecks.Count > 0)
|
|
|
|
|
groups.Add(new CheckGroup(Messages.CHECKING_PV_GUESTS, pvChecks));
|
|
|
|
|
|
2018-07-06 13:49:16 +02:00
|
|
|
|
//HA checks - for each pool
|
2021-08-31 12:31:16 +02:00
|
|
|
|
var haChecks = (from Host server in SelectedCoordinators
|
2018-07-06 18:43:38 +02:00
|
|
|
|
select new HAOffCheck(server) as Check).ToList();
|
2021-03-09 16:35:07 +01:00
|
|
|
|
|
|
|
|
|
if (haChecks.Count > 0)
|
|
|
|
|
groups.Add(new CheckGroup(Messages.CHECKING_HA_STATUS, haChecks));
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
2018-07-06 13:49:16 +02:00
|
|
|
|
//Checking can evacuate host - for hosts that will be upgraded or updated
|
2021-03-09 16:35:07 +01:00
|
|
|
|
var evacuateChecks = (from Host host in hostsToUpgradeOrUpdate
|
|
|
|
|
select new AssertCanEvacuateUpgradeCheck(host) as Check).ToList();
|
|
|
|
|
|
|
|
|
|
if (evacuateChecks.Count > 0)
|
|
|
|
|
groups.Add(new CheckGroup(Messages.CHECKING_CANEVACUATE_STATUS, evacuateChecks));
|
2014-05-21 15:34:43 +02:00
|
|
|
|
|
2018-07-06 13:49:16 +02:00
|
|
|
|
//PBDsPluggedCheck - for hosts that will be upgraded or updated
|
2021-03-09 16:35:07 +01:00
|
|
|
|
var pbdChecks = (from Host host in hostsToUpgradeOrUpdate
|
|
|
|
|
select new PBDsPluggedCheck(host) as Check).ToList();
|
|
|
|
|
|
|
|
|
|
if(pbdChecks.Count > 0)
|
|
|
|
|
groups.Add(new CheckGroup(Messages.CHECKING_STORAGE_CONNECTIONS_STATUS, pbdChecks));
|
2018-02-28 12:20:00 +01:00
|
|
|
|
|
2019-01-28 15:44:58 +01:00
|
|
|
|
//HostMemoryPostUpgradeCheck - for hosts that will be upgraded
|
2021-03-09 16:35:07 +01:00
|
|
|
|
var mostMemoryPostUpgradeChecks = (from Host host in hostsToUpgrade
|
|
|
|
|
select new HostMemoryPostUpgradeCheck(host, InstallMethodConfig) as Check).ToList();
|
|
|
|
|
|
2019-01-28 15:44:58 +01:00
|
|
|
|
if (mostMemoryPostUpgradeChecks.Count > 0)
|
|
|
|
|
groups.Add(new CheckGroup(Messages.CHECKING_HOST_MEMORY_POST_UPGRADE, mostMemoryPostUpgradeChecks));
|
2018-07-09 11:59:09 +02:00
|
|
|
|
|
2021-03-09 16:35:07 +01:00
|
|
|
|
//PoolHasGFS2SR checks
|
2021-08-31 12:31:16 +02:00
|
|
|
|
var gfs2Checks = (from Host host in SelectedCoordinators
|
2021-03-09 16:35:07 +01:00
|
|
|
|
let check = new PoolHasGFS2SR(host)
|
|
|
|
|
where check.CanRun()
|
|
|
|
|
select check as Check).ToList();
|
|
|
|
|
|
|
|
|
|
if (gfs2Checks.Count > 0)
|
2018-07-09 11:59:09 +02:00
|
|
|
|
groups.Add(new CheckGroup(Messages.CHECKING_CLUSTERING_STATUS, gfs2Checks));
|
2015-06-04 16:24:04 +02:00
|
|
|
|
|
2018-02-28 12:20:00 +01:00
|
|
|
|
return groups;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
2021-08-31 12:31:16 +02:00
|
|
|
|
public IEnumerable<Host> SelectedCoordinators { private get; set; }
|
2018-07-06 18:45:00 +02:00
|
|
|
|
public bool ManualUpgrade { set; private get; }
|
2018-07-06 13:49:16 +02:00
|
|
|
|
|
2019-01-28 15:44:58 +01:00
|
|
|
|
public Dictionary<string, string> InstallMethodConfig { private get; set; }
|
|
|
|
|
|
2018-07-06 13:49:16 +02:00
|
|
|
|
#region private methods
|
|
|
|
|
public static List<Host> HostsToUpgradeOrUpdate(Pool pool)
|
|
|
|
|
{
|
|
|
|
|
var result = new List<Host>();
|
|
|
|
|
|
|
|
|
|
if (pool == null)
|
|
|
|
|
return result;
|
|
|
|
|
|
2021-08-31 12:31:16 +02:00
|
|
|
|
var coordinator = Helpers.GetCoordinator(pool);
|
|
|
|
|
if (coordinator == null)
|
2018-07-06 13:49:16 +02:00
|
|
|
|
return result;
|
|
|
|
|
|
2021-08-31 12:31:16 +02:00
|
|
|
|
if (pool.IsCoordinatorUpgraded())
|
2018-07-06 13:49:16 +02:00
|
|
|
|
{
|
|
|
|
|
foreach (var h in pool.Connection.Cache.Hosts)
|
|
|
|
|
{
|
2021-08-31 12:31:16 +02:00
|
|
|
|
if (h.LongProductVersion() != coordinator.LongProductVersion()) // host needs to be upgraded
|
2018-07-06 13:49:16 +02:00
|
|
|
|
result.Add(h); // host
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//check update sequence for already-upgraded hosts
|
2021-08-31 12:31:16 +02:00
|
|
|
|
var us = Updates.GetPatchSequenceForHost(h, Updates.GetMinimalPatches(coordinator));
|
2018-07-06 13:49:16 +02:00
|
|
|
|
if (us != null && us.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
result.Add(h);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
result.AddRange(pool.Connection.Cache.Hosts);
|
|
|
|
|
|
|
|
|
|
result.Sort();
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
}
|