diff --git a/XenAdmin/TabPages/GeneralTabPage.cs b/XenAdmin/TabPages/GeneralTabPage.cs index 34a4b3e79..f65d17ae9 100644 --- a/XenAdmin/TabPages/GeneralTabPage.cs +++ b/XenAdmin/TabPages/GeneralTabPage.cs @@ -906,10 +906,14 @@ namespace XenAdmin.TabPages PBD pbd = sr.GetPBDFor(host); if (pbd == null || !pathStatus.ContainsKey(pbd)) { - s.AddEntry(host.Name(), - pbd != null && pbd.MultipathActive() - ? Messages.MULTIPATH_ACTIVE - : Messages.MULTIPATH_NOT_ACTIVE); + if (pbd == null) + s.AddEntry(host.Name(), Messages.MULTIPATH_NOT_ACTIVE); + else if (pbd.MultipathActive()) + s.AddEntry(host.Name(), Messages.MULTIPATH_ACTIVE); + else if (sr.GetSRType(true) == SR.SRTypes.gfs2) + s.AddEntry(host.Name(), Messages.MULTIPATH_NOT_ACTIVE_GFS2, Color.Red); + else + s.AddEntry(host.Name(), Messages.MULTIPATH_NOT_ACTIVE); continue; } diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrProvisioningPage.Designer.cs b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrProvisioningPage.Designer.cs index a934e0cf7..8e752b06e 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrProvisioningPage.Designer.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrProvisioningPage.Designer.cs @@ -36,12 +36,17 @@ this.radioButtonLvm = new System.Windows.Forms.RadioButton(); this.label3 = new System.Windows.Forms.Label(); this.tableLayoutInfo = new System.Windows.Forms.TableLayoutPanel(); - this.labelWarning = new System.Windows.Forms.Label(); this.pictureBoxInfo = new System.Windows.Forms.PictureBox(); + this.labelInfo = new System.Windows.Forms.Label(); this.linkLabelPoolProperties = new System.Windows.Forms.LinkLabel(); + this.tableLayoutWarning = new System.Windows.Forms.TableLayoutPanel(); + this.pictureBoxWarning = new System.Windows.Forms.PictureBox(); + this.labelWarning = new System.Windows.Forms.Label(); this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutInfo.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxInfo)).BeginInit(); + this.tableLayoutWarning.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxWarning)).BeginInit(); this.SuspendLayout(); // // tableLayoutPanel1 @@ -53,6 +58,7 @@ this.tableLayoutPanel1.Controls.Add(this.radioButtonLvm, 0, 3); this.tableLayoutPanel1.Controls.Add(this.label3, 0, 4); this.tableLayoutPanel1.Controls.Add(this.tableLayoutInfo, 0, 5); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutWarning, 0, 6); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; // // label1 @@ -67,6 +73,7 @@ this.radioButtonGfs2.Name = "radioButtonGfs2"; this.radioButtonGfs2.TabStop = true; this.radioButtonGfs2.UseVisualStyleBackColor = true; + this.radioButtonGfs2.CheckedChanged += new System.EventHandler(this.radioButtonGfs2_CheckedChanged); // // labelGFS2 // @@ -78,6 +85,7 @@ resources.ApplyResources(this.radioButtonLvm, "radioButtonLvm"); this.radioButtonLvm.Name = "radioButtonLvm"; this.radioButtonLvm.UseVisualStyleBackColor = true; + this.radioButtonLvm.CheckedChanged += new System.EventHandler(this.radioButtonLvm_CheckedChanged); // // label3 // @@ -87,16 +95,11 @@ // tableLayoutInfo // resources.ApplyResources(this.tableLayoutInfo, "tableLayoutInfo"); - this.tableLayoutInfo.Controls.Add(this.labelWarning, 1, 0); this.tableLayoutInfo.Controls.Add(this.pictureBoxInfo, 0, 0); + this.tableLayoutInfo.Controls.Add(this.labelInfo, 1, 0); this.tableLayoutInfo.Controls.Add(this.linkLabelPoolProperties, 2, 0); this.tableLayoutInfo.Name = "tableLayoutInfo"; // - // labelWarning - // - resources.ApplyResources(this.labelWarning, "labelWarning"); - this.labelWarning.Name = "labelWarning"; - // // pictureBoxInfo // this.pictureBoxInfo.Image = global::XenAdmin.Properties.Resources._000_Info3_h32bit_16; @@ -104,6 +107,11 @@ this.pictureBoxInfo.Name = "pictureBoxInfo"; this.pictureBoxInfo.TabStop = false; // + // labelInfo + // + resources.ApplyResources(this.labelInfo, "labelInfo"); + this.labelInfo.Name = "labelInfo"; + // // linkLabelPoolProperties // resources.ApplyResources(this.linkLabelPoolProperties, "linkLabelPoolProperties"); @@ -111,6 +119,25 @@ this.linkLabelPoolProperties.TabStop = true; this.linkLabelPoolProperties.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelPoolProperties_LinkClicked); // + // tableLayoutWarning + // + resources.ApplyResources(this.tableLayoutWarning, "tableLayoutWarning"); + this.tableLayoutWarning.Controls.Add(this.pictureBoxWarning, 0, 0); + this.tableLayoutWarning.Controls.Add(this.labelWarning, 1, 0); + this.tableLayoutWarning.Name = "tableLayoutWarning"; + // + // pictureBoxWarning + // + this.pictureBoxWarning.Image = global::XenAdmin.Properties.Resources._000_WarningAlert_h32bit_32; + resources.ApplyResources(this.pictureBoxWarning, "pictureBoxWarning"); + this.pictureBoxWarning.Name = "pictureBoxWarning"; + this.pictureBoxWarning.TabStop = false; + // + // labelWarning + // + resources.ApplyResources(this.labelWarning, "labelWarning"); + this.labelWarning.Name = "labelWarning"; + // // ChooseSrProvisioningPage // resources.ApplyResources(this, "$this"); @@ -122,6 +149,9 @@ this.tableLayoutInfo.ResumeLayout(false); this.tableLayoutInfo.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxInfo)).EndInit(); + this.tableLayoutWarning.ResumeLayout(false); + this.tableLayoutWarning.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxWarning)).EndInit(); this.ResumeLayout(false); } @@ -135,8 +165,11 @@ private System.Windows.Forms.RadioButton radioButtonLvm; private System.Windows.Forms.Label label3; private System.Windows.Forms.PictureBox pictureBoxInfo; - private System.Windows.Forms.Label labelWarning; + private System.Windows.Forms.Label labelInfo; private System.Windows.Forms.TableLayoutPanel tableLayoutInfo; private System.Windows.Forms.LinkLabel linkLabelPoolProperties; + private System.Windows.Forms.TableLayoutPanel tableLayoutWarning; + private System.Windows.Forms.PictureBox pictureBoxWarning; + private System.Windows.Forms.Label labelWarning; } } diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrProvisioningPage.cs b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrProvisioningPage.cs index 55bd9ce93..900313139 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrProvisioningPage.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrProvisioningPage.cs @@ -39,33 +39,26 @@ using XenAPI; namespace XenAdmin.Wizards.NewSRWizard_Pages { public partial class ChooseSrProvisioningPage : XenTabPage - { public ChooseSrProvisioningPage() { InitializeComponent(); Cluster_CollectionChangedWithInvoke = Program.ProgramInvokeHandler(Cluster_CollectionChanged); } + private readonly CollectionChangeEventHandler Cluster_CollectionChangedWithInvoke; + #region XenTabPage overrides - public override string Text { get { return Messages.PROVISIONING; } } + public override string Text => Messages.PROVISIONING; - public override string PageTitle { get { return Messages.CHOOSE_SR_PROVISIONING_PAGE_TITLE; } } + public override string PageTitle => Messages.CHOOSE_SR_PROVISIONING_PAGE_TITLE; + + public override string HelpID => "Provisioning"; - public override string HelpID - { - get { return "Provisioning"; } - } #endregion - public bool IsGfs2 - { - get - { - return radioButtonGfs2.Checked; - } - } + public bool IsGfs2 => radioButtonGfs2.Checked; private void RefreshPage() { @@ -81,23 +74,89 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages } tableLayoutInfo.Visible = !gfs2Allowed; - labelWarning.Text = restrictGfs2 + labelInfo.Text = restrictGfs2 ? Messages.GFS2_INCORRECT_POOL_LICENSE : Messages.GFS2_REQUIRES_CLUSTERING_ENABLED; - linkLabelPoolProperties.Visible = !clusteringEnabled && !restrictGfs2; + linkLabelPoolProperties.Visible = !clusteringEnabled && !restrictGfs2; + + RefreshWarnings(); + } + + private void RefreshWarnings() + { + if (radioButtonGfs2.Checked) + { + bool disabledMultipathExists = false; + + foreach (Host host in Connection.Cache.Hosts) + { + if (!host.MultipathEnabled()) + { + disabledMultipathExists = true; + break; + } + } + + tableLayoutWarning.Visible = disabledMultipathExists; + labelWarning.Text = Connection.Cache.Hosts.Length > 1 + ? Messages.CHOOSE_SR_PROVISIONING_PAGE_MULTIPATHING_MANY + : Messages.CHOOSE_SR_PROVISIONING_PAGE_MULTIPATHING_ONE; + } + else + { + tableLayoutWarning.Visible = false; + } } protected override void PageLoadedCore(PageLoadedDirection direction) { RefreshPage(); + + foreach (var host in Connection.Cache.Hosts) + host.PropertyChanged += Host_PropertyChanged; + Connection.Cache.RegisterCollectionChanged(Cluster_CollectionChangedWithInvoke); + Connection.Cache.RegisterCollectionChanged(Host_CollectionChangedWithInvoke); } protected override void PageLeaveCore(PageLoadedDirection direction, ref bool cancel) { + foreach (var host in Connection.Cache.Hosts) + host.PropertyChanged -= Host_PropertyChanged; + Connection.Cache.DeregisterCollectionChanged(Cluster_CollectionChangedWithInvoke); + Connection.Cache.DeregisterCollectionChanged(Host_CollectionChangedWithInvoke); } + private void Cluster_CollectionChanged(object sender, CollectionChangeEventArgs e) + { + Program.AssertOnEventThread(); + RefreshPage(); + } + + private void Host_CollectionChangedWithInvoke(object sender, CollectionChangeEventArgs e) + { + Host host = e.Element as Host; + if (host == null) + return; + + if (e.Action == CollectionChangeAction.Add) + host.PropertyChanged += Host_PropertyChanged; + else if (e.Action == CollectionChangeAction.Remove) + host.PropertyChanged -= Host_PropertyChanged; + } + + private void Host_PropertyChanged(object sender, PropertyChangedEventArgs e) + { + switch (e.PropertyName) + { + case "multipathing": + RefreshWarnings(); + break; + } + } + + private void linkLabelPoolProperties_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) { var pool = Helpers.GetPoolOfOne(Connection); @@ -112,14 +171,16 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages } } - /// - /// Called when the current IXenConnection's VM dictionary changes. - /// - private void Cluster_CollectionChanged(object sender, CollectionChangeEventArgs e) + private void radioButtonGfs2_CheckedChanged(object sender, System.EventArgs e) { - Program.AssertOnEventThread(); + if (radioButtonGfs2.Checked) + RefreshWarnings(); + } - RefreshPage(); + private void radioButtonLvm_CheckedChanged(object sender, System.EventArgs e) + { + if (radioButtonLvm.Checked) + RefreshWarnings(); } } } diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrProvisioningPage.resx b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrProvisioningPage.resx index f972efdff..931fa654b 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrProvisioningPage.resx +++ b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrProvisioningPage.resx @@ -168,8 +168,11 @@ 3, 6, 3, 3 + + 3, 0, 0, 0 + - 155, 19 + 158, 19 1 @@ -234,8 +237,11 @@ 3, 6, 3, 3 + + 3, 0, 0, 0 + - 147, 19 + 150, 19 3 @@ -291,47 +297,17 @@ True + + GrowAndShrink + 3 - - True - - - Segoe UI, 9pt - - - 25, 15 - - - 0, 15, 3, 0 - - - 0, 15 - - - 6 - - - labelWarning - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutInfo - - - 0 - - 3, 15 - - - 3, 15, 3, 3 + 3, 3 - 19, 20 + 16, 16 5 @@ -346,16 +322,49 @@ tableLayoutInfo + 0 + + + Left + + + True + + + Segoe UI, 9pt + + + 25, 3 + + + 53, 15 + + + 6 + + + labelInfo + + + labelInfo + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutInfo + + 1 + + Left + True - 28, 15 - - - 0, 15, 3, 0 + 84, 4 97, 13 @@ -379,17 +388,23 @@ 2 - 3, 144 + 3, 156 + + + 3, 15, 3, 3 1 - 128, 38 + 184, 22 7 + + False + tableLayoutInfo @@ -403,7 +418,103 @@ 5 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelWarning" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="pictureBoxInfo" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="linkLabelPoolProperties" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="Percent,100" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="pictureBoxInfo" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="labelInfo" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="linkLabelPoolProperties" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + True + + + GrowAndShrink + + + 2 + + + 3, 3 + + + 32, 32 + + + 0 + + + pictureBoxWarning + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutWarning + + + 0 + + + Left, Right + + + True + + + 41, 6 + + + 496, 26 + + + 1 + + + Multipathing is not enabled on all servers of your pool. To ensure system stability, it is strongly recommended that you use multipathing for your storage connectivity. + + + labelWarning + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutWarning + + + 1 + + + Top + + + 0, 196 + + + 0, 15, 0, 0 + + + 1 + + + 540, 38 + + + 8 + + + False + + + tableLayoutWarning + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="pictureBoxWarning" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="labelWarning" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100" /><Rows Styles="Percent,100" /></TableLayoutSettings> Fill @@ -415,7 +526,7 @@ 3, 10, 3, 3 - 6 + 7 540, 336 @@ -436,7 +547,7 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="radioButtonGfs2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="labelGFS2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="radioButtonLvm" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutInfo" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,Absolute,20" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="radioButtonGfs2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="labelGFS2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="radioButtonLvm" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutInfo" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutWarning" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100" /></TableLayoutSettings> True diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index c125c0fa4..302304c08 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -7338,6 +7338,24 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Multipathing is not enabled on all servers of your pool. To ensure system stability, it is strongly recommended that you use multipathing for your storage connectivity.. + /// + public static string CHOOSE_SR_PROVISIONING_PAGE_MULTIPATHING_MANY { + get { + return ResourceManager.GetString("CHOOSE_SR_PROVISIONING_PAGE_MULTIPATHING_MANY", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multipathing is not enabled on your server. To ensure system stability, it is strongly recommended that you use multipathing for your storage connectivity.. + /// + public static string CHOOSE_SR_PROVISIONING_PAGE_MULTIPATHING_ONE { + get { + return ResourceManager.GetString("CHOOSE_SR_PROVISIONING_PAGE_MULTIPATHING_ONE", resourceCulture); + } + } + /// /// Looks up a localized string similar to Choose the provisioning method. /// @@ -23450,6 +23468,17 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Not active. + ///To ensure system stability, it is strongly recommended that you use multipathing for your storage connectivity. + ///. + /// + public static string MULTIPATH_NOT_ACTIVE_GFS2 { + get { + return ResourceManager.GetString("MULTIPATH_NOT_ACTIVE_GFS2", resourceCulture); + } + } + /// /// Looks up a localized string similar to {0} of {1} paths active. /// diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index b6782e79a..ccb4a05d5 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -2655,6 +2655,12 @@ Do you want to assign it to the schedule '{2}' instead? Choose another &destination + + Multipathing is not enabled on all servers of your pool. To ensure system stability, it is strongly recommended that you use multipathing for your storage connectivity. + + + Multipathing is not enabled on your server. To ensure system stability, it is strongly recommended that you use multipathing for your storage connectivity. + Choose the provisioning method @@ -8157,6 +8163,11 @@ Do you want to continue? Not active + + Not active. +To ensure system stability, it is strongly recommended that you use multipathing for your storage connectivity. + + {0} of {1} paths active