CP-33771: Added an item to the pool menu for triggering a secret rotation.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2020-07-08 12:59:29 +01:00
parent ce033019e1
commit 5c1a982659
13 changed files with 301 additions and 67 deletions

View File

@ -0,0 +1,99 @@
/* Copyright (c) Citrix Systems, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms,
* with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above
* copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
using System.Linq;
using XenAdmin.Actions;
using XenAdmin.Core;
using XenAdmin.Dialogs;
using XenAPI;
namespace XenAdmin.Commands
{
class RotatePoolSecretCommand : Command
{
protected override void ExecuteCore(SelectedItemCollection selection)
{
var connection = selection.GetConnectionOfFirstItem();
if (connection != null && !connection.Session.IsLocalSuperuser && !Registry.DontSudo &&
connection.Session.Roles.All(r => r.name_label != Role.MR_ROLE_POOL_ADMIN))
{
var currentRoles = connection.Session.Roles;
currentRoles.Sort();
var msg = string.Format(Messages.ROTATE_POOL_SECRET_RBAC_RESTRICTION, currentRoles[0].FriendlyName(),
Role.FriendlyName(Role.MR_ROLE_POOL_ADMIN));
using (var dlg = new ErrorDialog(msg))
dlg.ShowDialog(Parent);
return;
}
new DelegatedAsyncAction(connection, Messages.ROTATE_POOL_SECRET_TITLE,
Messages.ROTATE_POOL_SECRET_TITLE, Messages.COMPLETED,
Pool.rotate_secret, "pool.rotate_secret").RunAsync();
}
protected override bool CanExecuteCore(SelectedItemCollection selection)
{
if (selection.Any(i => !(i.XenObject is Host) && !(i.XenObject is Pool)))
return false;
var conn = selection.GetConnectionOfAllItems();
if (conn == null || !Helpers.StockholmOrGreater(conn) || conn.Cache.Hosts.Any(Host.RestrictPoolSecretRotation))
return false;
var pool = Helpers.GetPoolOfOne(conn);
return pool != null && !pool.ha_enabled && !pool.RollingUpgrade();
}
protected override string GetCantExecuteReasonCore(IXenObject item)
{
var pool = item == null ? null : Helpers.GetPoolOfOne(item.Connection);
if (pool != null)
{
if (pool.ha_enabled)
return Messages.ROTATE_POOL_SECRET_HA;
if (pool.RollingUpgrade())
return Messages.ROTATE_POOL_SECRET_RPU;
}
return base.GetCantExecuteReasonCore(item);
}
public override string MenuText => Messages.ROTATE_POOL_SECRET_MENU;
}
}

View File

@ -180,6 +180,7 @@ namespace XenAdmin
this.backupToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
this.restoreFromBackupToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
this.toolStripSeparator23 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripMenuItemInstallCertificate = new XenAdmin.Commands.CommandToolStripMenuItem();
this.maintenanceModeToolStripMenuItem1 = new XenAdmin.Commands.CommandToolStripMenuItem();
this.controlDomainMemoryToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
this.RemoveCrashdumpsToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
@ -277,12 +278,12 @@ namespace XenAdmin
this.securityGroupsToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
this.MenuPanel = new System.Windows.Forms.Panel();
this.StatusStrip = new System.Windows.Forms.StatusStrip();
this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.statusProgressBar = new System.Windows.Forms.ToolStripProgressBar();
this.toolStripMenuItemInstallCertificate = new XenAdmin.Commands.CommandToolStripMenuItem();
this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.statusLabelAlerts = new System.Windows.Forms.ToolStripStatusLabel();
this.statusLabelUpdates = new System.Windows.Forms.ToolStripStatusLabel();
this.statusLabelErrors = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripMenuItemRotateSecret = new XenAdmin.Commands.CommandToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@ -927,6 +928,7 @@ namespace XenAdmin
this.conversionToolStripMenuItem,
this.toolStripSeparator9,
this.changePoolPasswordToolStripMenuItem,
this.toolStripMenuItemRotateSecret,
this.toolStripMenuItem1,
this.deleteToolStripMenuItem,
this.toolStripSeparator26,
@ -1234,6 +1236,12 @@ namespace XenAdmin
this.toolStripSeparator23.Name = "toolStripSeparator23";
resources.ApplyResources(this.toolStripSeparator23, "toolStripSeparator23");
//
// toolStripMenuItemInstallCertificate
//
this.toolStripMenuItemInstallCertificate.Command = new XenAdmin.Commands.InstallCertificateCommand();
this.toolStripMenuItemInstallCertificate.Name = "toolStripMenuItemInstallCertificate";
resources.ApplyResources(this.toolStripMenuItemInstallCertificate, "toolStripMenuItemInstallCertificate");
//
// maintenanceModeToolStripMenuItem1
//
this.maintenanceModeToolStripMenuItem1.Command = new XenAdmin.Commands.HostMaintenanceModeCommand();
@ -1890,14 +1898,6 @@ namespace XenAdmin
this.StatusStrip.Name = "StatusStrip";
this.StatusStrip.ShowItemToolTips = true;
//
// statusLabel
//
this.statusLabel.AutoToolTip = true;
resources.ApplyResources(this.statusLabel, "statusLabel");
this.statusLabel.Name = "statusLabel";
this.statusLabel.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never;
this.statusLabel.Spring = true;
//
// statusProgressBar
//
resources.ApplyResources(this.statusProgressBar, "statusProgressBar");
@ -1905,11 +1905,13 @@ namespace XenAdmin
this.statusProgressBar.Name = "statusProgressBar";
this.statusProgressBar.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never;
//
// toolStripMenuItemInstallCertificate
// statusLabel
//
this.toolStripMenuItemInstallCertificate.Command = new XenAdmin.Commands.InstallCertificateCommand();
this.toolStripMenuItemInstallCertificate.Name = "toolStripMenuItemInstallCertificate";
resources.ApplyResources(this.toolStripMenuItemInstallCertificate, "toolStripMenuItemInstallCertificate");
this.statusLabel.AutoToolTip = true;
resources.ApplyResources(this.statusLabel, "statusLabel");
this.statusLabel.Name = "statusLabel";
this.statusLabel.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never;
this.statusLabel.Spring = true;
//
// statusLabelAlerts
//
@ -1947,6 +1949,12 @@ namespace XenAdmin
this.statusLabelErrors.VisitedLinkColor = System.Drawing.SystemColors.ControlDarkDark;
this.statusLabelErrors.Click += new System.EventHandler(this.statusLabelErrors_Click);
//
// toolStripMenuItemRotateSecret
//
this.toolStripMenuItemRotateSecret.Name = "toolStripMenuItemRotateSecret";
this.toolStripMenuItemRotateSecret.Command = new XenAdmin.Commands.RotatePoolSecretCommand();
resources.ApplyResources(this.toolStripMenuItemRotateSecret, "toolStripMenuItemRotateSecret");
//
// MainWindow
//
resources.ApplyResources(this, "$this");
@ -2222,6 +2230,7 @@ namespace XenAdmin
private System.Windows.Forms.ToolStripStatusLabel statusLabelAlerts;
private System.Windows.Forms.ToolStripStatusLabel statusLabelUpdates;
private System.Windows.Forms.ToolStripStatusLabel statusLabelErrors;
private XenAdmin.Commands.CommandToolStripMenuItem toolStripMenuItemRotateSecret;
}
}

View File

@ -1657,18 +1657,11 @@ namespace XenAdmin
sendCtrlAltDelToolStripMenuItem.Enabled = (TheTabControl.SelectedTab == TabPageConsole) && vm && ((VM)SelectionManager.Selection.First).power_state == vm_power_state.Running;
IXenConnection conn = SelectionManager.Selection.GetConnectionOfAllItems();
if (SelectionManager.Selection.Count > 0 && (Helpers.GetMaster(conn) != null) && (Helpers.FalconOrGreater(conn)))
{
assignSnapshotScheduleToolStripMenuItem.Available = true;
VMSnapshotScheduleToolStripMenuItem.Available = true;
}
else /* hide VMSS */
{
assignSnapshotScheduleToolStripMenuItem.Available = false;
VMSnapshotScheduleToolStripMenuItem.Available = false;
}
bool vmssOn = conn != null && Helpers.FalconOrGreater(conn);
assignSnapshotScheduleToolStripMenuItem.Available = vmssOn;
VMSnapshotScheduleToolStripMenuItem.Available = vmssOn;
templatesToolStripMenuItem1.Checked = Properties.Settings.Default.DefaultTemplatesVisible;
customTemplatesToolStripMenuItem.Checked = Properties.Settings.Default.UserTemplatesVisible;
localStorageToolStripMenuItem.Checked = Properties.Settings.Default.LocalSRsVisible;
@ -1677,6 +1670,9 @@ namespace XenAdmin
conversionToolStripMenuItem.Available = conn != null && conn.Cache.VMs.Any(v => v.IsConversionVM());
installToolsToolStripMenuItem.Available = SelectionManager.Selection.Any(v => !Helpers.StockholmOrGreater(v.Connection));
toolStripMenuItemInstallCertificate.Available = Helpers.StockholmOrGreater(conn);
toolStripMenuItemRotateSecret.Available = SelectionManager.Selection.Any(s =>
s.Connection != null && Helpers.StockholmOrGreater(s.Connection) &&
!s.Connection.Cache.Hosts.Any(Host.RestrictPoolSecretRotation));
}
private void xenSourceOnTheWebToolStripMenuItem_Click(object sender, EventArgs e)

View File

@ -1822,13 +1822,13 @@
<value>163, 5</value>
</metadata>
<data name="ShowToolbarMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>146, 22</value>
<value>145, 22</value>
</data>
<data name="ShowToolbarMenuItem.Text" xml:space="preserve">
<value>Show &amp;Toolbar</value>
</data>
<data name="ToolBarContextMenu.Size" type="System.Drawing.Size, System.Drawing">
<value>147, 26</value>
<value>146, 26</value>
</data>
<data name="&gt;&gt;ToolBarContextMenu.Name" xml:space="preserve">
<value>ToolBarContextMenu</value>
@ -2040,6 +2040,12 @@
<data name="changePoolPasswordToolStripMenuItem.Text" xml:space="preserve">
<value>Change Server Pass&amp;word...</value>
</data>
<data name="toolStripMenuItemRotateSecret.Size" type="System.Drawing.Size, System.Drawing">
<value>277, 22</value>
</data>
<data name="toolStripMenuItemRotateSecret.Text" xml:space="preserve">
<value>Rotate &amp;Pool Secret</value>
</data>
<data name="toolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>274, 6</value>
</data>
@ -2245,13 +2251,13 @@
<value>Remove Crash Dump &amp;Files</value>
</data>
<data name="ChangeRootPasswordToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 22</value>
<value>161, 22</value>
</data>
<data name="ChangeRootPasswordToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;Change...</value>
</data>
<data name="forgetSavedPasswordToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>180, 22</value>
<value>161, 22</value>
</data>
<data name="forgetSavedPasswordToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;Forget Password</value>
@ -2299,130 +2305,130 @@
<value>&amp;Server</value>
</data>
<data name="NewVmToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="NewVmToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;New VM...</value>
</data>
<data name="startShutdownToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="startShutdownToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;Start/Shut down</value>
</data>
<data name="resumeOnToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="resumeOnToolStripMenuItem.Text" xml:space="preserve">
<value>Res&amp;ume on Server</value>
</data>
<data name="relocateToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="relocateToolStripMenuItem.Text" xml:space="preserve">
<value>M&amp;igrate to Server</value>
</data>
<data name="startOnHostToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="startOnHostToolStripMenuItem.Text" xml:space="preserve">
<value>Start &amp;on Server</value>
</data>
<data name="toolStripSeparator20.Size" type="System.Drawing.Size, System.Drawing">
<value>240, 6</value>
<value>239, 6</value>
</data>
<data name="assignSnapshotScheduleToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="assignSnapshotScheduleToolStripMenuItem.Text" xml:space="preserve">
<value>Assign to Snaps&amp;hot Schedule...</value>
</data>
<data name="assignToVirtualApplianceToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="assignToVirtualApplianceToolStripMenuItem.Text" xml:space="preserve">
<value>Assign to &amp;vApp</value>
</data>
<data name="toolStripMenuItem9.Size" type="System.Drawing.Size, System.Drawing">
<value>240, 6</value>
<value>239, 6</value>
</data>
<data name="copyVMtoSharedStorageMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="copyVMtoSharedStorageMenuItem.Text" xml:space="preserve">
<value>&amp;Copy VM</value>
</data>
<data name="MoveVMToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="MoveVMToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;Move VM</value>
</data>
<data name="snapshotToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="snapshotToolStripMenuItem.Text" xml:space="preserve">
<value>Ta&amp;ke a Snapshot</value>
</data>
<data name="convertToTemplateToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="convertToTemplateToolStripMenuItem.Text" xml:space="preserve">
<value>Convert to &amp;Template</value>
</data>
<data name="exportToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="exportToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;Export...</value>
</data>
<data name="disableCbtToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="disableCbtToolStripMenuItem.Text" xml:space="preserve">
<value>D&amp;isable Changed Block Tracking</value>
</data>
<data name="enablePVSReadcachingToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="disablePVSReadcachingToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="toolStripMenuItem12.Size" type="System.Drawing.Size, System.Drawing">
<value>240, 6</value>
<value>239, 6</value>
</data>
<data name="installToolsToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="installToolsToolStripMenuItem.Text" xml:space="preserve">
<value>Inst&amp;all [Citrix VM Tools]</value>
</data>
<data name="sendCtrlAltDelToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="sendCtrlAltDelToolStripMenuItem.Text" xml:space="preserve">
<value>Send Ctrl+&amp;Alt+Del</value>
</data>
<data name="toolStripSeparator5.Size" type="System.Drawing.Size, System.Drawing">
<value>240, 6</value>
<value>239, 6</value>
</data>
<data name="uninstallToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="uninstallToolStripMenuItem.Text" xml:space="preserve">
<value>&amp;Delete VM</value>
</data>
<data name="toolStripSeparator10.Size" type="System.Drawing.Size, System.Drawing">
<value>240, 6</value>
<value>239, 6</value>
</data>
<data name="pluginItemsPlaceHolderToolStripMenuItem4.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="pluginItemsPlaceHolderToolStripMenuItem4.Text" xml:space="preserve">
<value>PluginItemsPlaceHolder</value>
</data>
<data name="VMPropertiesToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 22</value>
<value>242, 22</value>
</data>
<data name="VMPropertiesToolStripMenuItem.Text" xml:space="preserve">
<value>P&amp;roperties</value>
@ -2815,7 +2821,7 @@
<value>None</value>
</data>
<data name="statusLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>498, 22</value>
<value>529, 22</value>
</data>
<data name="statusLabel.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
@ -3411,6 +3417,12 @@
<data name="&gt;&gt;toolStripSeparator23.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStripMenuItemInstallCertificate.Name" xml:space="preserve">
<value>toolStripMenuItemInstallCertificate</value>
</data>
<data name="&gt;&gt;toolStripMenuItemInstallCertificate.Type" xml:space="preserve">
<value>XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;maintenanceModeToolStripMenuItem1.Name" xml:space="preserve">
<value>maintenanceModeToolStripMenuItem1</value>
</data>
@ -3975,23 +3987,17 @@
<data name="&gt;&gt;securityGroupsToolStripMenuItem.Type" xml:space="preserve">
<value>XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;statusLabel.Name" xml:space="preserve">
<value>statusLabel</value>
</data>
<data name="&gt;&gt;statusLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;statusProgressBar.Name" xml:space="preserve">
<value>statusProgressBar</value>
</data>
<data name="&gt;&gt;statusProgressBar.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripProgressBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStripMenuItemInstallCertificate.Name" xml:space="preserve">
<value>toolStripMenuItemInstallCertificate</value>
<data name="&gt;&gt;statusLabel.Name" xml:space="preserve">
<value>statusLabel</value>
</data>
<data name="&gt;&gt;toolStripMenuItemInstallCertificate.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<data name="&gt;&gt;statusLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;statusLabelAlerts.Name" xml:space="preserve">
<value>statusLabelAlerts</value>
@ -4011,6 +4017,12 @@
<data name="&gt;&gt;statusLabelErrors.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripStatusLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStripMenuItemRotateSecret.Name" xml:space="preserve">
<value>toolStripMenuItemRotateSecret</value>
</data>
<data name="&gt;&gt;toolStripMenuItemRotateSecret.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>MainWindow</value>
</data>

View File

@ -117,6 +117,7 @@
<SubType>Component</SubType>
</Compile>
<Compile Include="Commands\CrossPoolCopyVMCommand.cs" />
<Compile Include="Commands\RotatePoolSecretCommand.cs" />
<Compile Include="Commands\InstallCertificateCommand.cs" />
<Compile Include="Commands\LaunchConversionManagerCommand.cs" />
<Compile Include="Commands\CrossPoolMoveVMCommand.cs" />

View File

@ -32809,6 +32809,53 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to You cannot rotate the pool secret when HA is on..
/// </summary>
public static string ROTATE_POOL_SECRET_HA {
get {
return ResourceManager.GetString("ROTATE_POOL_SECRET_HA", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Rotate &amp;Pool Secret.
/// </summary>
public static string ROTATE_POOL_SECRET_MENU {
get {
return ResourceManager.GetString("ROTATE_POOL_SECRET_MENU", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to A {0} user does not have sufficient permissions to rotate the pool secret. Please login using an account with one of the following roles:
///
///{1}.
/// </summary>
public static string ROTATE_POOL_SECRET_RBAC_RESTRICTION {
get {
return ResourceManager.GetString("ROTATE_POOL_SECRET_RBAC_RESTRICTION", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You cannot rotate the pool secret when a Rolling Pool Upgrade is in progress..
/// </summary>
public static string ROTATE_POOL_SECRET_RPU {
get {
return ResourceManager.GetString("ROTATE_POOL_SECRET_RPU", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Rotating pool secret.
/// </summary>
public static string ROTATE_POOL_SECRET_TITLE {
get {
return ResourceManager.GetString("ROTATE_POOL_SECRET_TITLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} could be skipped..
/// </summary>

View File

@ -11385,6 +11385,23 @@ The master must be upgraded first, so if you skip the master, the rolling pool u
<data name="ROLLING_UPGRADE_WARNING_ONE" xml:space="preserve">
<value>The rolling pool upgrade process was completed with warnings.</value>
</data>
<data name="ROTATE_POOL_SECRET_HA" xml:space="preserve">
<value>You cannot rotate the pool secret when HA is on.</value>
</data>
<data name="ROTATE_POOL_SECRET_MENU" xml:space="preserve">
<value>Rotate &amp;Pool Secret</value>
</data>
<data name="ROTATE_POOL_SECRET_RBAC_RESTRICTION" xml:space="preserve">
<value>A {0} user does not have sufficient permissions to rotate the pool secret. Please login using an account with one of the following roles:
{1}</value>
</data>
<data name="ROTATE_POOL_SECRET_RPU" xml:space="preserve">
<value>You cannot rotate the pool secret when a Rolling Pool Upgrade is in progress.</value>
</data>
<data name="ROTATE_POOL_SECRET_TITLE" xml:space="preserve">
<value>Rotating pool secret</value>
</data>
<data name="RPU_WIZARD_ERROR_SKIP_MSG" xml:space="preserve">
<value>{0} could be skipped.</value>
</data>

View File

@ -308,6 +308,11 @@ namespace XenAPI
return !BoolKey(h.license_params, "enable_xha");
}
public static bool RestrictPoolSecretRotation(Host h)
{
return BoolKeyPreferTrue(h.license_params, "restrict_pool_secret_rotation");
}
public static bool RestrictAlerts(Host h)
{
return BoolKeyPreferTrue(h.license_params, "restrict_email_alerting");

View File

@ -1348,7 +1348,7 @@ namespace XenAPI {
}
/// <summary>
/// Looks up a localized string similar to The master says the server is not known to it. Perhaps the server was deleted from the master&apos;s database?.
/// Looks up a localized string similar to The master says the server is not known to it. Is the server in the master&apos;s database and pointing to the correct master? Are all servers using the same pool secret?.
/// </summary>
public static string HOST_UNKNOWN_TO_MASTER {
get {

View File

@ -553,7 +553,7 @@
<value>The server is still booting.</value>
</data>
<data name="HOST_UNKNOWN_TO_MASTER" xml:space="preserve">
<value>The master says the server is not known to it. Perhaps the server was deleted from the master's database?</value>
<value>The master says the server is not known to it. Is the server in the master's database and pointing to the correct master? Are all servers using the same pool secret?</value>
</data>
<data name="ILLEGAL_VBD_DEVICE" xml:space="preserve">
<value>The specified VBD device is not recognized: please use a non-negative integer</value>

View File

@ -1838,6 +1838,20 @@ namespace XenAPI
return Rpc<XenRef<Task>>("Async.pool.remove_from_guest_agent_config", new JArray(session, _pool ?? "", _key ?? ""), serializer);
}
public void pool_rotate_secret(string session)
{
var converters = new List<JsonConverter> {};
var serializer = CreateSerializer(converters);
Rpc("pool.rotate_secret", new JArray(session), serializer);
}
public XenRef<Task> async_pool_rotate_secret(string session)
{
var converters = new List<JsonConverter> {new XenRefConverter<Task>()};
var serializer = CreateSerializer(converters);
return Rpc<XenRef<Task>>("Async.pool.rotate_secret", new JArray(session), serializer);
}
public List<XenRef<Pool>> pool_get_all(string session)
{
var converters = new List<JsonConverter> {new XenRefListConverter<Pool>()};

View File

@ -2714,6 +2714,32 @@ namespace XenAPI
return XenRef<Task>.Create(session.XmlRpcProxy.async_pool_remove_from_guest_agent_config(session.opaque_ref, _pool ?? "", _key ?? "").parse());
}
/// <summary>
///
/// First published in Unreleased.
/// </summary>
/// <param name="session">The session</param>
public static void rotate_secret(Session session)
{
if (session.JsonRpcClient != null)
session.JsonRpcClient.pool_rotate_secret(session.opaque_ref);
else
session.XmlRpcProxy.pool_rotate_secret(session.opaque_ref).parse();
}
/// <summary>
///
/// First published in Unreleased.
/// </summary>
/// <param name="session">The session</param>
public static XenRef<Task> async_rotate_secret(Session session)
{
if (session.JsonRpcClient != null)
return session.JsonRpcClient.async_pool_rotate_secret(session.opaque_ref);
else
return XenRef<Task>.Create(session.XmlRpcProxy.async_pool_rotate_secret(session.opaque_ref).parse());
}
/// <summary>
/// Return a list of all the pools known to the system.
/// First published in XenServer 4.0.

View File

@ -1070,6 +1070,14 @@ namespace XenAPI
Response<string>
async_pool_remove_from_guest_agent_config(string session, string _pool, string _key);
[XmlRpcMethod("pool.rotate_secret")]
Response<string>
pool_rotate_secret(string session);
[XmlRpcMethod("Async.pool.rotate_secret")]
Response<string>
async_pool_rotate_secret(string session);
[XmlRpcMethod("pool.get_all")]
Response<string []>
pool_get_all(string session);