diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard.cs b/XenAdmin/Wizards/PatchingWizard/PatchingWizard.cs index cb9e9cdfd..96f6d0c47 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard.cs +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard.cs @@ -163,8 +163,10 @@ namespace XenAdmin.Wizards.PatchingWizard var selectedServers = PatchingWizard_SelectServers.SelectedServers; var selectedPools = PatchingWizard_SelectServers.SelectedPools; var selectedMasters = PatchingWizard_SelectServers.SelectedMasters; + var applyUpdatesToNewVersion = PatchingWizard_SelectServers.ApplyUpdatesToNewVersion; PatchingWizard_PrecheckPage.SelectedServers = selectedServers; + PatchingWizard_PrecheckPage.ApplyUpdatesToNewVersion = applyUpdatesToNewVersion; PatchingWizard_ModePage.SelectedServers = selectedServers; @@ -176,6 +178,7 @@ namespace XenAdmin.Wizards.PatchingWizard PatchingWizard_UploadPage.SelectedServers = selectedServers; PatchingWizard_AutomatedUpdatesPage.SelectedPools = selectedPools; + PatchingWizard_AutomatedUpdatesPage.ApplyUpdatesToNewVersion = applyUpdatesToNewVersion; } else if (prevPageType == typeof(PatchingWizard_UploadPage)) { diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_AutomatedUpdatesPage.cs b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_AutomatedUpdatesPage.cs index ce91e6d57..979868bdd 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_AutomatedUpdatesPage.cs +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_AutomatedUpdatesPage.cs @@ -65,6 +65,7 @@ namespace XenAdmin.Wizards.PatchingWizard public XenServerPatchAlert UpdateAlert { private get; set; } public WizardMode WizardMode { private get; set; } + public bool ApplyUpdatesToNewVersion { private get; set; } private List patchMappings = new List(); public Dictionary AllDownloadedPatches = new Dictionary(); @@ -166,7 +167,7 @@ namespace XenAdmin.Wizards.PatchingWizard bool automatedUpdatesRestricted = pool.Connection.Cache.Hosts.Any(Host.RestrictBatchHotfixApply); var us = WizardMode == WizardMode.NewVersion - ? Updates.GetUpgradeSequence(pool.Connection, UpdateAlert, !automatedUpdatesRestricted) + ? Updates.GetUpgradeSequence(pool.Connection, UpdateAlert, ApplyUpdatesToNewVersion && !automatedUpdatesRestricted) : Updates.GetUpgradeSequence(pool.Connection); Debug.Assert(us != null, "Update sequence should not be null."); diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PrecheckPage.cs b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PrecheckPage.cs index 218c7d3df..c19893e66 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PrecheckPage.cs +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_PrecheckPage.cs @@ -68,6 +68,7 @@ namespace XenAdmin.Wizards.PatchingWizard public XenServerPatchAlert UpdateAlert { private get; set; } public WizardMode WizardMode { private get; set; } + public bool ApplyUpdatesToNewVersion { private get; set; } public PatchingWizard_PrecheckPage() { @@ -396,7 +397,7 @@ namespace XenAdmin.Wizards.PatchingWizard bool automatedUpdatesRestricted = pool.Connection.Cache.Hosts.Any(Host.RestrictBatchHotfixApply); var us = WizardMode == WizardMode.NewVersion - ? Updates.GetUpgradeSequence(pool.Connection, UpdateAlert, !automatedUpdatesRestricted) + ? Updates.GetUpgradeSequence(pool.Connection, UpdateAlert, ApplyUpdatesToNewVersion && !automatedUpdatesRestricted) : Updates.GetUpgradeSequence(pool.Connection); if (us == null) diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.Designer.cs b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.Designer.cs index e5c7d33d0..8192e5beb 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.Designer.cs +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.Designer.cs @@ -34,8 +34,7 @@ namespace XenAdmin.Wizards.PatchingWizard private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PatchingWizard_SelectServers)); - this.label1 = new System.Windows.Forms.Label(); - this.buttonSelectAll = new System.Windows.Forms.Button(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.buttonClearAll = new System.Windows.Forms.Button(); this.dataGridViewHosts = new XenAdmin.Wizards.PatchingWizard.PatchingWizard_SelectServers.PatchingHostsDataGridView(); this.ColumnPoolCheckBox = new System.Windows.Forms.DataGridViewCheckBoxColumn(); @@ -43,20 +42,22 @@ namespace XenAdmin.Wizards.PatchingWizard this.ColumnPoolIconHostCheck = new System.Windows.Forms.DataGridViewImageColumn(); this.ColumnName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ColumnVersion = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.label1 = new System.Windows.Forms.Label(); + this.applyUpdatesCheckBox = new System.Windows.Forms.CheckBox(); + this.buttonSelectAll = new System.Windows.Forms.Button(); + this.tableLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewHosts)).BeginInit(); this.SuspendLayout(); // - // label1 + // tableLayoutPanel1 // - resources.ApplyResources(this.label1, "label1"); - this.label1.Name = "label1"; - // - // buttonSelectAll - // - resources.ApplyResources(this.buttonSelectAll, "buttonSelectAll"); - this.buttonSelectAll.Name = "buttonSelectAll"; - this.buttonSelectAll.UseVisualStyleBackColor = true; - this.buttonSelectAll.Click += new System.EventHandler(this.buttonSelectAll_Click); + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.buttonClearAll, 1, 2); + this.tableLayoutPanel1.Controls.Add(this.dataGridViewHosts, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.applyUpdatesCheckBox, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.buttonSelectAll, 0, 2); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; // // buttonClearAll // @@ -77,6 +78,7 @@ namespace XenAdmin.Wizards.PatchingWizard this.ColumnPoolIconHostCheck, this.ColumnName, this.ColumnVersion}); + this.tableLayoutPanel1.SetColumnSpan(this.dataGridViewHosts, 2); this.dataGridViewHosts.Name = "dataGridViewHosts"; this.dataGridViewHosts.Updating = false; // @@ -115,15 +117,36 @@ namespace XenAdmin.Wizards.PatchingWizard resources.ApplyResources(this.ColumnVersion, "ColumnVersion"); this.ColumnVersion.Name = "ColumnVersion"; // + // label1 + // + this.tableLayoutPanel1.SetColumnSpan(this.label1, 2); + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // applyUpdatesCheckBox + // + resources.ApplyResources(this.applyUpdatesCheckBox, "applyUpdatesCheckBox"); + this.applyUpdatesCheckBox.Checked = true; + this.applyUpdatesCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.tableLayoutPanel1.SetColumnSpan(this.applyUpdatesCheckBox, 2); + this.applyUpdatesCheckBox.Name = "applyUpdatesCheckBox"; + this.applyUpdatesCheckBox.UseVisualStyleBackColor = true; + // + // buttonSelectAll + // + resources.ApplyResources(this.buttonSelectAll, "buttonSelectAll"); + this.buttonSelectAll.Name = "buttonSelectAll"; + this.buttonSelectAll.UseVisualStyleBackColor = true; + this.buttonSelectAll.Click += new System.EventHandler(this.buttonSelectAll_Click); + // // PatchingWizard_SelectServers // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.Controls.Add(this.dataGridViewHosts); - this.Controls.Add(this.buttonClearAll); - this.Controls.Add(this.buttonSelectAll); - this.Controls.Add(this.label1); + this.Controls.Add(this.tableLayoutPanel1); this.Name = "PatchingWizard_SelectServers"; + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewHosts)).EndInit(); this.ResumeLayout(false); @@ -131,14 +154,16 @@ namespace XenAdmin.Wizards.PatchingWizard #endregion - private Label label1; private Button buttonSelectAll; private Button buttonClearAll; - private XenAdmin.Wizards.PatchingWizard.PatchingWizard_SelectServers.PatchingHostsDataGridView dataGridViewHosts; + private TableLayoutPanel tableLayoutPanel1; + private CheckBox applyUpdatesCheckBox; + private PatchingWizard_SelectServers.PatchingHostsDataGridView dataGridViewHosts; private DataGridViewCheckBoxColumn ColumnPoolCheckBox; private DataGridViewImageColumn ColumnExpander; private DataGridViewImageColumn ColumnPoolIconHostCheck; private DataGridViewTextBoxColumn ColumnName; private DataGridViewTextBoxColumn ColumnVersion; + private Label label1; } } diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.cs b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.cs index f2217e197..1cc4b29fa 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.cs +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.cs @@ -118,6 +118,8 @@ namespace XenAdmin.Wizards.PatchingWizard List xenConnections = ConnectionsManager.XenConnectionsCopy; xenConnections.Sort(); + int licensedPoolCount = 0; + int poolCount = 0; foreach (IXenConnection xenConnection in xenConnections) { // add pools, their members and standalone hosts @@ -131,6 +133,15 @@ namespace XenAdmin.Wizards.PatchingWizard } Host[] hosts = xenConnection.Cache.Hosts; + + if (hosts.Length > 0) + { + poolCount++; + var automatedUpdatesRestricted = hosts.Any(Host.RestrictBatchHotfixApply); //if any host is not licensed for automated updates + if (!automatedUpdatesRestricted) + licensedPoolCount++; + } + Array.Sort(hosts); foreach (Host host in hosts) { @@ -139,6 +150,18 @@ namespace XenAdmin.Wizards.PatchingWizard } } + if (WizardMode == WizardMode.NewVersion && licensedPoolCount > 0) // in NewVersion mode and at least one pool licensed for automated updates + { + applyUpdatesCheckBox.Visible = true; + applyUpdatesCheckBox.Text = poolCount == licensedPoolCount + ? Messages.PATCHINGWIZARD_SELECTSERVERPAGE_APPLY_UPDATES + : Messages.PATCHINGWIZARD_SELECTSERVERPAGE_APPLY_UPDATES_MIXED; + } + else // not in NewVersion mode or all pools unlicensed + { + applyUpdatesCheckBox.Visible = false; + } + // restore server selection SelectServers(selectedServers); } @@ -533,6 +556,14 @@ namespace XenAdmin.Wizards.PatchingWizard } } + public bool ApplyUpdatesToNewVersion + { + get + { + return applyUpdatesCheckBox.Visible && applyUpdatesCheckBox.Checked; + } + } + public UpdateType SelectedUpdateType { private get; set; } public void SelectServers(List selectedServers) diff --git a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.resx b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.resx index b03d629bd..ce0fc1298 100644 --- a/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.resx +++ b/XenAdmin/Wizards/PatchingWizard/PatchingWizard_SelectServers.resx @@ -117,65 +117,20 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Top - - - - 0, 0 - - - 608, 37 - - - 1 - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - Bottom, Left - - - 0, 382 - - - 75, 23 - - - 2 - - - &Select All - - - buttonSelectAll - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - + 2 + Bottom, Left + + NoControl + + - 81, 382 + 84, 359 75, 23 @@ -193,10 +148,10 @@ System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - $this + tableLayoutPanel1 - 1 + 0 Top, Bottom, Left, Right @@ -211,7 +166,7 @@ 16 - 16 + 5 True @@ -223,7 +178,7 @@ 16 - 16 + 5 True @@ -235,7 +190,7 @@ 16 - 16 + 5 True @@ -253,10 +208,10 @@ 67 - 0, 40 + 3, 40 - 608, 336 + 602, 313 1 @@ -268,11 +223,122 @@ XenAdmin.Wizards.PatchingWizard.PatchingWizard_SelectServers+PatchingHostsDataGridView, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - $this + tableLayoutPanel1 + 1 + + + NoControl + + + 3, 0 + + + 602, 37 + + + 1 + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + True + + + NoControl + + + 3, 388 + + + 15, 14 + + + 4 + + + applyUpdatesCheckBox + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + Bottom, Left + + + NoControl + + + 3, 359 + + + 75, 23 + + + 2 + + + &Select All + + + buttonSelectAll + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + Fill + + + 0, 0 + + + 4 + + + 608, 405 + + + 4 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 0 + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="buttonClearAll" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="dataGridViewHosts" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="applyUpdatesCheckBox" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="buttonSelectAll" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100" /><Rows Styles="AutoSize,0,Percent,100,AutoSize,0,AutoSize,0" /></TableLayoutSettings> + True diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 36aff9177..caa95ae92 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -27108,6 +27108,24 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Also apply all released updates on the new version. + /// + public static string PATCHINGWIZARD_SELECTSERVERPAGE_APPLY_UPDATES { + get { + return ResourceManager.GetString("PATCHINGWIZARD_SELECTSERVERPAGE_APPLY_UPDATES", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Also apply all released updates on the new version (only on servers licensed for automated updates). + /// + public static string PATCHINGWIZARD_SELECTSERVERPAGE_APPLY_UPDATES_MIXED { + get { + return ResourceManager.GetString("PATCHINGWIZARD_SELECTSERVERPAGE_APPLY_UPDATES_MIXED", resourceCulture); + } + } + /// /// Looks up a localized string similar to Automated updates are not supported on this [XenServer] version. /// diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index 3d31e8872..9fc625b99 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -9353,6 +9353,12 @@ However, there is not enough space to perform the repartitioning, so the current [XenServer] Updates and Supplemental Packs (*.{0}, *.iso)|*.{0};*.iso + + Also apply all released updates on the new version + + + Also apply all released updates on the new version (only on servers licensed for automated updates) + Automated updates are not supported on this [XenServer] version