2023-01-24 15:29:31 +01:00
|
|
|
|
/* Copyright (c) Cloud Software Group, Inc.
|
2013-06-24 13:41:48 +02:00
|
|
|
|
*
|
|
|
|
|
* 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 System.Linq;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using XenAdmin.Actions;
|
|
|
|
|
using XenAdmin.Core;
|
|
|
|
|
using XenAdmin.Network;
|
|
|
|
|
using XenAdmin.Wizards.GenericPages;
|
|
|
|
|
using XenAPI;
|
|
|
|
|
using XenAdmin.Dialogs;
|
|
|
|
|
using XenAdmin.Wizards.NewSRWizard_Pages;
|
|
|
|
|
using XenAdmin.Wizards.NewSRWizard_Pages.Frontends;
|
|
|
|
|
using XenAdmin.Controls;
|
|
|
|
|
using XenAdmin.Actions.DR;
|
|
|
|
|
|
|
|
|
|
namespace XenAdmin.Wizards
|
|
|
|
|
{
|
|
|
|
|
public partial class NewSRWizard : XenWizardBase
|
|
|
|
|
{
|
2019-11-08 12:02:03 +01:00
|
|
|
|
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
|
|
|
|
|
2013-06-24 13:41:48 +02:00
|
|
|
|
#region Wizard pages
|
|
|
|
|
private readonly NewSrWizardNamePage xenTabPageSrName;
|
|
|
|
|
private readonly CIFS_ISO xenTabPageCifsIso;
|
2015-03-03 16:51:56 +01:00
|
|
|
|
private readonly CifsFrontend xenTabPageCifs;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
private readonly VHDoNFS xenTabPageVhdoNFS;
|
|
|
|
|
private readonly NFS_ISO xenTabPageNfsIso;
|
|
|
|
|
private readonly LVMoISCSI xenTabPageLvmoIscsi;
|
|
|
|
|
private readonly LVMoHBA xenTabPageLvmoHba;
|
2015-06-26 15:02:26 +02:00
|
|
|
|
private readonly LVMoFCoE xenTabPageLvmoFcoe;
|
2013-07-09 17:59:47 +02:00
|
|
|
|
private readonly LVMoHBASummary xenTabPageLvmoHbaSummary;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
private readonly ChooseSrTypePage xenTabPageChooseSrType;
|
2017-11-23 11:59:15 +01:00
|
|
|
|
private readonly ChooseSrProvisioningPage xenTabPageChooseSrProv;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
private readonly RBACWarningPage xenTabPageRbacWarning;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The final action for this wizard is handled in this class, but the front end pages sometimes need to know when it's done so they
|
|
|
|
|
/// allow the user to leave them.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public AsyncAction FinalAction;
|
|
|
|
|
|
|
|
|
|
private readonly string m_text;
|
|
|
|
|
|
|
|
|
|
// For SR Reconfiguration
|
|
|
|
|
private readonly SR _srToReattach;
|
|
|
|
|
private SrWizardType m_srWizardType;
|
|
|
|
|
|
|
|
|
|
private readonly bool _rbac;
|
|
|
|
|
|
2018-03-29 11:20:41 +02:00
|
|
|
|
private bool showProvisioningPage;
|
|
|
|
|
|
2013-06-24 13:41:48 +02:00
|
|
|
|
public NewSRWizard(IXenConnection connection)
|
2015-10-27 19:11:53 +01:00
|
|
|
|
: this(connection, null)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public NewSRWizard(IXenConnection connection, SR srToReattach)
|
2015-10-27 19:11:53 +01:00
|
|
|
|
: this(connection, srToReattach, false)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-27 19:11:53 +01:00
|
|
|
|
internal NewSRWizard(IXenConnection connection, SR srToReattach, bool disasterRecoveryTask)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
: base(connection)
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
xenTabPageSrName = new NewSrWizardNamePage();
|
|
|
|
|
xenTabPageCifsIso = new CIFS_ISO();
|
2015-03-03 16:51:56 +01:00
|
|
|
|
xenTabPageCifs = new CifsFrontend();
|
2013-06-24 13:41:48 +02:00
|
|
|
|
xenTabPageVhdoNFS = new VHDoNFS();
|
|
|
|
|
xenTabPageNfsIso = new NFS_ISO();
|
|
|
|
|
xenTabPageLvmoIscsi = new LVMoISCSI();
|
|
|
|
|
xenTabPageLvmoHba = new LVMoHBA();
|
2015-06-26 15:02:26 +02:00
|
|
|
|
xenTabPageLvmoFcoe = new LVMoFCoE();
|
2013-07-09 17:59:47 +02:00
|
|
|
|
xenTabPageLvmoHbaSummary = new LVMoHBASummary();
|
2013-06-24 13:41:48 +02:00
|
|
|
|
xenTabPageChooseSrType = new ChooseSrTypePage();
|
2017-11-23 11:59:15 +01:00
|
|
|
|
xenTabPageChooseSrProv = new ChooseSrProvisioningPage();
|
2013-06-24 13:41:48 +02:00
|
|
|
|
xenTabPageRbacWarning = new RBACWarningPage((srToReattach == null && !disasterRecoveryTask)
|
|
|
|
|
? Messages.RBAC_WARNING_PAGE_DESCRIPTION_SR_CREATE
|
|
|
|
|
: Messages.RBAC_WARNING_PAGE_DESCRIPTION_SR_ATTACH);
|
|
|
|
|
|
|
|
|
|
//do not use virtual members in constructor
|
|
|
|
|
var format = (srToReattach == null && !disasterRecoveryTask)
|
|
|
|
|
? Messages.NEWSR_TEXT
|
|
|
|
|
: Messages.NEWSR_TEXT_ATTACH;
|
2015-10-27 19:11:53 +01:00
|
|
|
|
m_text = string.Format(format, Helpers.GetName(xenConnection));
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
|
|
_srToReattach = srToReattach;
|
|
|
|
|
|
|
|
|
|
xenTabPageChooseSrType.SrToReattach = srToReattach;
|
|
|
|
|
xenTabPageChooseSrType.DisasterRecoveryTask = disasterRecoveryTask;
|
|
|
|
|
|
|
|
|
|
// Order the tab pages
|
|
|
|
|
AddPage(xenTabPageChooseSrType);
|
|
|
|
|
AddPage(xenTabPageSrName);
|
|
|
|
|
AddPage(new XenTabPage {Text = Messages.NEWSR_LOCATION});
|
|
|
|
|
|
|
|
|
|
// RBAC warning page
|
|
|
|
|
_rbac = (xenConnection != null && !xenConnection.Session.IsLocalSuperuser) &&
|
2021-08-31 12:31:16 +02:00
|
|
|
|
Helpers.GetCoordinator(xenConnection).external_auth_type != Auth.AUTH_TYPE_NONE;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
if (_rbac)
|
|
|
|
|
{
|
|
|
|
|
// if reattaching, add "Permission checks" page after "Name" page, otherwise as first page (Ref. CA-61525)
|
|
|
|
|
if (_srToReattach != null)
|
|
|
|
|
AddAfterPage(xenTabPageSrName, xenTabPageRbacWarning);
|
|
|
|
|
else
|
|
|
|
|
AddPage(xenTabPageRbacWarning, 0);
|
|
|
|
|
ConfigureRbacPage(disasterRecoveryTask);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ConfigureRbacPage(bool disasterRecoveryTask)
|
|
|
|
|
{
|
|
|
|
|
if (!_rbac)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
xenTabPageRbacWarning.Connection = xenConnection;
|
|
|
|
|
|
2021-11-17 23:11:15 +01:00
|
|
|
|
var warningMessage = _srToReattach == null && !disasterRecoveryTask
|
2013-06-24 13:41:48 +02:00
|
|
|
|
? Messages.RBAC_WARNING_SR_WIZARD_CREATE
|
|
|
|
|
: Messages.RBAC_WARNING_SR_WIZARD_ATTACH;
|
|
|
|
|
|
2021-11-17 23:11:15 +01:00
|
|
|
|
var check = new WizardRbacCheck(warningMessage) { Blocking = true };
|
|
|
|
|
check.AddApiMethods("SR.probe");
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
2018-05-18 15:18:53 +02:00
|
|
|
|
if (Helpers.KolkataOrGreater(xenConnection) && !Helpers.FeatureForbidden(xenConnection, Host.CorosyncDisabled))
|
2021-11-17 23:11:15 +01:00
|
|
|
|
check.AddApiMethods("SR.probe_ext");
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
|
|
if (_srToReattach == null)
|
|
|
|
|
{
|
|
|
|
|
// create
|
2021-11-17 23:11:15 +01:00
|
|
|
|
check.AddApiMethods(SrCreateAction.StaticRBACDependencies);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
else if (disasterRecoveryTask && SR.SupportsDatabaseReplication(xenConnection, _srToReattach))
|
|
|
|
|
{
|
|
|
|
|
// "Attach SR needed for DR" case
|
2021-11-17 23:11:15 +01:00
|
|
|
|
check.AddApiMethods(DrTaskCreateAction.StaticRBACDependencies);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// reattach
|
2021-11-17 23:11:15 +01:00
|
|
|
|
check.AddApiMethods(SrReattachAction.StaticRBACDependencies);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
2021-11-17 23:11:15 +01:00
|
|
|
|
xenTabPageRbacWarning.SetPermissionChecks(xenConnection, check);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
2015-06-26 15:02:26 +02:00
|
|
|
|
private bool SetFCDevicesOnLVMoHBAPage(LVMoHBA page)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
|
|
|
|
List<FibreChannelDevice> devices;
|
2015-06-26 15:02:26 +02:00
|
|
|
|
var success = page.FiberChannelScan(this, xenConnection, out devices);
|
|
|
|
|
page.FCDevices = devices;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
return success;
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-03 16:14:42 +02:00
|
|
|
|
private bool CanShowLVMoHBASummaryPage(List<FibreChannelDescriptor> SrDescriptors)
|
2013-07-24 14:34:21 +02:00
|
|
|
|
{
|
|
|
|
|
string description = m_srWizardType.Description;
|
|
|
|
|
string name = m_srWizardType.SrName;
|
|
|
|
|
|
2017-09-03 04:33:29 +02:00
|
|
|
|
List<string> names = xenConnection.Cache.SRs.Select(sr => sr.Name()).ToList();
|
2013-07-24 14:34:21 +02:00
|
|
|
|
|
|
|
|
|
m_srWizardType.SrDescriptors.Clear();
|
2018-04-03 16:14:42 +02:00
|
|
|
|
foreach (var descriptor in SrDescriptors)
|
2013-07-24 14:34:21 +02:00
|
|
|
|
{
|
2018-04-03 16:14:42 +02:00
|
|
|
|
descriptor.Name = name;
|
2013-07-24 14:34:21 +02:00
|
|
|
|
if (!string.IsNullOrEmpty(description))
|
2018-04-03 16:14:42 +02:00
|
|
|
|
descriptor.Description = description;
|
2013-07-24 14:34:21 +02:00
|
|
|
|
|
2018-04-03 16:14:42 +02:00
|
|
|
|
m_srWizardType.SrDescriptors.Add(descriptor);
|
|
|
|
|
m_srWizardType.IsGfs2 = descriptor is Gfs2HbaSrDescriptor || descriptor is Gfs2FcoeSrDescriptor;
|
2013-07-24 14:34:21 +02:00
|
|
|
|
names.Add(name);
|
2016-05-11 13:59:20 +02:00
|
|
|
|
name = SrWizardHelpers.DefaultSRName(m_srWizardType is SrWizardType_Hba
|
2015-06-29 15:26:37 +02:00
|
|
|
|
? Messages.NEWSR_HBA_DEFAULT_NAME
|
|
|
|
|
: Messages.NEWSR_FCOE_DEFAULT_NAME, names);
|
2013-07-24 14:34:21 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
xenTabPageLvmoHbaSummary.SuccessfullyCreatedSRs.Clear();
|
|
|
|
|
xenTabPageLvmoHbaSummary.FailedToCreateSRs.Clear();
|
|
|
|
|
|
2022-01-24 11:07:10 +01:00
|
|
|
|
RunFinalAction(out var closeWizard);
|
2013-07-24 14:34:21 +02:00
|
|
|
|
return closeWizard;
|
|
|
|
|
}
|
|
|
|
|
|
2013-06-24 13:41:48 +02:00
|
|
|
|
protected override bool RunNextPagePrecheck(XenTabPage senderPage)
|
|
|
|
|
{
|
2018-03-29 11:20:41 +02:00
|
|
|
|
var runPrechecks = showProvisioningPage
|
|
|
|
|
? senderPage == xenTabPageChooseSrProv
|
|
|
|
|
: (_srToReattach != null && _rbac
|
|
|
|
|
? senderPage == xenTabPageRbacWarning
|
|
|
|
|
: senderPage == xenTabPageSrName);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
|
|
if (runPrechecks)
|
|
|
|
|
{
|
2015-06-26 15:02:26 +02:00
|
|
|
|
if (m_srWizardType is SrWizardType_Fcoe)
|
|
|
|
|
{
|
2018-03-29 11:20:41 +02:00
|
|
|
|
xenTabPageLvmoFcoe.SrType = showProvisioningPage && xenTabPageChooseSrProv.IsGfs2 ? SR.SRTypes.gfs2 : SR.SRTypes.lvmofcoe;
|
2015-06-26 15:02:26 +02:00
|
|
|
|
return SetFCDevicesOnLVMoHBAPage(xenTabPageLvmoFcoe);
|
|
|
|
|
}
|
2016-05-11 13:59:20 +02:00
|
|
|
|
if (m_srWizardType is SrWizardType_Hba)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
2018-03-29 11:20:41 +02:00
|
|
|
|
xenTabPageLvmoHba.SrType = showProvisioningPage && xenTabPageChooseSrProv.IsGfs2 ? SR.SRTypes.gfs2 : SR.SRTypes.lvmohba;
|
2015-06-26 15:02:26 +02:00
|
|
|
|
return SetFCDevicesOnLVMoHBAPage(xenTabPageLvmoHba);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2015-06-26 15:02:26 +02:00
|
|
|
|
|
|
|
|
|
if (senderPage == xenTabPageLvmoFcoe)
|
|
|
|
|
{
|
|
|
|
|
return CanShowLVMoHBASummaryPage(xenTabPageLvmoFcoe.SrDescriptors);
|
|
|
|
|
}
|
2015-06-18 16:03:25 +02:00
|
|
|
|
|
2016-05-11 13:59:20 +02:00
|
|
|
|
if (m_srWizardType is SrWizardType_Hba)
|
2013-07-24 14:34:21 +02:00
|
|
|
|
{
|
2016-03-08 15:43:09 +01:00
|
|
|
|
if (senderPage == xenTabPageLvmoHba)
|
2015-06-18 16:03:25 +02:00
|
|
|
|
{
|
2015-06-26 15:02:26 +02:00
|
|
|
|
return CanShowLVMoHBASummaryPage(xenTabPageLvmoHba.SrDescriptors);
|
2015-06-26 16:35:13 +02:00
|
|
|
|
}
|
2015-06-18 16:03:25 +02:00
|
|
|
|
}
|
2013-06-24 13:41:48 +02:00
|
|
|
|
return base.RunNextPagePrecheck(senderPage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void UpdateWizardContent(XenTabPage senderPage)
|
|
|
|
|
{
|
|
|
|
|
var senderPagetype = senderPage.GetType();
|
|
|
|
|
|
|
|
|
|
if (senderPagetype == typeof(ChooseSrTypePage))
|
|
|
|
|
{
|
|
|
|
|
#region
|
2018-03-29 11:20:41 +02:00
|
|
|
|
showProvisioningPage = false;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
RemovePagesFrom(_rbac ? 3 : 2);
|
|
|
|
|
m_srWizardType = xenTabPageChooseSrType.SrWizardType;
|
|
|
|
|
|
|
|
|
|
if (m_srWizardType is SrWizardType_VhdoNfs)
|
|
|
|
|
AddPage(xenTabPageVhdoNFS);
|
2016-04-28 15:53:00 +02:00
|
|
|
|
else if (m_srWizardType is SrWizardType_Iscsi)
|
2015-06-17 10:59:21 +02:00
|
|
|
|
{
|
2018-03-29 11:20:41 +02:00
|
|
|
|
showProvisioningPage = Helpers.KolkataOrGreater(xenConnection) &&
|
2018-11-08 20:17:37 +01:00
|
|
|
|
!Helpers.FeatureForbidden(xenConnection, Host.RestrictCorosync);
|
2018-03-29 11:20:41 +02:00
|
|
|
|
if (showProvisioningPage)
|
2018-03-23 12:56:54 +01:00
|
|
|
|
AddPage(xenTabPageChooseSrProv);
|
2017-11-29 14:34:48 +01:00
|
|
|
|
AddPage(xenTabPageLvmoIscsi);
|
2015-06-17 10:59:21 +02:00
|
|
|
|
}
|
2016-05-11 13:59:20 +02:00
|
|
|
|
else if (m_srWizardType is SrWizardType_Hba)
|
2013-07-09 17:59:47 +02:00
|
|
|
|
{
|
2018-03-29 11:20:41 +02:00
|
|
|
|
showProvisioningPage = Helpers.KolkataOrGreater(xenConnection) &&
|
2018-11-08 20:17:37 +01:00
|
|
|
|
!Helpers.FeatureForbidden(xenConnection, Host.RestrictCorosync);
|
2018-03-29 11:20:41 +02:00
|
|
|
|
if (showProvisioningPage)
|
2018-03-23 12:56:54 +01:00
|
|
|
|
AddPage(xenTabPageChooseSrProv);
|
2017-11-29 14:34:48 +01:00
|
|
|
|
AddPage(xenTabPageLvmoHba);
|
2013-07-09 17:59:47 +02:00
|
|
|
|
AddPage(xenTabPageLvmoHbaSummary);
|
|
|
|
|
}
|
2015-06-26 15:02:26 +02:00
|
|
|
|
else if (m_srWizardType is SrWizardType_Fcoe)
|
|
|
|
|
{
|
2017-11-29 14:34:48 +01:00
|
|
|
|
AddPage(xenTabPageLvmoFcoe);
|
2015-06-26 15:02:26 +02:00
|
|
|
|
AddPage(xenTabPageLvmoHbaSummary);
|
|
|
|
|
}
|
2013-06-24 13:41:48 +02:00
|
|
|
|
else if (m_srWizardType is SrWizardType_CifsIso)
|
|
|
|
|
AddPage(xenTabPageCifsIso);
|
2015-03-03 16:51:56 +01:00
|
|
|
|
else if (m_srWizardType is SrWizardType_Cifs)
|
|
|
|
|
AddPage(xenTabPageCifs);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
else if (m_srWizardType is SrWizardType_NfsIso)
|
|
|
|
|
AddPage(xenTabPageNfsIso);
|
|
|
|
|
|
|
|
|
|
xenTabPageSrName.SrWizardType = m_srWizardType;
|
|
|
|
|
xenTabPageSrName.MatchingFrontends = xenTabPageChooseSrType.MatchingFrontends;
|
|
|
|
|
|
|
|
|
|
NotifyNextPagesOfChange(xenTabPageSrName);
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
else if (senderPagetype == typeof(NewSrWizardNamePage))
|
|
|
|
|
{
|
|
|
|
|
#region
|
|
|
|
|
m_srWizardType.SrName = xenTabPageSrName.SrName;
|
|
|
|
|
m_srWizardType.Description = xenTabPageSrName.SrDescription;
|
|
|
|
|
m_srWizardType.AutoDescriptionRequired = xenTabPageSrName.AutoDescriptionRequired;
|
|
|
|
|
|
|
|
|
|
if (m_srWizardType is SrWizardType_VhdoNfs)
|
|
|
|
|
xenTabPageVhdoNFS.SrWizardType = m_srWizardType;
|
2016-04-28 15:53:00 +02:00
|
|
|
|
else if (m_srWizardType is SrWizardType_Iscsi)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
xenTabPageLvmoIscsi.SrWizardType = m_srWizardType;
|
2016-05-11 13:59:20 +02:00
|
|
|
|
else if (m_srWizardType is SrWizardType_Hba)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
xenTabPageLvmoHba.SrWizardType = m_srWizardType;
|
|
|
|
|
else if (m_srWizardType is SrWizardType_CifsIso)
|
|
|
|
|
xenTabPageCifsIso.SrWizardType = m_srWizardType;
|
|
|
|
|
else if (m_srWizardType is SrWizardType_NfsIso)
|
|
|
|
|
xenTabPageNfsIso.SrWizardType = m_srWizardType;
|
2015-03-03 16:51:56 +01:00
|
|
|
|
else if (m_srWizardType is SrWizardType_Cifs)
|
|
|
|
|
xenTabPageCifs.SrWizardType = m_srWizardType;
|
2015-06-26 15:02:26 +02:00
|
|
|
|
else if (m_srWizardType is SrWizardType_Fcoe)
|
|
|
|
|
xenTabPageLvmoFcoe.SrWizardType = m_srWizardType;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
#endregion
|
|
|
|
|
}
|
2017-11-23 11:59:15 +01:00
|
|
|
|
else if (senderPagetype == typeof(ChooseSrProvisioningPage))
|
|
|
|
|
{
|
2017-11-28 11:51:44 +01:00
|
|
|
|
var isGfs2 = xenTabPageChooseSrProv.IsGfs2;
|
|
|
|
|
xenTabPageLvmoHba.SrType = isGfs2 ? SR.SRTypes.gfs2 : SR.SRTypes.lvmohba;
|
|
|
|
|
xenTabPageLvmoFcoe.SrType = isGfs2 ? SR.SRTypes.gfs2 : SR.SRTypes.lvmofcoe;
|
|
|
|
|
xenTabPageLvmoIscsi.SrType = isGfs2 ? SR.SRTypes.gfs2 : SR.SRTypes.lvmoiscsi;
|
2017-11-23 11:59:15 +01:00
|
|
|
|
}
|
2013-06-24 13:41:48 +02:00
|
|
|
|
else if (senderPagetype == typeof(CIFS_ISO))
|
|
|
|
|
{
|
|
|
|
|
m_srWizardType.DeviceConfig = xenTabPageCifsIso.DeviceConfig;
|
|
|
|
|
SetCustomDescription(m_srWizardType, xenTabPageCifsIso.SrDescription);
|
|
|
|
|
}
|
2015-03-03 16:51:56 +01:00
|
|
|
|
else if (senderPagetype == typeof(CifsFrontend))
|
|
|
|
|
{
|
2015-10-21 18:14:09 +02:00
|
|
|
|
m_srWizardType.UUID = xenTabPageCifs.UUID;
|
2015-03-03 16:51:56 +01:00
|
|
|
|
m_srWizardType.DeviceConfig = xenTabPageCifs.DeviceConfig;
|
|
|
|
|
SetCustomDescription(m_srWizardType, xenTabPageCifs.SrDescription);
|
|
|
|
|
}
|
2013-06-24 13:41:48 +02:00
|
|
|
|
else if (senderPagetype == typeof(LVMoISCSI))
|
|
|
|
|
{
|
|
|
|
|
SetCustomDescription(m_srWizardType, xenTabPageLvmoIscsi.SrDescription);
|
2015-06-17 10:59:21 +02:00
|
|
|
|
|
2015-11-04 11:39:18 +01:00
|
|
|
|
m_srWizardType.UUID = xenTabPageLvmoIscsi.UUID;
|
|
|
|
|
m_srWizardType.DeviceConfig = xenTabPageLvmoIscsi.DeviceConfig;
|
2017-11-28 11:51:44 +01:00
|
|
|
|
m_srWizardType.IsGfs2 = xenTabPageLvmoIscsi.SrType == SR.SRTypes.gfs2;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
else if (senderPagetype == typeof(NFS_ISO))
|
|
|
|
|
{
|
|
|
|
|
m_srWizardType.DeviceConfig = xenTabPageNfsIso.DeviceConfig;
|
|
|
|
|
SetCustomDescription(m_srWizardType, xenTabPageNfsIso.SrDescription);
|
|
|
|
|
}
|
|
|
|
|
else if (senderPagetype == typeof(VHDoNFS))
|
|
|
|
|
{
|
|
|
|
|
m_srWizardType.UUID = xenTabPageVhdoNFS.UUID;
|
|
|
|
|
m_srWizardType.DeviceConfig = xenTabPageVhdoNFS.DeviceConfig;
|
|
|
|
|
SetCustomDescription(m_srWizardType, xenTabPageVhdoNFS.SrDescription);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void SetCustomDescription(SrWizardType srwizardtype, string description)
|
|
|
|
|
{
|
|
|
|
|
if (srwizardtype.Description == null)
|
|
|
|
|
srwizardtype.Description = description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void FinishWizard()
|
2013-07-09 17:59:47 +02:00
|
|
|
|
{
|
2016-05-11 13:59:20 +02:00
|
|
|
|
if (m_srWizardType is SrWizardType_Hba || m_srWizardType is SrWizardType_Fcoe)
|
2013-07-09 17:59:47 +02:00
|
|
|
|
{
|
|
|
|
|
base.FinishWizard();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool closeWizard;
|
|
|
|
|
RunFinalAction(out closeWizard);
|
|
|
|
|
if (closeWizard)
|
|
|
|
|
base.FinishWizard();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void RunFinalAction(out bool closeWizard)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
|
|
|
|
FinalAction = null;
|
2013-07-09 17:59:47 +02:00
|
|
|
|
closeWizard = false;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
|
|
// Override the WizardBase: try running the SR create/attach. If it succeeds, close the wizard.
|
|
|
|
|
// Otherwise show the error and allow the user to adjust the settings and try again.
|
|
|
|
|
Pool pool = Helpers.GetPoolOfOne(xenConnection);
|
|
|
|
|
if (pool == null)
|
|
|
|
|
{
|
|
|
|
|
log.Error("New SR Wizard: Pool has disappeared");
|
2020-04-22 15:47:03 +02:00
|
|
|
|
using (var dlg = new WarningDialog(string.Format(Messages.NEW_SR_CONNECTION_LOST, Helpers.GetName(xenConnection))))
|
2016-06-20 11:49:12 +02:00
|
|
|
|
{
|
|
|
|
|
dlg.ShowDialog(this);
|
|
|
|
|
}
|
2013-07-09 17:59:47 +02:00
|
|
|
|
|
|
|
|
|
closeWizard = true;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-31 12:31:16 +02:00
|
|
|
|
Host coordinator = xenConnection.Resolve(pool.master);
|
|
|
|
|
if (coordinator == null)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
2021-08-31 12:31:16 +02:00
|
|
|
|
log.Error("New SR Wizard: Coordinator has disappeared");
|
2020-04-22 15:47:03 +02:00
|
|
|
|
using (var dlg = new WarningDialog(string.Format(Messages.NEW_SR_CONNECTION_LOST, Helpers.GetName(xenConnection))))
|
2016-06-20 11:49:12 +02:00
|
|
|
|
{
|
|
|
|
|
dlg.ShowDialog(this);
|
|
|
|
|
}
|
2013-07-09 17:59:47 +02:00
|
|
|
|
|
|
|
|
|
closeWizard = true;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-03 04:33:29 +02:00
|
|
|
|
if (_srToReattach != null && _srToReattach.HasPBDs() && _srToReattach.Connection == xenConnection)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
|
|
|
|
// Error - cannot reattach attached SR
|
|
|
|
|
MessageBox.Show(this,
|
2017-09-03 04:33:29 +02:00
|
|
|
|
String.Format(Messages.STORAGE_IN_USE, _srToReattach.Name(), Helpers.GetName(xenConnection)),
|
2013-06-24 13:41:48 +02:00
|
|
|
|
Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
|
|
|
|
|
FinishCanceled();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// show warning prompt if required
|
|
|
|
|
if (!AskUserIfShouldContinue())
|
|
|
|
|
{
|
|
|
|
|
FinishCanceled();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-31 12:31:16 +02:00
|
|
|
|
List<AsyncAction> actionList = GetActions(coordinator, m_srWizardType.DisasterRecoveryTask);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
|
|
if (actionList.Count == 1)
|
|
|
|
|
FinalAction = actionList[0];
|
|
|
|
|
else
|
2022-02-21 22:53:43 +01:00
|
|
|
|
FinalAction = new ParallelAction(Messages.NEW_SR_WIZARD_FINAL_ACTION_TITLE,
|
|
|
|
|
Messages.NEW_SR_WIZARD_FINAL_ACTION_START,
|
|
|
|
|
Messages.NEW_SR_WIZARD_FINAL_ACTION_END, actionList, xenConnection);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
|
|
// if this is a Disaster Recovery Task, it could be either a "Find existing SRs" or an "Attach SR needed for DR" case
|
|
|
|
|
if (m_srWizardType.DisasterRecoveryTask)
|
|
|
|
|
{
|
2013-07-09 17:59:47 +02:00
|
|
|
|
closeWizard = true;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ProgressBarStyle progressBarStyle = FinalAction is SrIntroduceAction ? ProgressBarStyle.Blocks : ProgressBarStyle.Marquee;
|
2016-06-20 14:17:42 +02:00
|
|
|
|
using (var dialog = new ActionProgressDialog(FinalAction, progressBarStyle) {ShowCancel = true})
|
2013-07-09 17:59:47 +02:00
|
|
|
|
{
|
2016-05-11 13:59:20 +02:00
|
|
|
|
if (m_srWizardType is SrWizardType_Hba || m_srWizardType is SrWizardType_Fcoe)
|
2016-06-20 14:17:42 +02:00
|
|
|
|
{
|
|
|
|
|
ActionProgressDialog closureDialog = dialog;
|
|
|
|
|
// close dialog even when there's an error for HBA SR type as there will be the Summary page displayed.
|
|
|
|
|
FinalAction.Completed +=
|
|
|
|
|
s => Program.Invoke(Program.MainWindow, () =>
|
2013-08-05 15:28:21 +02:00
|
|
|
|
{
|
|
|
|
|
if (closureDialog != null)
|
|
|
|
|
closureDialog.Close();
|
|
|
|
|
});
|
2016-06-20 14:17:42 +02:00
|
|
|
|
}
|
|
|
|
|
dialog.ShowDialog(this);
|
2013-07-09 17:59:47 +02:00
|
|
|
|
}
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
2016-05-11 13:59:20 +02:00
|
|
|
|
if (m_srWizardType is SrWizardType_Hba || m_srWizardType is SrWizardType_Fcoe)
|
2014-07-24 13:14:40 +02:00
|
|
|
|
{
|
|
|
|
|
foreach (var asyncAction in actionList)
|
|
|
|
|
{
|
|
|
|
|
AddActionToSummary(asyncAction);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-03 04:33:29 +02:00
|
|
|
|
if (!FinalAction.Succeeded && FinalAction is SrReattachAction && _srToReattach.HasPBDs())
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
2013-07-19 17:15:37 +02:00
|
|
|
|
// reattach failed. Ensure PBDs are now unplugged and destroyed.
|
2023-03-23 23:25:13 +01:00
|
|
|
|
using (var dialog = new ActionProgressDialog(new DetachSrAction(_srToReattach, true), progressBarStyle))
|
2016-06-20 14:17:42 +02:00
|
|
|
|
{
|
|
|
|
|
dialog.ShowCancel = false;
|
|
|
|
|
dialog.ShowDialog();
|
|
|
|
|
}
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If action failed and frontend wants to stay open, just return
|
|
|
|
|
if (!FinalAction.Succeeded)
|
|
|
|
|
{
|
|
|
|
|
DialogResult = DialogResult.None;
|
|
|
|
|
FinishCanceled();
|
|
|
|
|
|
|
|
|
|
if (m_srWizardType.AutoDescriptionRequired)
|
|
|
|
|
{
|
|
|
|
|
foreach (var srDescriptor in m_srWizardType.SrDescriptors)
|
|
|
|
|
{
|
|
|
|
|
srDescriptor.Description = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Close wizard
|
2013-07-09 17:59:47 +02:00
|
|
|
|
closeWizard = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Dictionary<AsyncAction, SrDescriptor> actionSrDescriptorDict = new Dictionary<AsyncAction, SrDescriptor>();
|
|
|
|
|
|
2014-07-24 13:14:40 +02:00
|
|
|
|
void AddActionToSummary(AsyncAction action)
|
2013-07-09 17:59:47 +02:00
|
|
|
|
{
|
|
|
|
|
if (action == null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
SrDescriptor srDescriptor;
|
|
|
|
|
actionSrDescriptorDict.TryGetValue(action, out srDescriptor);
|
|
|
|
|
|
|
|
|
|
if (srDescriptor == null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (action.Succeeded)
|
|
|
|
|
xenTabPageLvmoHbaSummary.SuccessfullyCreatedSRs.Add(srDescriptor);
|
|
|
|
|
else
|
|
|
|
|
xenTabPageLvmoHbaSummary.FailedToCreateSRs.Add(srDescriptor);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
2021-08-31 12:31:16 +02:00
|
|
|
|
private List<AsyncAction> GetActions(Host coordinator, bool disasterRecoveryTask)
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
|
|
|
|
// Now we need to decide what to do.
|
|
|
|
|
// This will be one off create, introduce, reattach
|
|
|
|
|
|
|
|
|
|
List<AsyncAction> finalActions = new List<AsyncAction>();
|
2013-07-09 17:59:47 +02:00
|
|
|
|
actionSrDescriptorDict.Clear();
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
|
|
foreach (var srDescriptor in m_srWizardType.SrDescriptors)
|
|
|
|
|
{
|
2018-04-03 16:14:42 +02:00
|
|
|
|
var srType = srDescriptor is FibreChannelDescriptor ? (srDescriptor as FibreChannelDescriptor).SrType : m_srWizardType.Type;
|
2013-07-09 17:59:47 +02:00
|
|
|
|
if (String.IsNullOrEmpty(srDescriptor.UUID))
|
2013-06-24 13:41:48 +02:00
|
|
|
|
{
|
|
|
|
|
// Don't need to show any warning, as the only destructive creates
|
|
|
|
|
// are in iSCSI and HBA, where they show their own warning
|
2021-08-31 12:31:16 +02:00
|
|
|
|
finalActions.Add(new SrCreateAction(xenConnection, coordinator,
|
2013-06-24 13:41:48 +02:00
|
|
|
|
srDescriptor.Name,
|
|
|
|
|
srDescriptor.Description,
|
2018-04-03 12:49:50 +02:00
|
|
|
|
srType,
|
2013-06-24 13:41:48 +02:00
|
|
|
|
m_srWizardType.ContentType,
|
|
|
|
|
srDescriptor.DeviceConfig,
|
2015-10-27 19:11:53 +01:00
|
|
|
|
srDescriptor.SMConfig));
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
else if (_srToReattach == null || _srToReattach.Connection != xenConnection)
|
|
|
|
|
{
|
|
|
|
|
// introduce
|
|
|
|
|
if (disasterRecoveryTask &&
|
|
|
|
|
(_srToReattach == null || SR.SupportsDatabaseReplication(xenConnection, _srToReattach)))
|
|
|
|
|
{
|
|
|
|
|
// "Find existing SRs" or "Attach SR needed for DR" cases
|
2018-04-03 12:49:50 +02:00
|
|
|
|
ScannedDeviceInfo deviceInfo = new ScannedDeviceInfo(srType,
|
2013-06-24 13:41:48 +02:00
|
|
|
|
srDescriptor.DeviceConfig,
|
|
|
|
|
srDescriptor.UUID);
|
|
|
|
|
finalActions.Add(new DrTaskCreateAction(xenConnection, deviceInfo));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
finalActions.Add(new SrIntroduceAction(xenConnection,
|
|
|
|
|
srDescriptor.UUID,
|
|
|
|
|
srDescriptor.Name,
|
|
|
|
|
srDescriptor.Description,
|
2018-04-03 12:49:50 +02:00
|
|
|
|
srType,
|
2013-06-24 13:41:48 +02:00
|
|
|
|
m_srWizardType.ContentType,
|
|
|
|
|
srDescriptor.DeviceConfig));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Reattach
|
|
|
|
|
if (disasterRecoveryTask && SR.SupportsDatabaseReplication(xenConnection, _srToReattach))
|
|
|
|
|
{
|
|
|
|
|
// "Attach SR needed for DR" case
|
|
|
|
|
ScannedDeviceInfo deviceInfo = new ScannedDeviceInfo(_srToReattach.GetSRType(true),
|
|
|
|
|
srDescriptor.DeviceConfig,
|
|
|
|
|
_srToReattach.uuid);
|
|
|
|
|
finalActions.Add(new DrTaskCreateAction(xenConnection, deviceInfo));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
finalActions.Add(new SrReattachAction(_srToReattach,
|
|
|
|
|
srDescriptor.Name,
|
|
|
|
|
srDescriptor.Description,
|
|
|
|
|
srDescriptor.DeviceConfig));
|
|
|
|
|
}
|
2013-07-09 17:59:47 +02:00
|
|
|
|
|
|
|
|
|
AsyncAction action = finalActions.Last();
|
|
|
|
|
if (!actionSrDescriptorDict.ContainsKey(action))
|
|
|
|
|
actionSrDescriptorDict.Add(action, srDescriptor);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return finalActions;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool AskUserIfShouldContinue()
|
|
|
|
|
{
|
|
|
|
|
if (!Program.RunInAutomatedTestMode && !String.IsNullOrEmpty(m_srWizardType.UUID))
|
|
|
|
|
{
|
|
|
|
|
if (_srToReattach == null)
|
|
|
|
|
{
|
|
|
|
|
// introduce
|
|
|
|
|
if (m_srWizardType.ShowIntroducePrompt)
|
|
|
|
|
{
|
2016-06-20 11:49:12 +02:00
|
|
|
|
DialogResult dialogResult;
|
2021-03-16 02:50:45 +01:00
|
|
|
|
using (var dlg = new WarningDialog(string.Format(Messages.NEWSR_MULTI_POOL_WARNING, BrandManager.BrandConsole, m_srWizardType.UUID),
|
2013-06-24 13:41:48 +02:00
|
|
|
|
ThreeButtonDialog.ButtonYes,
|
2020-04-22 15:47:03 +02:00
|
|
|
|
new ThreeButtonDialog.TBDButton(Messages.NO_BUTTON_CAPTION, DialogResult.No, selected: true))
|
|
|
|
|
{WindowTitle = Text})
|
2016-06-20 11:49:12 +02:00
|
|
|
|
{
|
|
|
|
|
dialogResult = dlg.ShowDialog(this);
|
|
|
|
|
}
|
|
|
|
|
return DialogResult.Yes == dialogResult;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (_srToReattach.Connection == xenConnection)
|
|
|
|
|
{
|
|
|
|
|
// Reattach
|
|
|
|
|
if (m_srWizardType.ShowReattachWarning)
|
|
|
|
|
{
|
2016-06-20 11:49:12 +02:00
|
|
|
|
DialogResult dialogResult;
|
2021-03-16 02:50:45 +01:00
|
|
|
|
using (var dlg = new WarningDialog(string.Format(Messages.NEWSR_MULTI_POOL_WARNING, BrandManager.BrandConsole, _srToReattach.Name()),
|
2013-06-24 13:41:48 +02:00
|
|
|
|
ThreeButtonDialog.ButtonYes,
|
2020-04-22 15:47:03 +02:00
|
|
|
|
new ThreeButtonDialog.TBDButton(Messages.NO_BUTTON_CAPTION, DialogResult.No, selected: true))
|
|
|
|
|
{WindowTitle = Text})
|
2016-06-20 11:49:12 +02:00
|
|
|
|
{
|
|
|
|
|
dialogResult = dlg.ShowDialog(this);
|
|
|
|
|
}
|
|
|
|
|
return DialogResult.Yes == dialogResult;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// uuid != null
|
|
|
|
|
// _srToReattach != null
|
|
|
|
|
// _srToReattach.Server.IsDetached
|
|
|
|
|
// _srToReattach.Connection != current connection
|
|
|
|
|
|
|
|
|
|
// Warn user SR is already attached to other pool, and then introduce to this pool
|
|
|
|
|
|
2016-06-20 11:49:12 +02:00
|
|
|
|
DialogResult dialogResult;
|
2021-03-16 02:50:45 +01:00
|
|
|
|
using (var dlg = new WarningDialog(string.Format(Messages.ALREADY_ATTACHED_ELSEWHERE, _srToReattach.Name(), Helpers.GetName(xenConnection), Text, BrandManager.BrandConsole),
|
2013-06-24 13:41:48 +02:00
|
|
|
|
ThreeButtonDialog.ButtonOK,
|
2016-06-20 11:49:12 +02:00
|
|
|
|
ThreeButtonDialog.ButtonCancel))
|
|
|
|
|
{
|
|
|
|
|
dialogResult = dlg.ShowDialog(this);
|
|
|
|
|
}
|
2016-06-23 16:47:15 +02:00
|
|
|
|
return DialogResult.OK == dialogResult;
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnShown(EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnShown(e);
|
|
|
|
|
|
|
|
|
|
Text = m_text; //set here; do not set virtual members in constructor
|
|
|
|
|
|
|
|
|
|
if (_srToReattach == null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (xenTabPageChooseSrType.MatchingFrontends <= 0)
|
|
|
|
|
{
|
2021-03-16 02:50:45 +01:00
|
|
|
|
using (var dlg = new ErrorDialog(string.Format(Messages.CANNOT_FIND_SR_WIZARD_TYPE,
|
|
|
|
|
_srToReattach.type, BrandManager.BrandConsole)))
|
2016-06-20 11:49:12 +02:00
|
|
|
|
dlg.ShowDialog(this);
|
2013-06-24 13:41:48 +02:00
|
|
|
|
|
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
else if (xenTabPageChooseSrType.MatchingFrontends == 1)
|
|
|
|
|
{
|
|
|
|
|
// move to "Name" page
|
|
|
|
|
NextStep();
|
|
|
|
|
// move to "Location" page or "Permission checks" page
|
|
|
|
|
NextStep();
|
|
|
|
|
// if rbac, stay on this page (Ref. CA-61525)
|
|
|
|
|
if (_rbac)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override string WizardPaneHelpID()
|
|
|
|
|
{
|
|
|
|
|
return CurrentStepTabPage is RBACWarningPage ? FormatHelpId("Rbac") : base.WizardPaneHelpID();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void CheckNFSISORadioButton()
|
|
|
|
|
{
|
|
|
|
|
xenTabPageChooseSrType.PreselectNewSrWizardType(typeof(SrWizardType_NfsIso));
|
|
|
|
|
}
|
2017-11-23 11:59:15 +01:00
|
|
|
|
|
2013-06-24 13:41:48 +02:00
|
|
|
|
}
|
|
|
|
|
}
|