Inheritance: System.Windows.Forms.UserControl
Exemplo n.º 1
0
        protected override void UpdateWizardContent(XenTabPage senderPage)
        {
            var prevPageType = senderPage.GetType();

            if (prevPageType == typeof(DRFailoverWizardStoragePage))
                DRFailoverWizardAppliancesPage1.AllPoolMetadata = DRFailoverWizardStoragePage1.AllPoolMetadata;
            else if (prevPageType == typeof(DRFailoverWizardAppliancesPage))
            {
                DRFailoverWizardRecoverPage1.StartActionAfterRecovery = DRFailoverWizardAppliancesPage1.StartActionAfterRecovery;
                DRFailoverWizardPrecheckPage1.SelectedPoolMetadata = DRFailoverWizardAppliancesPage1.SelectedPoolMetadata;
                DRFailoverWizardRecoverPage1.SelectedPoolMetadata = DRFailoverWizardAppliancesPage1.SelectedPoolMetadata;

            }
            else if (prevPageType == typeof(DRFailoverWizardRecoverPage))
                DoFinalCleanup();
        }
Exemplo n.º 2
0
        protected void RemovePage(XenTabPage page)
        {
            xenTabControlBody.Controls.Remove(page);

            page.StatusChanged -= page_StatusChanged;
            page.WizardContentUpdater = null;
            page.NextPagePrecheck = null;
            wizardProgress.Steps.Remove(page);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Updates the next wizard pages with content provided by the last visited page
 /// </summary>
 /// <param name="senderPage">The last visited page</param>
 protected virtual void UpdateWizardContent(XenTabPage senderPage)
 {
 }
Exemplo n.º 4
0
 internal void DisablePage(XenTabPage wizardTabPage, bool disable)
 {
     foreach (XenTabPage p in wizardProgress.Steps)
         if (p == wizardTabPage)
         {
             p.DisableStep = disable;
             return;
         }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Add a given page to the end of the wizard's page collection
 /// </summary>
 /// <param name="page">The page to add</param>
 protected void AddPage(XenTabPage page)
 {
     AddPage(page, -1);
 }
Exemplo n.º 6
0
        protected override void UpdateWizardContent(XenTabPage senderPage)
        {
            var prevPageType = senderPage.GetType();

            if (prevPageType == typeof(RollingUpgradeWizardSelectPool))
            {
                var selectedMasters = RollingUpgradeWizardSelectPool.SelectedMasters;
                RollingUpgradeWizardPrecheckPage.SelectedMasters = selectedMasters;
                RollingUpgradeWizardInstallMethodPage.SelectedMasters = selectedMasters;
                RollingUpgradeReadyToUpgradePage.SelectedMasters = selectedMasters;
                RollingUpgradeUpgradePage.SelectedMasters = selectedMasters;
            }
            else if (prevPageType == typeof(RollingUpgradeWizardUpgradeModePage))
            {
                var manualModeSelected = RollingUpgradeWizardUpgradeModePage.ManualModeSelected;

                RemovePageAt(4);
                if (manualModeSelected)
                    AddPage(RollingUpgradeReadyToUpgradePage, 4);
                else
                    AddPage(RollingUpgradeWizardInstallMethodPage, 4);

                RollingUpgradeWizardPrecheckPage.ManualModeSelected = manualModeSelected;
                RollingUpgradeUpgradePage.ManualModeSelected = manualModeSelected;
            }
            else if (prevPageType == typeof(RollingUpgradeWizardInstallMethodPage))
                RollingUpgradeUpgradePage.InstallMethodConfig = RollingUpgradeWizardInstallMethodPage.InstallMethodConfig;
            else if (prevPageType == typeof(RollingUpgradeWizardPrecheckPage))
                RollingUpgradeUpgradePage.ProblemsResolvedPreCheck = RollingUpgradeWizardPrecheckPage.ProblemsResolvedPreCheck;
        }
Exemplo n.º 7
0
        protected override void UpdateWizardContent(XenTabPage senderPage)
        {
            var senderPagetype = senderPage.GetType();

            if (senderPagetype == typeof(ChooseSrTypePage))
            {
                #region
                RemovePagesFrom(_rbac ? 3 : 2);
                m_srWizardType = xenTabPageChooseSrType.SrWizardType;

                if (m_srWizardType is SrWizardType_VhdoNfs)
                    AddPage(xenTabPageVhdoNFS);
                else if (m_srWizardType is SrWizardType_LvmoIscsi)
                    AddPage(xenTabPageLvmoIscsi);
                else if (m_srWizardType is SrWizardType_LvmoHba)
                {
                    AddPage(xenTabPageLvmoHba);
                    AddPage(xenTabPageLvmoHbaSummary);
                }
                else if (m_srWizardType is SrWizardType_Cslg)
                {
                    AddPage(xenTabPageCslg);

                    if (Helpers.BostonOrGreater(xenConnection))
                        AddPages(xenTabPageCslgLocation, xenTabPageCslgSettings);
                    else
                        AddPages(new XenTabPage { Text = "" });
                }
                else if (m_srWizardType is SrWizardType_NetApp || m_srWizardType is SrWizardType_EqualLogic)
                {
                    AddPages(xenTabPageCslg, xenTabPageFilerDetails);

                    if (m_srWizardType is SrWizardType_NetApp)
                    {
                        xenTabPageFilerDetails.IsNetApp = true;
                        AddPage(xenTabPageNetApp);
                    }
                    else if (m_srWizardType is SrWizardType_EqualLogic)
                    {
                        xenTabPageFilerDetails.IsNetApp = false;
                        AddPage(xentabPageEqualLogic);
                    }
                }
                else if (m_srWizardType is SrWizardType_CifsIso)
                    AddPage(xenTabPageCifsIso);
                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;
                else if (m_srWizardType is SrWizardType_LvmoIscsi)
                    xenTabPageLvmoIscsi.SrWizardType = m_srWizardType;
                else if (m_srWizardType is SrWizardType_LvmoHba)
                    xenTabPageLvmoHba.SrWizardType = m_srWizardType;
                else if (m_srWizardType is SrWizardType_Cslg || m_srWizardType is SrWizardType_NetApp || m_srWizardType is SrWizardType_EqualLogic)
                    xenTabPageCslg.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;
                #endregion
            }
            else if (senderPagetype == typeof(CIFS_ISO))
            {
                m_srWizardType.DeviceConfig = xenTabPageCifsIso.DeviceConfig;
                SetCustomDescription(m_srWizardType, xenTabPageCifsIso.SrDescription);
            }
            else if (senderPagetype == typeof(LVMoHBA))
            {
                string description = m_srWizardType.Description;
                string name = m_srWizardType.SrName;

                List<string> names = xenConnection.Cache.SRs.Select(sr => sr.Name).ToList();

                m_srWizardType.SrDescriptors.Clear();
                foreach (var lvmOhbaSrDescriptor in xenTabPageLvmoHba.SrDescriptors)
                {
                    lvmOhbaSrDescriptor.Name = name;
                    if (!string.IsNullOrEmpty(description))
                        lvmOhbaSrDescriptor.Description = description;

                    m_srWizardType.SrDescriptors.Add(lvmOhbaSrDescriptor);
                    names.Add(name);
                    name = SrWizardHelpers.DefaultSRName(Messages.NEWSR_HBA_DEFAULT_NAME, names);
                }

                xenTabPageLvmoHbaSummary.SuccessfullyCreatedSRs.Clear();
                xenTabPageLvmoHbaSummary.FailedToCreateSRs.Clear();
                RunFinalAction();
            }
            else if (senderPagetype == typeof(LVMoISCSI))
            {
                m_srWizardType.UUID = xenTabPageLvmoIscsi.UUID;
                m_srWizardType.DeviceConfig = xenTabPageLvmoIscsi.DeviceConfig;
                SetCustomDescription(m_srWizardType, xenTabPageLvmoIscsi.SrDescription);
            }
            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);
            }
            else if (senderPagetype == typeof(CSLG))
            {
                #region
                if (Helpers.BostonOrGreater(xenConnection))
                {
                    xenTabPageCslgLocation.SelectedStorageAdapter = xenTabPageCslg.SelectedStorageAdapter;
                    xenTabPageCslgSettings.SelectedStorageAdapter = xenTabPageCslg.SelectedStorageAdapter;
                    NotifyNextPagesOfChange(xenTabPageCslgLocation, xenTabPageCslgSettings);
                }
                else
                {
                    RemovePagesFrom(_rbac ? 4 : 3);

                    if (xenTabPageCslg.SelectedStorageSystem != null)
                    {
                        AddPages(xenTabPageCslgSettings);
                        xenTabPageCslgSettings.SystemStorage = xenTabPageCslg.SelectedStorageSystem;
                        xenTabPageCslgSettings.StoragePools = xenTabPageCslg.StoragePools;
                        NotifyNextPagesOfChange(xenTabPageCslgLocation);
                    }
                    else if (xenTabPageCslg.NetAppSelected || xenTabPageCslg.DellSelected)
                    {
                        AddPage(xenTabPageFilerDetails);
                        NotifyNextPagesOfChange(xenTabPageFilerDetails);

                        if (xenTabPageCslg.NetAppSelected)
                        {
                            if (m_srWizardType is SrWizardType_Cslg)
                            {
                                m_srWizardType = ((SrWizardType_Cslg)m_srWizardType).ToNetApp();
                                xenTabPageCslg.SrWizardType = m_srWizardType;
                            }
                            xenTabPageFilerDetails.IsNetApp = true;
                            AddPage(xenTabPageNetApp);
                        }
                        else if (xenTabPageCslg.DellSelected)
                        {
                            if (m_srWizardType is SrWizardType_Cslg)
                            {
                                m_srWizardType = ((SrWizardType_Cslg)m_srWizardType).ToEqualLogic();
                                xenTabPageCslg.SrWizardType = m_srWizardType;
                            }
                            xenTabPageFilerDetails.IsNetApp = false;
                            AddPage(xentabPageEqualLogic);
                        }
                    }
                }

                foreach (var entry in xenTabPageCslg.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
                #endregion
            }
            else if (senderPagetype == typeof(CslgLocation))
            {
                xenTabPageCslgSettings.StorageLinkCredentials = xenTabPageCslgLocation.StorageLinkCredentials;
                xenTabPageCslgSettings.SystemStorage = xenTabPageCslgLocation.SystemStorage;
                xenTabPageCslgSettings.StoragePools = xenTabPageCslgLocation.StoragePools;

                foreach (var entry in xenTabPageCslgLocation.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
                NotifyNextPagesOfChange(xenTabPageCslgSettings);
            }
            else if (senderPagetype == typeof(CslgSettings))
            {
                foreach (var entry in xenTabPageCslgSettings.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
                SetCustomDescription(m_srWizardType, xenTabPageCslgSettings.SrDescription);
            }
            else if (senderPagetype == typeof(FilerDetails))
            {
                #region
                foreach (var entry in xenTabPageFilerDetails.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;

                if (xenTabPageFilerDetails.IsNetApp)
                {
                    xenTabPageNetApp.SrScanAction = xenTabPageFilerDetails.SrScanAction;
                    xenTabPageNetApp.SrWizardType = m_srWizardType;
                    NotifyNextPagesOfChange(xenTabPageNetApp);
                }
                else
                {
                    xentabPageEqualLogic.SrScanAction = xenTabPageFilerDetails.SrScanAction;
                    xentabPageEqualLogic.SrWizardType = m_srWizardType;
                    NotifyNextPagesOfChange(xentabPageEqualLogic);
                }
                #endregion
            }
            else if (senderPagetype == typeof(NetApp))
            {
                m_srWizardType.UUID = xenTabPageNetApp.UUID;
                foreach (var entry in xenTabPageNetApp.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
                SetCustomDescription(m_srWizardType, xenTabPageNetApp.SrDescription);
            }
            else if (senderPagetype == typeof(EqualLogic))
            {
                m_srWizardType.UUID = xentabPageEqualLogic.UUID;
                foreach (var entry in xentabPageEqualLogic.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
                SetCustomDescription(m_srWizardType, xentabPageEqualLogic.SrDescription);
            }
        }
Exemplo n.º 8
0
        protected override bool RunNextPagePrecheck(XenTabPage senderPage)
        {
            if (senderPage.GetType() == typeof(GenericSelectHostsPage))
            {
                var hostList = bugToolPageSelectHosts1.SelectedHosts;
                return bugToolPageSelectCapabilities1.GetCommonCapabilities(hostList);
            }

            return true;
        }
Exemplo n.º 9
0
        protected override void UpdateWizardContent(XenTabPage senderPage)
        {
            var prevPageType = senderPage.GetType();

            if (prevPageType == typeof(GenericSelectHostsPage))
            {
                bugToolPageRetrieveData.SelectedHosts = bugToolPageSelectHosts1.SelectedHosts;
            }
            else if (prevPageType == typeof(BugToolPageSelectCapabilities))
            {
                bugToolPageRetrieveData.CapabilityList = bugToolPageSelectCapabilities1.Capabilities;
            }
        }
Exemplo n.º 10
0
        protected override void UpdateWizardContent(XenTabPage senderPage)
        {
            var prevPageType = senderPage.GetType();

            if (prevPageType == typeof(NewVMApplianceNamePage))
                xenTabPageVMs.GroupName = xenTabPageName.VMApplianceName;
            else if (prevPageType == typeof(NewVMGroupVMsPage<VM_appliance>))
                xenTabPageVMOrderAndDelays.SetSelectedVMs(xenTabPageVMs.SelectedVMs);
            else if (prevPageType == typeof(NewVMApplianceVMOrderAndDelaysPage))
                xenTabPageFinish.Summary = GetSummary();
        }
Exemplo n.º 11
0
        protected override void UpdateWizardContent(XenTabPage page)
		{
			Type type = page.GetType();

			if (type == typeof(ImportSourcePage))
			{
				#region ImportSourcePage

				var oldTypeOfImport = m_typeOfImport;//store previous type
				m_typeOfImport = m_pageImportSource.TypeOfImport;
				var appliancePages = new XenTabPage[] {m_pageEula, m_pageHost, m_pageStorage, m_pageNetwork, m_pageSecurity, m_pageOptions, m_pageTvmIp};
                var imagePages = new XenTabPage[] { m_pageVMconfig, m_pageHost, m_pageStorage, m_pageNetwork, m_pageOptions, m_pageTvmIp };
                var xvaPages = new XenTabPage[] { m_pageXvaHost, m_pageXvaStorage, m_pageXvaNetwork };

				switch (m_typeOfImport)
				{
					case ImportType.Ovf:
						if (oldTypeOfImport != ImportType.Ovf)
						{
							Text = Messages.WIZARD_TEXT_IMPORT_OVF;
							pictureBoxWizard.Image = Properties.Resources._000_ImportVirtualAppliance_h32bit_32;
							m_pageFinish.ShowStartVmsGroupBox = false;
                            RemovePages(imagePages);
                            RemovePages(xvaPages);
                            AddAfterPage(m_pageImportSource, appliancePages);
						}

						m_pageEula.SelectedOvfEnvelope = m_pageImportSource.SelectedOvfEnvelope;
						m_pageSecurity.SelectedOvfPackage = m_pageImportSource.SelectedOvfPackage;

						CheckDisabledPages(m_pageEula, m_pageSecurity); //decide whether to disable these progress steps
						ResetVmMappings(m_pageImportSource.SelectedOvfEnvelope);
						m_pageHost.SelectedOvfEnvelope = m_pageImportSource.SelectedOvfEnvelope;
						m_pageHost.SetDefaultTarget(m_selectedObject);
						m_pageHost.VmMappings = m_vmMappings;
						m_pageStorage.SelectedOvfEnvelope = m_pageImportSource.SelectedOvfEnvelope;
                        lunPerVdiMappingPage.SelectedOvfEnvelope = m_pageImportSource.SelectedOvfEnvelope;
						m_pageNetwork.SelectedOvfEnvelope = m_pageImportSource.SelectedOvfEnvelope;
                        
						NotifyNextPagesOfChange(m_pageEula, m_pageHost, m_pageStorage, m_pageNetwork, m_pageSecurity, m_pageOptions);
						break;
					case ImportType.Vhd:
						if (oldTypeOfImport != ImportType.Vhd)
						{
							Text = Messages.WIZARD_TEXT_IMPORT_VHD;
							pictureBoxWizard.Image = Properties.Resources._000_ImportVM_h32bit_32;
							m_pageFinish.ShowStartVmsGroupBox = false;
                            RemovePages(appliancePages);
                            RemovePages(xvaPages);
                            AddAfterPage(m_pageImportSource, imagePages);
						}
						m_pageVMconfig.IsWim = m_pageImportSource.IsWIM;
						m_pageHost.SetDefaultTarget(m_selectedObject);
 						m_pageHost.SelectedOvfEnvelope = null;
						m_pageHost.VmMappings = m_vmMappings;
						NotifyNextPagesOfChange(m_pageVMconfig, m_pageHost, m_pageStorage, m_pageNetwork, m_pageOptions);
						break;
					case ImportType.Xva:
						if (oldTypeOfImport != ImportType.Xva)
						{
							Text = Messages.WIZARD_TEXT_IMPORT_XVA;
							pictureBoxWizard.Image = Properties.Resources._000_ImportVM_h32bit_32;
							m_pageFinish.ShowStartVmsGroupBox = true;
                            RemovePages(imagePages);
                            RemovePages(appliancePages);
                            AddAfterPage(m_pageImportSource, xvaPages);
						}
						m_pageXvaHost.SelectedHost = m_selectedObject as Host;
						m_pageXvaHost.SelectedConnection = m_selectedObject != null ? m_selectedObject.Connection : null;
						m_pageXvaStorage.FilePath = m_pageImportSource.FilePath;
						break;
				}

			    #endregion
			}
			else if (type == typeof(ImageVMConfigPage))
			{
				//then use it to create an ovf for the import
				m_envelopeFromVhd = InitialiseOvfEnvelope();
				m_pageStorage.SelectedOvfEnvelope = m_envelopeFromVhd;
			    lunPerVdiMappingPage.SelectedOvfEnvelope = m_envelopeFromVhd;
				m_pageNetwork.SelectedOvfEnvelope = m_envelopeFromVhd;
				ResetVmMappings(m_envelopeFromVhd);
				NotifyNextPagesOfChange(m_pageHost, m_pageStorage, m_pageNetwork);
			}
			else if (type == typeof(ImportSelectHostPage))
			{
                RemovePage(m_pageRbac);
				ConfigureRbacPage(m_pageHost.Connection);
				m_vmMappings = m_pageHost.VmMappings;
				m_pageStorage.VmMappings = m_vmMappings;
				m_pageStorage.Connection = m_pageHost.Connection;
				m_pageNetwork.Connection = m_pageHost.Connection;
				m_pageOptions.Connection = m_pageHost.Connection;
				m_pageTvmIp.Connection = m_pageHost.Connection;
				NotifyNextPagesOfChange(m_pageStorage, m_pageNetwork, m_pageOptions, m_pageTvmIp);
			}
			else if (type == typeof(ImportSelectStoragePage))
			{
			    RemovePage(lunPerVdiMappingPage);
			    lunPerVdiMappingPage.ClearPickerData();
				m_vmMappings = m_pageStorage.VmMappings;
				m_pageNetwork.VmMappings = m_vmMappings;
                lunPerVdiMappingPage.VmMappings = m_vmMappings;
                if (lunPerVdiMappingPage.IsAnyPickerDataMappable 
                    && lunPerVdiMappingPage.MapLunsToVdisRequired
                    && m_typeOfImport == ImportType.Ovf)
                    AddAfterPage(m_pageStorage, lunPerVdiMappingPage);
			}
            else if (type == typeof(LunPerVdiImportPage))
            {
                m_vmMappings = lunPerVdiMappingPage.VmMappings;
                m_pageNetwork.VmMappings = m_vmMappings;
            }
			else if (type == typeof(ImportSelectNetworkPage))
			{
				m_vmMappings = m_pageNetwork.VmMappings;
				m_pageOptions.VmMappings = m_vmMappings;
			}
			else if (type == typeof(GlobalSelectHost))
			{
				var con = m_pageXvaHost.SelectedHost == null ? m_pageXvaHost.SelectedConnection : m_pageXvaHost.SelectedHost.Connection;
                RemovePage(m_pageRbac);
				ConfigureRbacPage(con);

				m_pageXvaStorage.SetConnection(con);
				m_pageXvaStorage.SetTargetHost(m_ignoreAffinitySet ? null : m_pageXvaHost.SelectedHost);

				m_pageXvaNetwork.SetConnection(con);
				m_pageXvaNetwork.SetAffinity(m_pageXvaHost.SelectedHost);
				
				NotifyNextPagesOfChange(m_pageXvaStorage, m_pageXvaNetwork);
			}
			else if (type == typeof(StoragePickerPage))
			{
				m_pageFinish.ShowStartVmsGroupBox = m_pageXvaStorage.ImportedVm != null && !m_pageXvaStorage.ImportedVm.is_a_template;
				m_pageXvaNetwork.SetVm(m_pageXvaStorage.ImportedVm);
				NotifyNextPagesOfChange(m_pageXvaNetwork);
			}

			if (type != typeof(ImportFinishPage))
				NotifyNextPagesOfChange(m_pageFinish);
		}
Exemplo n.º 12
0
        protected override void UpdateWizardContent(XenTabPage senderPage)
        {
            var senderPagetype = senderPage.GetType();

            if (senderPagetype == typeof(ChooseSrTypePage))
            {
                #region
                RemovePagesFrom(_rbac ? 3 : 2);
                m_srWizardType = xenTabPageChooseSrType.SrWizardType;

                if (m_srWizardType is SrWizardType_VhdoNfs)
                    AddPage(xenTabPageVhdoNFS);
                else if (m_srWizardType is SrWizardType_LvmoIscsi)
                {
                    AddPage(xenTabPageLvmoIscsi);
                }
                else if (m_srWizardType is SrWizardType_LvmoHba)
                {
                    AddPage(xenTabPageLvmoHba);
                    AddPage(xenTabPageLvmoHbaSummary);
                }
                else if (m_srWizardType is SrWizardType_Fcoe)
                {
                    AddPage(xenTabPageLvmoFcoe);
                    AddPage(xenTabPageLvmoHbaSummary);
                }
                else if (m_srWizardType is SrWizardType_Cslg)
                {
                    AddPage(xenTabPageCslg);
                    AddPages(xenTabPageCslgLocation, xenTabPageCslgSettings);
                }
                else if (m_srWizardType is SrWizardType_NetApp || m_srWizardType is SrWizardType_EqualLogic)
                {
                    AddPages(xenTabPageCslg, xenTabPageFilerDetails);

                    if (m_srWizardType is SrWizardType_NetApp)
                    {
                        xenTabPageFilerDetails.IsNetApp = true;
                        AddPage(xenTabPageNetApp);
                    }
                    else if (m_srWizardType is SrWizardType_EqualLogic)
                    {
                        xenTabPageFilerDetails.IsNetApp = false;
                        AddPage(xentabPageEqualLogic);
                    }
                }
                else if (m_srWizardType is SrWizardType_CifsIso)
                    AddPage(xenTabPageCifsIso);
                else if (m_srWizardType is SrWizardType_Cifs)
                    AddPage(xenTabPageCifs);
                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;
                else if (m_srWizardType is SrWizardType_LvmoIscsi)
                    xenTabPageLvmoIscsi.SrWizardType = m_srWizardType;
                else if (m_srWizardType is SrWizardType_LvmoHba)
                    xenTabPageLvmoHba.SrWizardType = m_srWizardType;
                else if (m_srWizardType is SrWizardType_Cslg || m_srWizardType is SrWizardType_NetApp || m_srWizardType is SrWizardType_EqualLogic)
                    xenTabPageCslg.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;
                else if (m_srWizardType is SrWizardType_Cifs)
                    xenTabPageCifs.SrWizardType = m_srWizardType;
                else if (m_srWizardType is SrWizardType_Fcoe)
                    xenTabPageLvmoFcoe.SrWizardType = m_srWizardType;
                #endregion
            }
            else if (senderPagetype == typeof(CIFS_ISO))
            {
                m_srWizardType.DeviceConfig = xenTabPageCifsIso.DeviceConfig;
                SetCustomDescription(m_srWizardType, xenTabPageCifsIso.SrDescription);
            }
            else if (senderPagetype == typeof(CifsFrontend))
            {
                m_srWizardType.UUID = xenTabPageCifs.UUID;
                m_srWizardType.DeviceConfig = xenTabPageCifs.DeviceConfig;
                SetCustomDescription(m_srWizardType, xenTabPageCifs.SrDescription);
            }
            else if (senderPagetype == typeof(LVMoISCSI))
            {
                SetCustomDescription(m_srWizardType, xenTabPageLvmoIscsi.SrDescription);

                m_srWizardType.UUID = xenTabPageLvmoIscsi.UUID;
                m_srWizardType.DeviceConfig = xenTabPageLvmoIscsi.DeviceConfig;
            }
            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);
            }
            else if (senderPagetype == typeof(CSLG))
            {
                xenTabPageCslgLocation.SelectedStorageAdapter = xenTabPageCslg.SelectedStorageAdapter;
                xenTabPageCslgSettings.SelectedStorageAdapter = xenTabPageCslg.SelectedStorageAdapter;
                NotifyNextPagesOfChange(xenTabPageCslgLocation, xenTabPageCslgSettings);

                foreach (var entry in xenTabPageCslg.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
            }
            else if (senderPagetype == typeof(CslgLocation))
            {
                xenTabPageCslgSettings.StorageLinkCredentials = xenTabPageCslgLocation.StorageLinkCredentials;
                xenTabPageCslgSettings.SystemStorage = xenTabPageCslgLocation.SystemStorage;
                xenTabPageCslgSettings.StoragePools = xenTabPageCslgLocation.StoragePools;

                foreach (var entry in xenTabPageCslgLocation.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
                NotifyNextPagesOfChange(xenTabPageCslgSettings);
            }
            else if (senderPagetype == typeof(CslgSettings))
            {
                foreach (var entry in xenTabPageCslgSettings.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
                SetCustomDescription(m_srWizardType, xenTabPageCslgSettings.SrDescription);
            }
            else if (senderPagetype == typeof(FilerDetails))
            {
                #region
                foreach (var entry in xenTabPageFilerDetails.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;

                if (xenTabPageFilerDetails.IsNetApp)
                {
                    xenTabPageNetApp.SrScanAction = xenTabPageFilerDetails.SrScanAction;
                    xenTabPageNetApp.SrWizardType = m_srWizardType;
                    NotifyNextPagesOfChange(xenTabPageNetApp);
                }
                else
                {
                    xentabPageEqualLogic.SrScanAction = xenTabPageFilerDetails.SrScanAction;
                    xentabPageEqualLogic.SrWizardType = m_srWizardType;
                    NotifyNextPagesOfChange(xentabPageEqualLogic);
                }
                #endregion
            }
            else if (senderPagetype == typeof(NetApp))
            {
                m_srWizardType.UUID = xenTabPageNetApp.UUID;
                foreach (var entry in xenTabPageNetApp.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
                SetCustomDescription(m_srWizardType, xenTabPageNetApp.SrDescription);
            }
            else if (senderPagetype == typeof(EqualLogic))
            {
                m_srWizardType.UUID = xentabPageEqualLogic.UUID;
                foreach (var entry in xentabPageEqualLogic.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
                SetCustomDescription(m_srWizardType, xentabPageEqualLogic.SrDescription);
            }
        }
Exemplo n.º 13
0
        protected override void UpdateWizardContent(XenTabPage senderPage)
        {
            if (senderPage.GetType() == typeof(AssignPriorities))
            {
                xenTabPageHaFinish.HeartbeatSrName = xenTabPageChooseSR.SelectedHeartbeatSR.Name;
                xenTabPageHaFinish.Ntol = xenTabPageAssignPriorities.Ntol;

                int alwaysRestartHighPriority = 0, alwaysRestart = 0, bestEffort = 0, doNotRestart = 0;
                foreach (VM.HA_Restart_Priority priority in xenTabPageAssignPriorities.CurrentSettings.Values)
                {
                    switch (priority)
                    {
                        case VM.HA_Restart_Priority.AlwaysRestartHighPriority:
                            alwaysRestartHighPriority++;
                            break;
                        case VM.HA_Restart_Priority.AlwaysRestart:
                        case VM.HA_Restart_Priority.Restart:
                            alwaysRestart++;
                            break;
                        case VM.HA_Restart_Priority.BestEffort:
                            bestEffort++;
                            break;
                        case VM.HA_Restart_Priority.DoNotRestart:
                            doNotRestart++;
                            break;
                    }
                }

                xenTabPageHaFinish.AlwaysRestartHighPriority = alwaysRestartHighPriority;
                xenTabPageHaFinish.AlwaysRestart = alwaysRestart;
                xenTabPageHaFinish.BestEffort = bestEffort;
                xenTabPageHaFinish.DoNotRestart = doNotRestart;
            }
        }
Exemplo n.º 14
0
        protected override void UpdateWizardContent(XenTabPage page)
		{
			Type type = page.GetType();

			if (type == typeof(ExportAppliancePage))
			{
			    var oldExportasXva = m_exportAsXva;
			    m_exportAsXva = m_pageExportAppliance.ExportAsXva; //this ensures that m_exportAsXva is assigned a value

			    var ovfPages = new XenTabPage[] {m_pageExportEula, m_pageExportOptions, m_pageTvmIp};

			    if (oldExportasXva != m_exportAsXva)
			    {
			        RemovePage(m_pageRbac);

			        if ((bool)m_exportAsXva)
			        {
			            Text = Messages.MAINWINDOW_XVA_TITLE;
			            pictureBoxWizard.Image = Properties.Resources.export_32;
			            RemovePages(ovfPages);
			        }
			        else
			        {
			            Text = Messages.EXPORT_APPLIANCE;
			            pictureBoxWizard.Image = Properties.Resources._000_ExportVirtualAppliance_h32bit_32;
			            AddAfterPage(m_pageExportSelectVMs, ovfPages);
			        }

			        ConfigureRbacPage();
			    }

			    m_pageExportSelectVMs.ExportAsXva = (bool)m_exportAsXva;

                if (m_pageExportSelectVMs.ApplianceDirectory != m_pageExportAppliance.ApplianceDirectory)
                    NotifyNextPagesOfChange(m_pageExportSelectVMs);

			    m_pageExportSelectVMs.ApplianceDirectory = m_pageExportAppliance.ApplianceDirectory;
			}

            if (type != typeof(ExportFinishPage))
				NotifyNextPagesOfChange(m_pageFinish);
		}
Exemplo n.º 15
0
        protected override bool RunNextPagePrecheck(XenTabPage senderPage)
        {
            // if reattaching and RBAC warning page is visible, then we run the prechecks when leaving the RBAC warning page
            // otherwise, when leaving xenTabPageSrName (Ref. CA-61525)
            bool runPrechecks = _srToReattach != null && _rbac
                                    ? senderPage == xenTabPageRbacWarning
                                    : senderPage == xenTabPageSrName;

            if (runPrechecks)
            {

                if (m_srWizardType is SrWizardType_Fcoe)
                {
                    return SetFCDevicesOnLVMoHBAPage(xenTabPageLvmoFcoe);
                }
                if (m_srWizardType is SrWizardType_LvmoHba)
                {
                    return SetFCDevicesOnLVMoHBAPage(xenTabPageLvmoHba);
                }
                if (m_srWizardType is SrWizardType_Cslg || m_srWizardType is SrWizardType_NetApp || m_srWizardType is SrWizardType_EqualLogic)
                {
                    xenTabPageCslg.SrWizardType = m_srWizardType;
                    return xenTabPageCslg.PerformStorageSystemScan();
                }
            }
			
			if (senderPage == xenTabPageLvmoFcoe)
            {
                return CanShowLVMoHBASummaryPage(xenTabPageLvmoFcoe.SrDescriptors);
            }

            if (m_srWizardType is SrWizardType_LvmoHba)
            {
                if (!Helpers.DundeeOrGreater(xenConnection) && senderPage == xenTabPageLvmoHba)
                {
                    return CanShowLVMoHBASummaryPage(xenTabPageLvmoHba.SrDescriptors);
                }
                else if (senderPage == xenTabPageStorageProvisioningMethod
                            //if there is no sr to be created (all will be reattached)
                            || senderPage == xenTabPageLvmoHba && xenTabPageLvmoHba.SrDescriptors.All(srDescriptor => !string.IsNullOrEmpty(srDescriptor.UUID)))
                {
                    //setting SM Config to the SRs being created (UUID == empty)
                    if (xenTabPageStorageProvisioningMethod.SMConfig.Count > 0)
                    {
                        xenTabPageLvmoHba.SrDescriptors
                            .Where(desc => string.IsNullOrEmpty(desc.UUID)).ToList()
                            .ForEach(desc => desc.SMConfig = xenTabPageStorageProvisioningMethod.SMConfig);
                    }
                    return CanShowLVMoHBASummaryPage(xenTabPageLvmoHba.SrDescriptors);
                }
            }
            return base.RunNextPagePrecheck(senderPage);
        }
Exemplo n.º 16
0
        protected override void UpdateWizardContent(XenTabPage senderPage)
        {
            var prevPageType = senderPage.GetType();

            if (prevPageType == typeof(NewPolicyPolicyNamePage))
                xenTabPageVMsPage.GroupName = xenTabPagePolicy.PolicyName;
            else if (prevPageType == typeof(NewPolicySnapshotFrequencyPage))
            {
                xenTabPageArchive.SnapshotFrequency = xenTabPageSnapshotFrequency.Frequency;
                xenTabPageArchive.BackupDaysCount = GetBackupDaysCount();
            }
            else if (prevPageType == typeof(NewPolicyEmailPage))
            {
                xenTabPageFinish.Summary = GetSummary();
                xenTabPageFinish.SelectedVMsCount = xenTabPageVMsPage.SelectedVMs.Count;
            }
        }
Exemplo n.º 17
0
        protected override void UpdateWizardContent(XenTabPage senderPage)
        {
            var senderPagetype = senderPage.GetType();

            if (senderPagetype == typeof(ChooseSrTypePage))
            {
                #region
                RemovePagesFrom(_rbac ? 3 : 2);
                m_srWizardType = xenTabPageChooseSrType.SrWizardType;

                if (m_srWizardType is SrWizardType_VhdoNfs)
                    AddPage(xenTabPageVhdoNFS);
                else if (m_srWizardType is SrWizardType_LvmoIscsi)
                {
                    AddPage(xenTabPageLvmoIscsi);

                    if (Helpers.DundeeOrGreater(xenConnection))
                        AddPage(xenTabPageStorageProvisioningMethod);
                }
                else if (m_srWizardType is SrWizardType_LvmoHba)
                {
                    AddPage(xenTabPageLvmoHba);

                    if (Helpers.DundeeOrGreater(xenConnection))
                        AddPage(xenTabPageStorageProvisioningMethod);
                    
                    AddPage(xenTabPageLvmoHbaSummary);
                }
                else if (m_srWizardType is SrWizardType_Fcoe)
                {
                    AddPage(xenTabPageLvmoFcoe);
                    AddPage(xenTabPageLvmoHbaSummary);
                }
                else if (m_srWizardType is SrWizardType_Cslg)
                {
                    AddPage(xenTabPageCslg);

                    if (Helpers.BostonOrGreater(xenConnection))
                        AddPages(xenTabPageCslgLocation, xenTabPageCslgSettings);
                    else
                        AddPages(new XenTabPage { Text = "" });
                }
                else if (m_srWizardType is SrWizardType_NetApp || m_srWizardType is SrWizardType_EqualLogic)
                {
                    AddPages(xenTabPageCslg, xenTabPageFilerDetails);

                    if (m_srWizardType is SrWizardType_NetApp)
                    {
                        xenTabPageFilerDetails.IsNetApp = true;
                        AddPage(xenTabPageNetApp);
                    }
                    else if (m_srWizardType is SrWizardType_EqualLogic)
                    {
                        xenTabPageFilerDetails.IsNetApp = false;
                        AddPage(xentabPageEqualLogic);
                    }
                }
                else if (m_srWizardType is SrWizardType_CifsIso)
                    AddPage(xenTabPageCifsIso);
                else if (m_srWizardType is SrWizardType_Cifs)
                    AddPage(xenTabPageCifs);
                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;
                else if (m_srWizardType is SrWizardType_LvmoIscsi)
                    xenTabPageLvmoIscsi.SrWizardType = m_srWizardType;
                else if (m_srWizardType is SrWizardType_LvmoHba)
                    xenTabPageLvmoHba.SrWizardType = m_srWizardType;
                else if (m_srWizardType is SrWizardType_Cslg || m_srWizardType is SrWizardType_NetApp || m_srWizardType is SrWizardType_EqualLogic)
                    xenTabPageCslg.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;
                else if (m_srWizardType is SrWizardType_Cifs)
                    xenTabPageCifs.SrWizardType = m_srWizardType;
                else if (m_srWizardType is SrWizardType_Fcoe)
                    xenTabPageLvmoFcoe.SrWizardType = m_srWizardType;
                #endregion
            }
            else if (senderPagetype == typeof(CIFS_ISO))
            {
                m_srWizardType.DeviceConfig = xenTabPageCifsIso.DeviceConfig;
                SetCustomDescription(m_srWizardType, xenTabPageCifsIso.SrDescription);
            }
            else if (senderPagetype == typeof(CifsFrontend))
            {
                m_srWizardType.DeviceConfig = xenTabPageCifs.DeviceConfig;
                SetCustomDescription(m_srWizardType, xenTabPageCifs.SrDescription);
            }
            else if (senderPagetype == typeof(LVMoISCSI))
            {
                xenTabPageStorageProvisioningMethod.SRSize = xenTabPageLvmoIscsi.SRSize;
                SetCustomDescription(m_srWizardType, xenTabPageLvmoIscsi.SrDescription);

                if (xenTabPageLvmoIscsi.UUID != null) //already existing SR
                {
                    xenTabPageStorageProvisioningMethod.SetControlsUsingExistingSMConfig(m_srWizardType.SMConfig);
                    xenTabPageStorageProvisioningMethod.DisableControls();
                }
                else
                {
                    xenTabPageStorageProvisioningMethod.ResetControls();
                }
            }
            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);
            }
            else if (senderPagetype == typeof(CSLG))
            {
                #region
                if (Helpers.BostonOrGreater(xenConnection))
                {
                    xenTabPageCslgLocation.SelectedStorageAdapter = xenTabPageCslg.SelectedStorageAdapter;
                    xenTabPageCslgSettings.SelectedStorageAdapter = xenTabPageCslg.SelectedStorageAdapter;
                    NotifyNextPagesOfChange(xenTabPageCslgLocation, xenTabPageCslgSettings);
                }
                else
                {
                    RemovePagesFrom(_rbac ? 4 : 3);

                    if (xenTabPageCslg.SelectedStorageSystem != null)
                    {
                        AddPages(xenTabPageCslgSettings);
                        xenTabPageCslgSettings.SystemStorage = xenTabPageCslg.SelectedStorageSystem;
                        xenTabPageCslgSettings.StoragePools = xenTabPageCslg.StoragePools;
                        NotifyNextPagesOfChange(xenTabPageCslgLocation);
                    }
                    else if (xenTabPageCslg.NetAppSelected || xenTabPageCslg.DellSelected)
                    {
                        AddPage(xenTabPageFilerDetails);
                        NotifyNextPagesOfChange(xenTabPageFilerDetails);

                        if (xenTabPageCslg.NetAppSelected)
                        {
                            if (m_srWizardType is SrWizardType_Cslg)
                            {
                                m_srWizardType = ((SrWizardType_Cslg)m_srWizardType).ToNetApp();
                                xenTabPageCslg.SrWizardType = m_srWizardType;
                            }
                            xenTabPageFilerDetails.IsNetApp = true;
                            AddPage(xenTabPageNetApp);
                        }
                        else if (xenTabPageCslg.DellSelected)
                        {
                            if (m_srWizardType is SrWizardType_Cslg)
                            {
                                m_srWizardType = ((SrWizardType_Cslg)m_srWizardType).ToEqualLogic();
                                xenTabPageCslg.SrWizardType = m_srWizardType;
                            }
                            xenTabPageFilerDetails.IsNetApp = false;
                            AddPage(xentabPageEqualLogic);
                        }
                    }
                }

                foreach (var entry in xenTabPageCslg.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
                #endregion
            }
            else if (senderPagetype == typeof(CslgLocation))
            {
                xenTabPageCslgSettings.StorageLinkCredentials = xenTabPageCslgLocation.StorageLinkCredentials;
                xenTabPageCslgSettings.SystemStorage = xenTabPageCslgLocation.SystemStorage;
                xenTabPageCslgSettings.StoragePools = xenTabPageCslgLocation.StoragePools;

                foreach (var entry in xenTabPageCslgLocation.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
                NotifyNextPagesOfChange(xenTabPageCslgSettings);
            }
            else if (senderPagetype == typeof(CslgSettings))
            {
                foreach (var entry in xenTabPageCslgSettings.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
                SetCustomDescription(m_srWizardType, xenTabPageCslgSettings.SrDescription);
            }
            else if (senderPagetype == typeof(FilerDetails))
            {
                #region
                foreach (var entry in xenTabPageFilerDetails.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;

                if (xenTabPageFilerDetails.IsNetApp)
                {
                    xenTabPageNetApp.SrScanAction = xenTabPageFilerDetails.SrScanAction;
                    xenTabPageNetApp.SrWizardType = m_srWizardType;
                    NotifyNextPagesOfChange(xenTabPageNetApp);
                }
                else
                {
                    xentabPageEqualLogic.SrScanAction = xenTabPageFilerDetails.SrScanAction;
                    xentabPageEqualLogic.SrWizardType = m_srWizardType;
                    NotifyNextPagesOfChange(xentabPageEqualLogic);
                }
                #endregion
            }
            else if (senderPagetype == typeof(NetApp))
            {
                m_srWizardType.UUID = xenTabPageNetApp.UUID;
                foreach (var entry in xenTabPageNetApp.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
                SetCustomDescription(m_srWizardType, xenTabPageNetApp.SrDescription);
            }
            else if (senderPagetype == typeof(EqualLogic))
            {
                m_srWizardType.UUID = xentabPageEqualLogic.UUID;
                foreach (var entry in xentabPageEqualLogic.DeviceConfigParts)
                    m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
                SetCustomDescription(m_srWizardType, xentabPageEqualLogic.SrDescription);
            }
            else if (senderPagetype == typeof(LVMoHBA))
            {
                xenTabPageStorageProvisioningMethod.SRSize = xenTabPageLvmoHba.SRSize;
                bool creatingNew = m_srWizardType.SrDescriptors.Any(srDescriptor => string.IsNullOrEmpty(srDescriptor.UUID));
                if (!creatingNew)
                {
                    DisablePage(xenTabPageStorageProvisioningMethod, true);
                    xenTabPageStorageProvisioningMethod.ResetControls();
                }
            }
            else if (senderPagetype == typeof(StorageProvisioning))
            {
                m_srWizardType.SMConfig = xenTabPageStorageProvisioningMethod.SMConfig;
                m_srWizardType.UUID = xenTabPageLvmoIscsi.UUID;
                m_srWizardType.DeviceConfig = xenTabPageLvmoIscsi.DeviceConfig;

            }
        }
Exemplo n.º 18
0
        protected override void UpdateWizardContent(XenTabPage page)
        {
            Type type = page.GetType();

            if (type == typeof(CrossPoolMigrateDestinationPage))
            {
                RemovePage(m_pageNetwork);
                RemovePage(m_pageTargetRbac);
                m_vmMappings = m_pageDestination.VmMappings;
                TargetConnection = m_pageDestination.Connection;
                m_pageStorage.TargetConnection = TargetConnection;
                m_pageNetwork.TargetConnection = TargetConnection;
                m_pageTransferNetwork.Connection = TargetConnection;
                ConfigureRbacPage();
                AddHostNameToWindowTitle();

                if(!IsIntraPoolMigration())
                {
                    AddAfterPage(m_pageStorage, m_pageNetwork);
                }
                //If no network mappings xapi should map the networks
                //with the same names together - ideal for intra-pool
                ClearAllNetworkMappings();
                m_pageStorage.VmMappings = m_vmMappings;
                m_pageDestination.SetDefaultTarget(m_pageDestination.ChosenItem);
            }
            else if (type == typeof(CrossPoolMigrateStoragePage))
            {
                AddHostNameToWindowTitle();
                m_vmMappings = m_pageStorage.VmMappings;
                m_pageNetwork.VmMappings = m_vmMappings;
            }
            else if (type == typeof(CrossPoolMigrateNetworkingPage))
            {
                AddHostNameToWindowTitle();
                m_vmMappings = m_pageNetwork.VmMappings;
            }
            else if (type == typeof(CrossPoolMigrateTransferNetworkPage))
            {
                AddHostNameToWindowTitle();
                string netRef = m_pageTransferNetwork.NetworkUuid.Key;
                SelectedTransferNetwork = TargetConnection.Cache.Networks.FirstOrDefault(n => n.uuid == netRef);
            }

            if (type != typeof(CrossPoolMigrateFinishPage))
                NotifyNextPagesOfChange(m_pageDestination, m_pageStorage, m_pageNetwork, m_pageTransferNetwork, m_pageFinish);
        }
Exemplo n.º 19
0
        protected override bool RunNextPagePrecheck(XenTabPage senderPage)
        {
            // if reattaching and RBAC warning page is visible, then we run the prechecks when leaving the RBAC warning page
            // otherwise, when leaving xenTabPageSrName (Ref. CA-61525)
            bool runPrechecks = _srToReattach != null && _rbac
                                    ? senderPage == xenTabPageRbacWarning
                                    : senderPage == xenTabPageSrName;

            if (runPrechecks)
            {
                if (m_srWizardType is SrWizardType_LvmoHba)
                {
                    return SetFCDevicesOnLVMoHBAPage();
                }
                if (m_srWizardType is SrWizardType_Cslg || m_srWizardType is SrWizardType_NetApp || m_srWizardType is SrWizardType_EqualLogic)
                {
                    xenTabPageCslg.SrWizardType = m_srWizardType;
                    return xenTabPageCslg.PerformStorageSystemScan();
                }
            }

            return base.RunNextPagePrecheck(senderPage);
        }
Exemplo n.º 20
0
 protected override bool RunNextPagePrecheck(XenTabPage senderPage)
 {
     if (senderPage.GetType() == typeof(Intro))
     {
         // Start HB SR scan
         // If scan finds no suitable SRs ChooseSR will show sensible text and disallow progress.
         // If scan returns false user has cancelled and we should stay on intro.
         return xenTabPageChooseSR.ScanForHeartbeatSRs();
     }
     return true;
 }
Exemplo n.º 21
0
        protected override void UpdateWizardContent(XenTabPage senderPage)
        {
            var prevPageType = senderPage.GetType();

            if (prevPageType == typeof(Page_Template))
            {
                var selectedTemplate = page_1_Template.SelectedTemplate;

                page_1b_BiosLocking.SelectedTemplate = selectedTemplate;
                page_2_Name.SelectedTemplate = selectedTemplate;
                page_3_InstallationMedia.SelectedTemplate = selectedTemplate;
                page_4_HomeServer.SelectedTemplate = selectedTemplate;
                page_5_CpuMem.SelectedTemplate = selectedTemplate;
                pageVgpu.vm = selectedTemplate;
                page_6_Storage.SelectedTemplate = selectedTemplate;
                page_7_Networking.SelectedTemplate = selectedTemplate;
                page_CloudConfigParameters.Affinity = m_affinity;
                page_CloudConfigParameters.SelectedTemplate = selectedTemplate;

                RemovePage(pageVgpu);
                gpuCapability = Helpers.ClearwaterSp1OrGreater(xenConnection) && Helpers.GpuCapability(xenConnection) && selectedTemplate.CanHaveGpu;
                if (gpuCapability)
                    AddAfterPage(page_5_CpuMem, pageVgpu);

                RemovePage(page_1b_BiosLocking);

                if (page_1_Template.CopyBiosStrings)
                {
                    // insert after template page
                    AddAfterPage(page_1_Template, page_1b_BiosLocking);

                    page_4_HomeServer.DisableStep = selectedTemplate.DefaultTemplate;
                }
                else
                {
                    if (!BlockAffinitySelection)
                        page_4_HomeServer.DisableStep = false;
                }

                // if custom template has no cd drive (must have been removed via cli) don't add one
                var noInstallMedia = Helpers.CustomWithNoDVD(selectedTemplate);

                if (selectedTemplate != null && selectedTemplate.DefaultTemplate && string.IsNullOrEmpty(selectedTemplate.InstallMethods))
                    noInstallMedia = true;

                page_3_InstallationMedia.ShowInstallationMedia = !noInstallMedia;
                page_3_InstallationMedia.DisableStep = noInstallMedia && !page_3_InstallationMedia.ShowBootParameters;

                // The user cannot set their own affinity, use the one off the template
                if (BlockAffinitySelection)
                    m_affinity = xenConnection.Resolve(selectedTemplate.affinity);

                RemovePage(page_CloudConfigParameters);
                if (selectedTemplate.TemplateType == VM.VmTemplateType.CoreOS)
                {
                    AddAfterPage(page_6_Storage, page_CloudConfigParameters);
                }
            }
            else if (prevPageType == typeof(Page_CopyBiosStrings))
            {
                if (page_1_Template.CopyBiosStrings && page_1_Template.SelectedTemplate.DefaultTemplate)
                {
                    m_affinity = page_1b_BiosLocking.CopyBiosStringsFrom;
                    page_4_HomeServer.Affinity = m_affinity;
                    page_6_Storage.Affinity = m_affinity;
                }
            }
            else if (prevPageType == typeof(Page_Name))
            {
                var selectedName = page_2_Name.SelectedName;
                page_6_Storage.SelectedName = selectedName;
                page_7_Networking.SelectedName = selectedName;
            }
            else if (prevPageType == typeof(Page_InstallationMedia))
            {
                var selectedInstallMethod = page_3_InstallationMedia.SelectedInstallMethod;
                page_4_HomeServer.SelectedCD = page_3_InstallationMedia.SelectedCD;
                page_4_HomeServer.SelectedInstallMethod = selectedInstallMethod;
                page_6_Storage.SelectedInstallMethod = selectedInstallMethod;
            }
            else if (prevPageType == typeof(Page_HomeServer))
            {
                if (!page_4_HomeServer.DisableStep)
                {
                    m_affinity = page_4_HomeServer.SelectedHomeServer;
                    page_6_Storage.Affinity = m_affinity;
                    page_CloudConfigParameters.Affinity = m_affinity;
                }
            }
            else if (prevPageType == typeof(Page_Storage))
            {
                RemovePage(page_6b_LunPerVdi);
                List<SR> srs = page_6_Storage.SelectedDisks.ConvertAll(d => xenConnection.Resolve(d.Disk.SR));
                if (srs.Any(sr => sr.HBALunPerVDI))
                {
                    page_6b_LunPerVdi.DisksToMap = page_6_Storage.SelectedDisks;
                    AddAfterPage(page_6_Storage, page_6b_LunPerVdi);
                }
            }
        }
Exemplo n.º 22
0
 protected override void UpdateWizardContent(XenTabPage senderPage)
 {
     if (senderPage.GetType() == typeof(AssignPriorities))
     {
         xenTabPageHaFinish.HeartbeatSrName = xenTabPageChooseSR.SelectedHeartbeatSR.Name;
         xenTabPageHaFinish.Ntol = xenTabPageAssignPriorities.Ntol;
         xenTabPageHaFinish.RestartPriorities = xenTabPageAssignPriorities.getCurrentSettings().Values;
     }
 }
Exemplo n.º 23
0
        /// <summary>
        /// Add the given pages to the wizard one position after the supplied page
        /// </summary>
        /// <param name="existingPage">The existing page that the new page will be placed after</param>
        /// <param name="pages">The pages to add</param>
        protected void AddAfterPage(XenTabPage existingPage, params XenTabPage[] pages)
        {
            int index = wizardProgress.Steps.IndexOf(existingPage);

            for (int i = 0; i < pages.Length; i++)
            {
                var page = pages[i];
                AddPage(page, index + 1 + i);
            }
        }
Exemplo n.º 24
0
 private void assignPriorities_StatusChanged(XenTabPage sender)
 {
     // Enable OK only when the ntol update has successfully returned (-1 indicates failure).
     // Also disable when assignPriorities is disabled => edits are disallowed (e.g. because of dead hosts)
     buttonOk.Enabled = assignPriorities.Enabled && assignPriorities.EnableNext();
 }
Exemplo n.º 25
0
        /// <summary>
        /// Insert a page into the wizard's page collection at the specified index
        /// </summary>
        /// <param name="page">The page to add</param>
        /// <param name="index">The index at which the page will be inserted</param>
        protected void AddPage(XenTabPage page, int index)
        {
            xenTabControlBody.Controls.Add(page);
            page.Dock = DockStyle.Fill;

            page.WizardContentUpdater = UpdateWizardContent;
            page.NextPagePrecheck = RunNextPagePrecheck;
            page.Connection = connection;
            page.StatusChanged += page_StatusChanged;
            if (index == -1)
                wizardProgress.Steps.Add(page);
            else
                wizardProgress.Steps.Insert(index, page);
        }
Exemplo n.º 26
0
 protected override void UpdateWizardContent(XenTabPage senderPage)
 {
     if (senderPage.GetType() == typeof(ChooseVMs))
         xenTabPageSettings.VMs = xenTabPageVMs.CheckedVMs;
 }
Exemplo n.º 27
0
 protected virtual bool RunNextPagePrecheck(XenTabPage senderPage)
 {
     return true;
 }
Exemplo n.º 28
0
        protected override void UpdateWizardContent(XenTabPage senderPage)
        {
            var prevPageType = senderPage.GetType();

            if (prevPageType == typeof(PatchingWizard_SelectPatchPage))
            {
                var updateType = PatchingWizard_SelectPatchPage.SelectedUpdateType;
                var newPatch = PatchingWizard_SelectPatchPage.SelectedNewPatch;
                var existPatch = PatchingWizard_SelectPatchPage.SelectedExistingPatch;
                var alertPatch = PatchingWizard_SelectPatchPage.SelectedUpdateAlert;

                DisablePage(PatchingWizard_PrecheckPage, updateType == UpdateType.NewOem);
                DisablePage(PatchingWizard_UploadPage, updateType == UpdateType.NewOem);

                PatchingWizard_SelectServers.SelectedUpdateType = updateType;
                PatchingWizard_SelectServers.Patch = existPatch;

                PatchingWizard_UploadPage.SelectedUpdateType = updateType;
                PatchingWizard_UploadPage.SelectedExistingPatch = existPatch;
                PatchingWizard_UploadPage.SelectedNewPatch = newPatch;
                PatchingWizard_UploadPage.SelectedUpdateAlert = alertPatch;

                PatchingWizard_ModePage.Patch = existPatch;

                PatchingWizard_PrecheckPage.Patch = existPatch;
                PatchingWizard_PatchingPage.Patch = existPatch;

                PatchingWizard_PrecheckPage.SelectedUpdateType = updateType;

                PatchingWizard_ModePage.SelectedUpdateType = updateType;

                PatchingWizard_PatchingPage.SelectedUpdateType = updateType;
                PatchingWizard_PatchingPage.SelectedNewPatch = newPatch;
            }
            else if (prevPageType == typeof(PatchingWizard_SelectServers))
            {
                var selectedServers = PatchingWizard_SelectServers.SelectedServers;

                PatchingWizard_PrecheckPage.SelectedServers = selectedServers;
                //PatchingWizard_PrecheckPage.NewUploadedPatches = PatchingWizard_SelectServers.NewUploadedPatches;

                PatchingWizard_ModePage.SelectedServers = selectedServers;

                PatchingWizard_PatchingPage.SelectedMasters = PatchingWizard_SelectServers.SelectedMasters;
                PatchingWizard_PatchingPage.SelectedServers = selectedServers;
                PatchingWizard_PatchingPage.SelectedPools = PatchingWizard_SelectServers.SelectedPools;

                PatchingWizard_UploadPage.SelectedMasters = PatchingWizard_SelectServers.SelectedMasters;
                PatchingWizard_UploadPage.SelectedServers = selectedServers;
            }
            else if (prevPageType == typeof(PatchingWizard_UploadPage))
            {
                if (PatchingWizard_SelectPatchPage.SelectedUpdateType == UpdateType.NewRetail)
                {
                    PatchingWizard_SelectPatchPage.SelectedUpdateType = UpdateType.Existing;
                    PatchingWizard_SelectPatchPage.SelectedExistingPatch = PatchingWizard_UploadPage.Patch;

                    PatchingWizard_SelectServers.SelectedUpdateType = UpdateType.Existing;
                    PatchingWizard_SelectServers.Patch = PatchingWizard_UploadPage.Patch;

                    PatchingWizard_PrecheckPage.Patch = PatchingWizard_UploadPage.Patch;

                    PatchingWizard_ModePage.Patch = PatchingWizard_UploadPage.Patch;

                    PatchingWizard_PatchingPage.Patch = PatchingWizard_UploadPage.Patch;
                }
                PatchingWizard_PatchingPage.SuppPackVdis = PatchingWizard_UploadPage.SuppPackVdis;
            }
            else if (prevPageType == typeof(PatchingWizard_ModePage))
            {
                PatchingWizard_PatchingPage.ManualTextInstructions = PatchingWizard_ModePage.ManualTextInstructions;
                PatchingWizard_PatchingPage.IsAutomaticMode = PatchingWizard_ModePage.IsAutomaticMode;
                PatchingWizard_PatchingPage.RemoveUpdateFile = PatchingWizard_ModePage.RemoveUpdateFile;
            }
            else if (prevPageType == typeof(PatchingWizard_PrecheckPage))
            {
                PatchingWizard_PatchingPage.ProblemsResolvedPreCheck = PatchingWizard_PrecheckPage.ProblemsResolvedPreCheck;
            }
        }
Exemplo n.º 29
0
 private void page_StatusChanged(XenTabPage sender)
 {
     UpdateWizard();
 }
Exemplo n.º 30
0
        protected override void UpdateWizardContent(XenTabPage senderPage)
        {
            var prevPageType = senderPage.GetType();

            if (prevPageType == typeof(NetWTypeSelect))
            {
                var oldNetworkType = m_networkType;
                m_networkType = pageNetworkType.SelectedNetworkType;//value non-null, so safe to cast further below

                RemovePagesFrom(1);

                if (m_networkType == NetworkTypes.Bonded)
                {
                    AddPage(pageBondDetails);
                }
                else
                {
                    AddPage(pageName);
                    pageName.SelectedNetworkType = (NetworkTypes)m_networkType;

                    if (oldNetworkType != m_networkType)
                        NotifyNextPagesOfChange(pageName);

                    if (m_networkType == NetworkTypes.CHIN)
                        AddPage(pageChinDetails);
                    else
                    {
                        AddPage(pageNetworkDetails);
                        pageNetworkDetails.SelectedNetworkType = (NetworkTypes)m_networkType;

                        if (oldNetworkType != m_networkType)
                            NotifyNextPagesOfChange(pageNetworkDetails);
                    }
                }
            }
        }