Merge pull request #3157 from kc284/feature/merge

Merge master into feature/merge
This commit is contained in:
Konstantina Chremmou 2023-06-13 15:36:09 +01:00 committed by GitHub
commit 5fb6baa0e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 2833 additions and 3443 deletions

View File

@ -88,7 +88,9 @@ namespace XenAdmin.Commands
} }
foreach (var app in appsToStart) foreach (var app in appsToStart)
(new StartApplianceAction(app, false)).RunAsync(); {
new StartApplianceAction(app, false).RunAsync();
}
} }
private bool CanStartAppliance(VM_appliance app) private bool CanStartAppliance(VM_appliance app)

View File

@ -52,6 +52,7 @@ namespace XenAdmin.Controls.Ballooning
amount = Util.CorrectRoundingErrors(amount); amount = Util.CorrectRoundingErrors(amount);
Units = static_max <= Util.BINARY_GIGA ? Messages.VAL_MEGB : Messages.VAL_GIGB; Units = static_max <= Util.BINARY_GIGA ? Messages.VAL_MEGB : Messages.VAL_GIGB;
ChangeSpinnerSettings(); ChangeSpinnerSettings();
previousUnitsValue = Units; previousUnitsValue = Units;
Initialize(amount, RoundingBehaviour.None); Initialize(amount, RoundingBehaviour.None);

View File

@ -30,6 +30,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Drawing.Imaging; using System.Drawing.Imaging;
@ -222,6 +223,7 @@ namespace XenAdmin.Controls.Ballooning
protected void DrawGrid(Graphics g, Rectangle barArea, double bytesPerPixel, double max) protected void DrawGrid(Graphics g, Rectangle barArea, double bytesPerPixel, double max)
{ {
Debug.Assert(max > 0, "Memory value should be larger than zero");
const int min_gap = 40; // min gap between consecutive labels (which are on alternate ticks) const int min_gap = 40; // min gap between consecutive labels (which are on alternate ticks)
const int line_height = 12; const int line_height = 12;
@ -236,15 +238,15 @@ namespace XenAdmin.Controls.Ballooning
int text_top = text_bottom - labelSize.Height; int text_top = text_bottom - labelSize.Height;
// Calculate a suitable increment // Calculate a suitable increment
long incr = Util.BINARY_MEGA / 2; var incr = Util.BINARY_MEGA / 2.0;
while((double)incr / bytesPerPixel * 2 < min_gap + longest) while(incr / bytesPerPixel * 2 < min_gap + longest)
incr *= 2; incr *= 2;
// Draw the grid // Draw the grid
using (Pen pen = new Pen(Grid)) using (Pen pen = new Pen(Grid))
{ {
bool withLabel = true; bool withLabel = true;
for (long x = 0; x <= max; x += incr) for (var x = 0.0; x <= max; x += incr)
{ {
// Tick // Tick
int pos = barArea.Left + (int)((double)x / bytesPerPixel); int pos = barArea.Left + (int)((double)x / bytesPerPixel);
@ -257,7 +259,7 @@ namespace XenAdmin.Controls.Ballooning
Size size = Drawing.MeasureText(g, label, Program.DefaultFont); Size size = Drawing.MeasureText(g, label, Program.DefaultFont);
Rectangle rect = new Rectangle(new Point(pos - size.Width/2, text_top), size); Rectangle rect = new Rectangle(new Point(pos - size.Width/2, text_top), size);
if (LabelShouldBeShown(max, label, x)) if (LabelShouldBeShown(max, x))
{ {
Drawing.DrawText(g, label, Program.DefaultFont, rect, Grid, Color.Transparent); Drawing.DrawText(g, label, Program.DefaultFont, rect, Grid, Color.Transparent);
} }
@ -273,10 +275,9 @@ namespace XenAdmin.Controls.Ballooning
/// 2. If the maximum is greater than 1 GB, then show only the labels that are a multiple of half a GB. /// 2. If the maximum is greater than 1 GB, then show only the labels that are a multiple of half a GB.
/// </summary> /// </summary>
/// <param name="max"></param> /// <param name="max"></param>
/// <param name="label"></param>
/// <param name="x"></param> /// <param name="x"></param>
/// <returns></returns> /// <returns></returns>
private static bool LabelShouldBeShown(double max, string label, long x) private static bool LabelShouldBeShown(double max, double x)
{ {
return max <= Util.BINARY_GIGA || (x % (0.5 * Util.BINARY_GIGA)) == 0; return max <= Util.BINARY_GIGA || (x % (0.5 * Util.BINARY_GIGA)) == 0;
} }

View File

@ -82,10 +82,11 @@ namespace XenAdmin.Core
/// <param name="f">The form to be brought to the front.</param> /// <param name="f">The form to be brought to the front.</param>
public static void BringFormToFront(Form f) public static void BringFormToFront(Form f)
{ {
if (f == null)
return;
if (f.WindowState == FormWindowState.Minimized) if (f.WindowState == FormWindowState.Minimized)
{
f.WindowState = FormWindowState.Normal; f.WindowState = FormWindowState.Normal;
}
f.BringToFront(); f.BringToFront();
f.Activate(); f.Activate();

View File

@ -172,7 +172,7 @@ namespace XenAdmin.Dialogs
{ {
conn.Hostname = server; conn.Hostname = server;
conn.Port = ConnectionsManager.DEFAULT_XEN_PORT; conn.Port = ConnectionsManager.DEFAULT_XEN_PORT;
XenConnectionUI.ConnectToXapiDatabase(conn, this); XenConnectionUI.ConnectToXapiDatabase(conn, Owner);
} }
else if (!_changedPass) else if (!_changedPass)
{ {

View File

@ -242,7 +242,7 @@ namespace XenAdmin.Dialogs
vbd.unpluggable = true; vbd.unpluggable = true;
// Try to hot plug the VBD. // Try to hot plug the VBD.
var action = new VbdSaveAndPlugAction(TheVM, vbd, TheVDI.Name(), null, false); var action = new VbdCreateAndPlugAction(TheVM, vbd, TheVDI.Name(), false);
action.ShowUserInstruction += Action_ShowUserInstruction; action.ShowUserInstruction += Action_ShowUserInstruction;
action.RunAsync(); action.RunAsync();
}); });

View File

@ -150,6 +150,7 @@ namespace XenAdmin.Dialogs
} }
SR sr = srPicker.SR; SR sr = srPicker.SR;
var actions = new List<AsyncAction>();
if (!sr.shared && _vm != null && _vm.HaPriorityIsRestart()) if (!sr.shared && _vm != null && _vm.HaPriorityIsRestart())
{ {
@ -160,32 +161,26 @@ namespace XenAdmin.Dialogs
return; return;
} }
new HAUnprotectVMAction(_vm).RunSync(_vm.Connection.Session); actions.Add(new HAUnprotectVMAction(_vm));
} }
if (_vm != null) if (_vm != null)
{ {
//note that this action alters the Device //note that this action alters the Device
var action = new CreateDiskAction(Disk, Device, _vm); actions.Add(new CreateDiskAction(Disk, Device, _vm));
using (var dialog = new ActionProgressDialog(action, ProgressBarStyle.Blocks))
dialog.ShowDialog();
if (!action.Succeeded)
return;
// Now try to plug the VBD. // Now try to plug the VBD.
var plugAction = new VbdSaveAndPlugAction(_vm, Device, Disk.Name(), _vm.Connection.Session, false); var plugAction = new VbdCreateAndPlugAction(_vm, Device, Disk.Name(), false);
plugAction.ShowUserInstruction += PlugAction_ShowUserInstruction; plugAction.ShowUserInstruction += PlugAction_ShowUserInstruction;
plugAction.RunAsync(); actions.Add(plugAction);
} }
else else
{ {
var action = new CreateDiskAction(Disk); actions.Add(new CreateDiskAction(Disk));
using (var dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee))
dialog.ShowDialog();
if (!action.Succeeded)
return;
} }
new MultipleAction(connection, "", "", "", actions, true, true, true).RunAsync();
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
Close(); Close();
} }

View File

@ -49,7 +49,7 @@ namespace XenAdmin.Dialogs
public partial class PropertiesDialog : VerticallyTabbedDialog public partial class PropertiesDialog : VerticallyTabbedDialog
{ {
#region Tabs #region Tabs
private CPUMemoryEditPage VCpuMemoryEditPage; private CpuMemoryEditPage VCpuMemoryEditPage;
private HostMultipathPage hostMultipathPage1; private HostMultipathPage hostMultipathPage1;
private CustomFieldsDisplayPage CustomFieldsEditPage; private CustomFieldsDisplayPage CustomFieldsEditPage;
private LogDestinationEditPage LogDestinationEditPage; private LogDestinationEditPage LogDestinationEditPage;
@ -84,7 +84,7 @@ namespace XenAdmin.Dialogs
private PoolAdvancedEditPage _poolAdvancedEditPage; private PoolAdvancedEditPage _poolAdvancedEditPage;
#endregion #endregion
private IXenObject xenObject, xenObjectBefore, xenObjectCopy; private readonly IXenObject _xenObjectBefore, _xenObjectCopy;
private AsyncAction _action; private AsyncAction _action;
private bool _startAction = true; private bool _startAction = true;
private System.Timers.Timer timer = new System.Timers.Timer(); private System.Timers.Timer timer = new System.Timers.Timer();
@ -99,12 +99,11 @@ namespace XenAdmin.Dialogs
InitializeComponent(); InitializeComponent();
this.xenObject = xenObject; _xenObjectBefore = xenObject;
xenObjectBefore = xenObject.Clone(); _xenObjectCopy = xenObject.Clone();
xenObjectCopy = xenObject.Clone();
Name = String.Format("Edit{0}GeneralSettingsDialog", xenObject.GetType().Name); Name = string.Format("Edit{0}GeneralSettingsDialog", xenObject.GetType().Name);
Text = String.Format(Messages.PROPERTIES_DIALOG_TITLE, Helpers.GetName(xenObject)); Text = string.Format(Messages.PROPERTIES_DIALOG_TITLE, Helpers.GetName(xenObject));
if (!Application.RenderWithVisualStyles) if (!Application.RenderWithVisualStyles)
ContentPanel.BackColor = SystemColors.Control; ContentPanel.BackColor = SystemColors.Control;
@ -116,25 +115,15 @@ namespace XenAdmin.Dialogs
{ {
var pool = Helpers.GetPoolOfOne(connection); var pool = Helpers.GetPoolOfOne(connection);
bool is_host = xenObjectCopy is Host; bool isHost = _xenObjectCopy is Host;
bool is_vm = xenObjectCopy is VM && !((VM)xenObjectCopy).is_a_snapshot; bool isVm = _xenObjectCopy is VM vm && !vm.is_a_snapshot;
bool is_sr = xenObjectCopy is SR; bool isSr = _xenObjectCopy is SR;
bool isPool = _xenObjectCopy is Pool;
bool is_pool = xenObjectCopy is Pool; bool isVdi = _xenObjectCopy is VDI;
bool is_vdi = xenObjectCopy is VDI; bool isNetwork = _xenObjectCopy is XenAPI.Network;
bool is_network = xenObjectCopy is XenAPI.Network; bool isPoolOrStandalone = isPool || (isHost && Helpers.GetPool(_xenObjectCopy.Connection) == null);
bool isVmAppliance = _xenObjectCopy is VM_appliance;
bool is_hvm = is_vm && ((VM)xenObjectCopy).IsHVM(); bool isVmss = _xenObjectCopy is VMSS;
bool is_template = is_vm && ((VM)xenObjectCopy).is_a_template;
bool is_in_pool = Helpers.GetPool(xenObjectCopy.Connection) != null;
bool is_pool_or_standalone = is_pool || (is_host && !is_in_pool);
bool wlb_enabled = (Helpers.WlbEnabledAndConfigured(xenObjectCopy.Connection));
bool is_VM_appliance = xenObjectCopy is VM_appliance;
bool is_VMSS = xenObjectCopy is VMSS;
ContentPanel.SuspendLayout(); ContentPanel.SuspendLayout();
verticalTabs.BeginUpdate(); verticalTabs.BeginUpdate();
@ -145,21 +134,21 @@ namespace XenAdmin.Dialogs
ShowTab(GeneralEditPage = new GeneralEditPage()); ShowTab(GeneralEditPage = new GeneralEditPage());
if (!is_VM_appliance) if (!isVmAppliance)
ShowTab(CustomFieldsEditPage = new CustomFieldsDisplayPage {AutoScroll = true}); ShowTab(CustomFieldsEditPage = new CustomFieldsDisplayPage {AutoScroll = true});
if (is_vm) if (isVm)
{ {
ShowTab(VCpuMemoryEditPage = new CPUMemoryEditPage()); ShowTab(VCpuMemoryEditPage = new CpuMemoryEditPage());
ShowTab(StartupOptionsEditPage = new BootOptionsEditPage()); ShowTab(StartupOptionsEditPage = new BootOptionsEditPage());
VMHAEditPage = new VMHAEditPage(); VMHAEditPage = new VMHAEditPage();
VMHAEditPage.Populated += EditPage_Populated; VMHAEditPage.Populated += EditPage_Populated;
ShowTab(VMHAEditPage); ShowTab(VMHAEditPage);
} }
if (is_vm || is_host || is_sr) if (isVm || isHost || isSr)
{ {
if (Helpers.FeatureForbidden(xenObjectCopy, Host.RestrictAlerts)) if (Helpers.FeatureForbidden(_xenObjectCopy, Host.RestrictAlerts))
{ {
PerfmonAlertUpsellEditPage = new UpsellPage PerfmonAlertUpsellEditPage = new UpsellPage
{ {
@ -176,9 +165,9 @@ namespace XenAdmin.Dialogs
} }
} }
if (is_pool_or_standalone) if (isPoolOrStandalone)
{ {
if (Helpers.FeatureForbidden(xenObjectCopy, Host.RestrictAlerts)) if (Helpers.FeatureForbidden(_xenObjectCopy, Host.RestrictAlerts))
{ {
PerfmonAlertOptionsUpsellEditPage = new UpsellPage PerfmonAlertOptionsUpsellEditPage = new UpsellPage
{ {
@ -194,84 +183,89 @@ namespace XenAdmin.Dialogs
} }
} }
if (is_host) if (isHost)
{ {
ShowTab(hostMultipathPage1 = new HostMultipathPage()); ShowTab(hostMultipathPage1 = new HostMultipathPage());
ShowTab(LogDestinationEditPage = new LogDestinationEditPage()); ShowTab(LogDestinationEditPage = new LogDestinationEditPage());
} }
if (is_host || is_pool) if (isHost || isPool)
ShowTab(HostPowerONEditPage = new HostPowerONEditPage()); ShowTab(HostPowerONEditPage = new HostPowerONEditPage());
if ((is_pool_or_standalone && Helpers.VGpuCapability(xenObjectCopy.Connection)) if ((isPoolOrStandalone && Helpers.VGpuCapability(_xenObjectCopy.Connection))
|| (is_host && ((Host)xenObjectCopy).CanEnableDisableIntegratedGpu())) || (isHost && ((Host)_xenObjectCopy).CanEnableDisableIntegratedGpu()))
{ {
ShowTab(PoolGpuEditPage = new PoolGpuEditPage()); ShowTab(PoolGpuEditPage = new PoolGpuEditPage());
} }
if (is_pool_or_standalone && !Helpers.FeatureForbidden(xenObject.Connection, Host.RestrictSslLegacySwitch) && !Helpers.StockholmOrGreater(connection)) if (isPoolOrStandalone && !Helpers.FeatureForbidden(_xenObjectCopy.Connection, Host.RestrictSslLegacySwitch) && !Helpers.StockholmOrGreater(connection))
ShowTab(SecurityEditPage = new SecurityEditPage()); ShowTab(SecurityEditPage = new SecurityEditPage());
if (is_pool_or_standalone && !Helpers.FeatureForbidden(xenObject.Connection, Host.RestrictLivePatching) && !Helpers.CloudOrGreater(connection)) if (isPoolOrStandalone && !Helpers.FeatureForbidden(_xenObjectCopy.Connection, Host.RestrictLivePatching) && !Helpers.CloudOrGreater(connection))
ShowTab(LivePatchingEditPage = new LivePatchingEditPage()); ShowTab(LivePatchingEditPage = new LivePatchingEditPage());
if (is_pool_or_standalone && !Helpers.FeatureForbidden(xenObject.Connection, Host.RestrictIGMPSnooping) && Helpers.GetCoordinator(pool).vSwitchNetworkBackend()) if (isPoolOrStandalone && !Helpers.FeatureForbidden(_xenObjectCopy.Connection, Host.RestrictIGMPSnooping) && Helpers.GetCoordinator(pool).vSwitchNetworkBackend())
ShowTab(NetworkOptionsEditPage = new NetworkOptionsEditPage()); ShowTab(NetworkOptionsEditPage = new NetworkOptionsEditPage());
if (is_pool_or_standalone && !Helpers.FeatureForbidden(xenObject.Connection, Host.RestrictCorosync)) if (isPoolOrStandalone && !Helpers.FeatureForbidden(_xenObjectCopy.Connection, Host.RestrictCorosync))
ShowTab(ClusteringEditPage = new ClusteringEditPage()); ShowTab(ClusteringEditPage = new ClusteringEditPage());
if (is_pool && Helpers.CloudOrGreater(xenObject.Connection) && Helpers.XapiEqualOrGreater_22_33_0(xenObject.Connection)) if (isPool && Helpers.CloudOrGreater(_xenObjectCopy.Connection) && Helpers.XapiEqualOrGreater_22_33_0(_xenObjectCopy.Connection))
ShowTab(_poolAdvancedEditPage = new PoolAdvancedEditPage()); ShowTab(_poolAdvancedEditPage = new PoolAdvancedEditPage());
if (is_network) if (isNetwork)
ShowTab(editNetworkPage = new EditNetworkPage()); ShowTab(editNetworkPage = new EditNetworkPage());
if (is_vm && !wlb_enabled) if (isVm)
ShowTab(HomeServerPage = new HomeServerEditPage());
if (is_vm && ((VM)xenObjectCopy).CanHaveGpu())
{ {
if (Helpers.FeatureForbidden(xenObjectCopy, Host.RestrictGpu)) var theVm = (VM)_xenObjectCopy;
if (!Helpers.WlbEnabledAndConfigured(_xenObjectCopy.Connection))
ShowTab(HomeServerPage = new HomeServerEditPage());
if (theVm.CanHaveGpu())
{ {
GpuUpsellEditPage = new UpsellPage if (Helpers.FeatureForbidden(_xenObjectCopy, Host.RestrictGpu))
{ {
Image = Images.StaticImages._000_GetMemoryInfo_h32bit_16, GpuUpsellEditPage = new UpsellPage
Text = Messages.GPU, {
BlurbText = Messages.UPSELL_BLURB_GPU Image = Images.StaticImages._000_GetMemoryInfo_h32bit_16,
}; Text = Messages.GPU,
ShowTab(GpuUpsellEditPage); BlurbText = Messages.UPSELL_BLURB_GPU
};
ShowTab(GpuUpsellEditPage);
}
else
{
if(Helpers.GpusAvailable(connection))
ShowTab(GpuEditPage = new GpuEditPage());
}
} }
else
if (theVm.IsHVM())
{ {
if(Helpers.GpusAvailable(connection)) if (!theVm.is_a_template && !Helpers.FeatureForbidden(_xenObjectCopy, Host.RestrictUsbPassthrough) &&
ShowTab(GpuEditPage = new GpuEditPage()); pool.Connection.Cache.Hosts.Any(host => host.PUSBs.Count > 0))
{
usbEditPage = new USBEditPage();
usbEditPage.Populated += EditPage_Populated;
ShowTab(usbEditPage);
}
ShowTab(VMAdvancedEditPage = new VMAdvancedEditPage());
}
if (Helpers.ContainerCapability(_xenObjectCopy.Connection))
{
if (theVm.CanBeEnlightened())
ShowTab(VMEnlightenmentEditPage = new VMEnlightenmentEditPage());
if (theVm.CanHaveCloudConfigDrive())
ShowTab(CloudConfigParametersPage = new Page_CloudConfigParameters());
} }
} }
if (is_hvm && !is_template && !Helpers.FeatureForbidden(xenObjectCopy, Host.RestrictUsbPassthrough) && if (isVmss)
pool.Connection.Cache.Hosts.Any(host => host.PUSBs.Count > 0))
{
usbEditPage = new USBEditPage();
usbEditPage.Populated += EditPage_Populated;
ShowTab(usbEditPage);
}
if (is_hvm)
{
ShowTab(VMAdvancedEditPage = new VMAdvancedEditPage());
}
if (is_vm && Helpers.ContainerCapability(xenObject.Connection))
{
if (((VM)xenObjectCopy).CanBeEnlightened())
ShowTab(VMEnlightenmentEditPage = new VMEnlightenmentEditPage());
if (((VM)xenObjectCopy).CanHaveCloudConfigDrive())
ShowTab(CloudConfigParametersPage = new Page_CloudConfigParameters());
}
if (is_VMSS)
{ {
ShowTab(newVMSSVMsPage1 = new NewVMGroupVMsPage<VMSS> {Pool = pool}); ShowTab(newVMSSVMsPage1 = new NewVMGroupVMsPage<VMSS> {Pool = pool});
ShowTab(newPolicyVMSSTypePage1 = new NewPolicySnapshotTypePage()); ShowTab(newPolicyVMSSTypePage1 = new NewPolicySnapshotTypePage());
@ -280,20 +274,20 @@ namespace XenAdmin.Dialogs
ShowTab(newPolicySnapshotFrequencyPage1); ShowTab(newPolicySnapshotFrequencyPage1);
} }
if (is_VM_appliance) if (isVmAppliance)
{ {
ShowTab(newVMApplianceVMsPage1 = new NewVMGroupVMsPage<VM_appliance> { Pool = pool }); ShowTab(newVMApplianceVMsPage1 = new NewVMGroupVMsPage<VM_appliance> { Pool = pool });
ShowTab(newVmApplianceVmOrderAndDelaysPage1 = new NewVMApplianceVMOrderAndDelaysPage { Pool = pool }); ShowTab(newVmApplianceVmOrderAndDelaysPage1 = new NewVMApplianceVMOrderAndDelaysPage { Pool = pool });
} }
if (is_sr && ((SR)xenObjectCopy).SupportsReadCaching() && !Helpers.FeatureForbidden(xenObjectCopy, Host.RestrictReadCaching)) if (isSr && ((SR)_xenObjectCopy).SupportsReadCaching() && !Helpers.FeatureForbidden(_xenObjectCopy, Host.RestrictReadCaching))
ShowTab(SrReadCachingEditPage = new SrReadCachingEditPage()); ShowTab(SrReadCachingEditPage = new SrReadCachingEditPage());
if (is_vdi) if (isVdi)
{ {
ShowTab(vdiSizeLocation = new VDISizeLocationPage()); ShowTab(vdiSizeLocation = new VDISizeLocationPage());
VDI vdi = xenObjectCopy as VDI; VDI vdi = _xenObjectCopy as VDI;
List<VBDEditPage> vbdEditPages = new List<VBDEditPage>(); List<VBDEditPage> vbdEditPages = new List<VBDEditPage>();
@ -339,7 +333,7 @@ namespace XenAdmin.Dialogs
pageAsControl.BackColor = Color.Transparent; pageAsControl.BackColor = Color.Transparent;
pageAsControl.Dock = DockStyle.Fill; pageAsControl.Dock = DockStyle.Fill;
editPage.SetXenObjects(xenObject, xenObjectCopy); editPage.SetXenObjects(_xenObjectBefore, _xenObjectCopy);
verticalTabs.Items.Add(editPage); verticalTabs.Items.Add(editPage);
} }
@ -382,12 +376,12 @@ namespace XenAdmin.Dialogs
// Must come first because some pages' SaveChanges() rely on modifying the object via the xenObjectCopy before their actions are run. // Must come first because some pages' SaveChanges() rely on modifying the object via the xenObjectCopy before their actions are run.
int index = 0; int index = 0;
if (xenObjectBefore is VMSS vmss && vmss.type != vmss_type.snapshot_with_quiesce) if (_xenObjectBefore is VMSS vmss && vmss.type != vmss_type.snapshot_with_quiesce)
index = actions.Count; index = actions.Count;
actions.Insert(index, new SaveChangesAction(xenObjectCopy, true, xenObjectBefore)); actions.Insert(index, new SaveChangesAction(_xenObjectCopy, true, _xenObjectBefore));
var objName = Helpers.GetName(xenObject).Ellipsise(50); var objName = Helpers.GetName(_xenObjectBefore).Ellipsise(50);
_action = new MultipleAction( _action = new MultipleAction(
connection, connection,
string.Format(Messages.UPDATE_PROPERTIES, objName), string.Format(Messages.UPDATE_PROPERTIES, objName),
@ -395,21 +389,21 @@ namespace XenAdmin.Dialogs
string.Format(Messages.UPDATED_PROPERTIES, objName), string.Format(Messages.UPDATED_PROPERTIES, objName),
actions); actions);
_action.SetObject(xenObjectCopy); _action.SetObject(_xenObjectCopy);
_action.Completed += action_Completed; _action.Completed += action_Completed;
Close(); Close();
if (_startAction) if (_startAction)
{ {
xenObject.Locked = true; _xenObjectBefore.Locked = true;
_action.RunAsync(); _action.RunAsync();
} }
} }
private void action_Completed(ActionBase sender) private void action_Completed(ActionBase sender)
{ {
xenObject.Locked = false; _xenObjectBefore.Locked = false;
Program.Invoke(Program.MainWindow.GeneralPage, Program.MainWindow.GeneralPage.UpdateButtons); Program.Invoke(Program.MainWindow.GeneralPage, Program.MainWindow.GeneralPage.UpdateButtons);
} }

View File

@ -35,6 +35,7 @@ using System.ComponentModel;
using System.Configuration; using System.Configuration;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security.Permissions; using System.Security.Permissions;
using System.Text; using System.Text;
@ -116,7 +117,6 @@ namespace XenAdmin
private readonly Dictionary<IXenConnection, IList<Form>> activePoolWizards = new Dictionary<IXenConnection, IList<Form>>(); private readonly Dictionary<IXenConnection, IList<Form>> activePoolWizards = new Dictionary<IXenConnection, IList<Form>>();
private string[] _commandLineArgs; private string[] _commandLineArgs;
private bool _launched;
private static readonly System.Windows.Forms.Timer CheckForUpdatesTimer = new System.Windows.Forms.Timer(); private static readonly System.Windows.Forms.Timer CheckForUpdatesTimer = new System.Windows.Forms.Timer();
@ -738,13 +738,10 @@ namespace XenAdmin
Password = args.Length > 3 ? args[3] : "" Password = args.Length > 3 ? args[3] : ""
}; };
if (ConnectionsManager.XenConnectionsContains(connection)) if (File.Exists(args[1]))
break; XenConnectionUI.ConnectToXapiDatabase(connection, this);
else
lock (ConnectionsManager.ConnectionsLock) XenConnectionUI.BeginConnect(connection, true, this, false);
ConnectionsManager.XenConnections.Add(connection);
XenConnectionUI.BeginConnect(connection, true, null, false);
break; break;
default: default:
log.Warn("CLI: Wrong syntax or unknown command line options."); log.Warn("CLI: Wrong syntax or unknown command line options.");
@ -752,14 +749,7 @@ namespace XenAdmin
} }
} }
if (_launched) HelpersGUI.BringFormToFront(this);
{
// if already running, draw the user's attention
HelpersGUI.BringFormToFront(this);
Activate();
}
_launched = true;
} }
#endregion #endregion

View File

@ -1,6 +1,6 @@
namespace XenAdmin.SettingsPanels namespace XenAdmin.SettingsPanels
{ {
partial class CPUMemoryEditPage partial class CpuMemoryEditPage
{ {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
@ -28,34 +28,36 @@ namespace XenAdmin.SettingsPanels
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CPUMemoryEditPage)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CpuMemoryEditPage));
this.lblSliderHighest = new System.Windows.Forms.Label(); this.lblSliderHighest = new System.Windows.Forms.Label();
this.lblSliderNormal = new System.Windows.Forms.Label(); this.lblSliderNormal = new System.Windows.Forms.Label();
this.lblSliderLowest = new System.Windows.Forms.Label(); this.lblSliderLowest = new System.Windows.Forms.Label();
this.lblPriority = new System.Windows.Forms.Label(); this.lblPriority = new System.Windows.Forms.Label();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.warningsTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
this.cpuWarningPictureBox = new System.Windows.Forms.PictureBox();
this.cpuWarningLabel = new System.Windows.Forms.Label();
this.topologyWarningLabel = new System.Windows.Forms.Label();
this.topologyPictureBox = new System.Windows.Forms.PictureBox();
this.comboBoxInitialVCPUs = new System.Windows.Forms.ComboBox(); this.comboBoxInitialVCPUs = new System.Windows.Forms.ComboBox();
this.labelInitialVCPUs = new System.Windows.Forms.Label(); this.labelInitialVCPUs = new System.Windows.Forms.Label();
this.labelInvalidVCPUWarning = new System.Windows.Forms.Label();
this.comboBoxTopology = new XenAdmin.Controls.CPUTopologyComboBox(); this.comboBoxTopology = new XenAdmin.Controls.CPUTopologyComboBox();
this.labelTopology = new System.Windows.Forms.Label(); this.labelTopology = new System.Windows.Forms.Label();
this.MemWarningLabel = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.lblMB = new System.Windows.Forms.Label();
this.nudMemory = new System.Windows.Forms.NumericUpDown();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.transparentTrackBar1 = new XenAdmin.Controls.TransparentTrackBar(); this.transparentTrackBar1 = new XenAdmin.Controls.TransparentTrackBar();
this.lblVCPUs = new System.Windows.Forms.Label(); this.lblVCPUs = new System.Windows.Forms.Label();
this.lblVcpuWarning = new System.Windows.Forms.LinkLabel();
this.lblMemory = new System.Windows.Forms.Label();
this.VCPUWarningLabel = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.comboBoxVCPUs = new System.Windows.Forms.ComboBox(); this.comboBoxVCPUs = new System.Windows.Forms.ComboBox();
this.initialVCPUWarningLabel = new System.Windows.Forms.Label(); this.tableLayoutPanelInfo = new System.Windows.Forms.TableLayoutPanel();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.labelInfo = new System.Windows.Forms.Label();
this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout();
this.panel2.SuspendLayout(); this.warningsTableLayoutPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudMemory)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.cpuWarningPictureBox)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.topologyPictureBox)).BeginInit();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
this.tableLayoutPanelInfo.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// lblSliderHighest // lblSliderHighest
@ -76,31 +78,60 @@ namespace XenAdmin.SettingsPanels
// lblPriority // lblPriority
// //
resources.ApplyResources(this.lblPriority, "lblPriority"); resources.ApplyResources(this.lblPriority, "lblPriority");
this.tableLayoutPanel1.SetColumnSpan(this.lblPriority, 4); this.tableLayoutPanel1.SetColumnSpan(this.lblPriority, 3);
this.lblPriority.Name = "lblPriority"; this.lblPriority.Name = "lblPriority";
// //
// tableLayoutPanel1 // tableLayoutPanel1
// //
this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent; this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
this.tableLayoutPanel1.Controls.Add(this.initialVCPUWarningLabel, 2, 6); this.tableLayoutPanel1.Controls.Add(this.warningsTableLayoutPanel, 0, 7);
this.tableLayoutPanel1.Controls.Add(this.comboBoxInitialVCPUs, 1, 6); this.tableLayoutPanel1.Controls.Add(this.comboBoxInitialVCPUs, 1, 4);
this.tableLayoutPanel1.Controls.Add(this.labelInitialVCPUs, 0, 6); this.tableLayoutPanel1.Controls.Add(this.labelInitialVCPUs, 0, 4);
this.tableLayoutPanel1.Controls.Add(this.labelInvalidVCPUWarning, 1, 5); this.tableLayoutPanel1.Controls.Add(this.comboBoxTopology, 1, 3);
this.tableLayoutPanel1.Controls.Add(this.comboBoxTopology, 1, 4); this.tableLayoutPanel1.Controls.Add(this.labelTopology, 0, 3);
this.tableLayoutPanel1.Controls.Add(this.labelTopology, 0, 4); this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 6);
this.tableLayoutPanel1.Controls.Add(this.MemWarningLabel, 3, 10); this.tableLayoutPanel1.Controls.Add(this.lblPriority, 0, 5);
this.tableLayoutPanel1.Controls.Add(this.panel2, 1, 10);
this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 9);
this.tableLayoutPanel1.Controls.Add(this.lblPriority, 0, 8);
this.tableLayoutPanel1.Controls.Add(this.lblVCPUs, 0, 2); this.tableLayoutPanel1.Controls.Add(this.lblVCPUs, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.lblVcpuWarning, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.lblMemory, 0, 10);
this.tableLayoutPanel1.Controls.Add(this.VCPUWarningLabel, 2, 2);
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.comboBoxVCPUs, 1, 2); this.tableLayoutPanel1.Controls.Add(this.comboBoxVCPUs, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanelInfo, 0, 1);
this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.Name = "tableLayoutPanel1";
// //
// warningsTableLayoutPanel
//
resources.ApplyResources(this.warningsTableLayoutPanel, "warningsTableLayoutPanel");
this.tableLayoutPanel1.SetColumnSpan(this.warningsTableLayoutPanel, 3);
this.warningsTableLayoutPanel.Controls.Add(this.cpuWarningPictureBox, 0, 0);
this.warningsTableLayoutPanel.Controls.Add(this.cpuWarningLabel, 1, 0);
this.warningsTableLayoutPanel.Controls.Add(this.topologyWarningLabel, 0, 2);
this.warningsTableLayoutPanel.Controls.Add(this.topologyPictureBox, 0, 2);
this.warningsTableLayoutPanel.Name = "warningsTableLayoutPanel";
//
// cpuWarningPictureBox
//
this.cpuWarningPictureBox.Image = global::XenAdmin.Properties.Resources._000_Alert2_h32bit_16;
resources.ApplyResources(this.cpuWarningPictureBox, "cpuWarningPictureBox");
this.cpuWarningPictureBox.Name = "cpuWarningPictureBox";
this.cpuWarningPictureBox.TabStop = false;
//
// cpuWarningLabel
//
resources.ApplyResources(this.cpuWarningLabel, "cpuWarningLabel");
this.cpuWarningLabel.Name = "cpuWarningLabel";
//
// topologyWarningLabel
//
resources.ApplyResources(this.topologyWarningLabel, "topologyWarningLabel");
this.topologyWarningLabel.Name = "topologyWarningLabel";
//
// topologyPictureBox
//
this.topologyPictureBox.Image = global::XenAdmin.Properties.Resources._000_Alert2_h32bit_16;
resources.ApplyResources(this.topologyPictureBox, "topologyPictureBox");
this.topologyPictureBox.Name = "topologyPictureBox";
this.topologyPictureBox.TabStop = false;
//
// comboBoxInitialVCPUs // comboBoxInitialVCPUs
// //
this.comboBoxInitialVCPUs.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxInitialVCPUs.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@ -114,16 +145,9 @@ namespace XenAdmin.SettingsPanels
resources.ApplyResources(this.labelInitialVCPUs, "labelInitialVCPUs"); resources.ApplyResources(this.labelInitialVCPUs, "labelInitialVCPUs");
this.labelInitialVCPUs.Name = "labelInitialVCPUs"; this.labelInitialVCPUs.Name = "labelInitialVCPUs";
// //
// labelInvalidVCPUWarning
//
resources.ApplyResources(this.labelInvalidVCPUWarning, "labelInvalidVCPUWarning");
this.tableLayoutPanel1.SetColumnSpan(this.labelInvalidVCPUWarning, 3);
this.labelInvalidVCPUWarning.ForeColor = System.Drawing.Color.Red;
this.labelInvalidVCPUWarning.Name = "labelInvalidVCPUWarning";
//
// comboBoxTopology // comboBoxTopology
// //
this.tableLayoutPanel1.SetColumnSpan(this.comboBoxTopology, 3); this.tableLayoutPanel1.SetColumnSpan(this.comboBoxTopology, 2);
this.comboBoxTopology.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxTopology.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
resources.ApplyResources(this.comboBoxTopology, "comboBoxTopology"); resources.ApplyResources(this.comboBoxTopology, "comboBoxTopology");
this.comboBoxTopology.FormattingEnabled = true; this.comboBoxTopology.FormattingEnabled = true;
@ -135,51 +159,10 @@ namespace XenAdmin.SettingsPanels
resources.ApplyResources(this.labelTopology, "labelTopology"); resources.ApplyResources(this.labelTopology, "labelTopology");
this.labelTopology.Name = "labelTopology"; this.labelTopology.Name = "labelTopology";
// //
// MemWarningLabel
//
resources.ApplyResources(this.MemWarningLabel, "MemWarningLabel");
this.MemWarningLabel.ForeColor = System.Drawing.Color.Red;
this.MemWarningLabel.Name = "MemWarningLabel";
this.tableLayoutPanel1.SetRowSpan(this.MemWarningLabel, 2);
//
// panel2
//
resources.ApplyResources(this.panel2, "panel2");
this.tableLayoutPanel1.SetColumnSpan(this.panel2, 2);
this.panel2.Controls.Add(this.lblMB);
this.panel2.Controls.Add(this.nudMemory);
this.panel2.Name = "panel2";
//
// lblMB
//
resources.ApplyResources(this.lblMB, "lblMB");
this.lblMB.Name = "lblMB";
//
// nudMemory
//
resources.ApplyResources(this.nudMemory, "nudMemory");
this.nudMemory.Maximum = new decimal(new int[] {
1048576,
0,
0,
0});
this.nudMemory.Minimum = new decimal(new int[] {
64,
0,
0,
0});
this.nudMemory.Name = "nudMemory";
this.nudMemory.Value = new decimal(new int[] {
64,
0,
0,
0});
this.nudMemory.ValueChanged += new System.EventHandler(this.nudMemory_ValueChanged);
//
// panel1 // panel1
// //
resources.ApplyResources(this.panel1, "panel1"); resources.ApplyResources(this.panel1, "panel1");
this.tableLayoutPanel1.SetColumnSpan(this.panel1, 4); this.tableLayoutPanel1.SetColumnSpan(this.panel1, 3);
this.panel1.Controls.Add(this.lblSliderHighest); this.panel1.Controls.Add(this.lblSliderHighest);
this.panel1.Controls.Add(this.lblSliderNormal); this.panel1.Controls.Add(this.lblSliderNormal);
this.panel1.Controls.Add(this.lblSliderLowest); this.panel1.Controls.Add(this.lblSliderLowest);
@ -198,32 +181,10 @@ namespace XenAdmin.SettingsPanels
resources.ApplyResources(this.lblVCPUs, "lblVCPUs"); resources.ApplyResources(this.lblVCPUs, "lblVCPUs");
this.lblVCPUs.Name = "lblVCPUs"; this.lblVCPUs.Name = "lblVCPUs";
// //
// lblVcpuWarning
//
resources.ApplyResources(this.lblVcpuWarning, "lblVcpuWarning");
this.tableLayoutPanel1.SetColumnSpan(this.lblVcpuWarning, 4);
this.lblVcpuWarning.LinkColor = System.Drawing.SystemColors.ActiveCaption;
this.lblVcpuWarning.Name = "lblVcpuWarning";
this.lblVcpuWarning.TabStop = true;
this.lblVcpuWarning.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lblVcpuWarning_LinkClicked);
//
// lblMemory
//
resources.ApplyResources(this.lblMemory, "lblMemory");
this.lblMemory.Name = "lblMemory";
//
// VCPUWarningLabel
//
resources.ApplyResources(this.VCPUWarningLabel, "VCPUWarningLabel");
this.tableLayoutPanel1.SetColumnSpan(this.VCPUWarningLabel, 2);
this.VCPUWarningLabel.ForeColor = System.Drawing.Color.Red;
this.VCPUWarningLabel.Name = "VCPUWarningLabel";
this.tableLayoutPanel1.SetRowSpan(this.VCPUWarningLabel, 2);
//
// label1 // label1
// //
resources.ApplyResources(this.label1, "label1"); resources.ApplyResources(this.label1, "label1");
this.tableLayoutPanel1.SetColumnSpan(this.label1, 4); this.tableLayoutPanel1.SetColumnSpan(this.label1, 3);
this.label1.Name = "label1"; this.label1.Name = "label1";
// //
// comboBoxVCPUs // comboBoxVCPUs
@ -234,14 +195,27 @@ namespace XenAdmin.SettingsPanels
this.comboBoxVCPUs.Name = "comboBoxVCPUs"; this.comboBoxVCPUs.Name = "comboBoxVCPUs";
this.comboBoxVCPUs.SelectedIndexChanged += new System.EventHandler(this.comboBoxVCPUs_SelectedIndexChanged); this.comboBoxVCPUs.SelectedIndexChanged += new System.EventHandler(this.comboBoxVCPUs_SelectedIndexChanged);
// //
// initialVCPUWarningLabel // tableLayoutPanelInfo
// //
resources.ApplyResources(this.initialVCPUWarningLabel, "initialVCPUWarningLabel"); resources.ApplyResources(this.tableLayoutPanelInfo, "tableLayoutPanelInfo");
this.tableLayoutPanel1.SetColumnSpan(this.initialVCPUWarningLabel, 2); this.tableLayoutPanel1.SetColumnSpan(this.tableLayoutPanelInfo, 3);
this.initialVCPUWarningLabel.ForeColor = System.Drawing.Color.Red; this.tableLayoutPanelInfo.Controls.Add(this.pictureBox1, 0, 0);
this.initialVCPUWarningLabel.Name = "initialVCPUWarningLabel"; this.tableLayoutPanelInfo.Controls.Add(this.labelInfo, 1, 0);
this.tableLayoutPanelInfo.Name = "tableLayoutPanelInfo";
// //
// CPUMemoryEditPage // pictureBox1
//
this.pictureBox1.Image = global::XenAdmin.Properties.Resources._000_Info3_h32bit_16;
resources.ApplyResources(this.pictureBox1, "pictureBox1");
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.TabStop = false;
//
// labelInfo
//
resources.ApplyResources(this.labelInfo, "labelInfo");
this.labelInfo.Name = "labelInfo";
//
// CpuMemoryEditPage
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
@ -249,14 +223,18 @@ namespace XenAdmin.SettingsPanels
this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.tableLayoutPanel1);
this.DoubleBuffered = true; this.DoubleBuffered = true;
this.ForeColor = System.Drawing.SystemColors.ControlText; this.ForeColor = System.Drawing.SystemColors.ControlText;
this.Name = "CPUMemoryEditPage"; this.Name = "CpuMemoryEditPage";
this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout(); this.tableLayoutPanel1.PerformLayout();
this.panel2.ResumeLayout(false); this.warningsTableLayoutPanel.ResumeLayout(false);
this.panel2.PerformLayout(); this.warningsTableLayoutPanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudMemory)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.cpuWarningPictureBox)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.topologyPictureBox)).EndInit();
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
this.panel1.PerformLayout(); this.panel1.PerformLayout();
this.tableLayoutPanelInfo.ResumeLayout(false);
this.tableLayoutPanelInfo.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -264,27 +242,26 @@ namespace XenAdmin.SettingsPanels
#endregion #endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.NumericUpDown nudMemory;
private System.Windows.Forms.Label lblMB;
private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label lblSliderHighest; private System.Windows.Forms.Label lblSliderHighest;
private System.Windows.Forms.Label lblSliderNormal; private System.Windows.Forms.Label lblSliderNormal;
private System.Windows.Forms.Label lblSliderLowest; private System.Windows.Forms.Label lblSliderLowest;
private System.Windows.Forms.Label lblPriority; private System.Windows.Forms.Label lblPriority;
private System.Windows.Forms.Label lblVCPUs; private System.Windows.Forms.Label lblVCPUs;
private System.Windows.Forms.Label lblMemory;
private System.Windows.Forms.LinkLabel lblVcpuWarning;
private XenAdmin.Controls.TransparentTrackBar transparentTrackBar1; private XenAdmin.Controls.TransparentTrackBar transparentTrackBar1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label VCPUWarningLabel;
private System.Windows.Forms.Label MemWarningLabel;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label labelTopology; private System.Windows.Forms.Label labelTopology;
private XenAdmin.Controls.CPUTopologyComboBox comboBoxTopology; private XenAdmin.Controls.CPUTopologyComboBox comboBoxTopology;
private System.Windows.Forms.Label labelInvalidVCPUWarning;
private System.Windows.Forms.ComboBox comboBoxVCPUs; private System.Windows.Forms.ComboBox comboBoxVCPUs;
private System.Windows.Forms.ComboBox comboBoxInitialVCPUs; private System.Windows.Forms.ComboBox comboBoxInitialVCPUs;
private System.Windows.Forms.Label labelInitialVCPUs; private System.Windows.Forms.Label labelInitialVCPUs;
private System.Windows.Forms.Label initialVCPUWarningLabel; private System.Windows.Forms.TableLayoutPanel warningsTableLayoutPanel;
private System.Windows.Forms.PictureBox cpuWarningPictureBox;
private System.Windows.Forms.Label cpuWarningLabel;
private System.Windows.Forms.Label topologyWarningLabel;
private System.Windows.Forms.PictureBox topologyPictureBox;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanelInfo;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label labelInfo;
} }
} }

View File

@ -31,541 +31,241 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Text; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using XenAdmin.Actions; using XenAdmin.Actions;
using XenAdmin.Commands;
using XenAdmin.Core; using XenAdmin.Core;
using XenAPI; using XenAPI;
using XenAdmin.Dialogs;
namespace XenAdmin.SettingsPanels namespace XenAdmin.SettingsPanels
{ {
public partial class CPUMemoryEditPage : UserControl, IEditPage public partial class CpuMemoryEditPage : UserControl, IEditPage
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod()?.DeclaringType);
private VM vm; private VM _vm;
bool ShowMemory = false; // If this VM has DMC, we don't show the memory controls on this page. private bool _validToSave = true;
private long _origVCpus;
private bool _ValidToSave = true; private long _origVCpusMax;
private decimal _OrigMemory; private long _origVCpusAtStartup;
private long _OrigVCPUs; private decimal _origVCpuWeight;
private long _OrigVCPUsMax; private decimal _currentVCpuWeight;
private long _OrigVCPUsAtStartup; private bool _isVCpuHotplugSupported;
private decimal _OrigVCPUWeight; private int _minVCpus;
private decimal _CurrentVCPUWeight; private long _prevVCpusMax;
private bool isVcpuHotplugSupported;
private int minVCPUs;
// Please note that the comboBoxVCPUs control can represent two different VM properties, depending whether the VM supports vCPU hotplug or not: // Please note that the comboBoxVCPUs control can represent two different VM properties, depending whether the VM supports vCPU hotplug or not:
// If vCPU hotplug is supported, comboBoxVCPUs represents the maximum number of vCPUs (VCPUs_max). And the initial number of vCPUs is represented in comboBoxInitialVCPUs (which is only visible in this case) // If vCPU hotplug is supported, comboBoxVCPUs represents the maximum number of vCPUs (VCPUs_max). And the initial number of vCPUs is represented in comboBoxInitialVCPUs (which is only visible in this case)
// If vCPU hotplug is not supported, comboBoxVCPUs represents the initial number of vCPUs (VCPUs_at_startup). In this case we will also set the VM property VCPUs_max to the same value. // If vCPU hotplug is not supported, comboBoxVCPUs represents the initial number of vCPUs (VCPUs_at_startup). In this case we will also set the VM property VCPUs_max to the same value.
// We use the _OrigVCPUs variable to store the original value that populates this combo box (VCPUs_max if hotplug is allowed, otherwise VCPUs_at_startup) // We use the _OrigVCPUs variable to store the original value that populates this combo box (VCPUs_max if hotplug is allowed, otherwise VCPUs_at_startup)
private ChangeMemorySettingsAction memoryAction; private bool HasVCpuChanged => _origVCpus != (long)comboBoxVCPUs.SelectedItem;
public bool ValidToSave
{
get
{
if (!_ValidToSave)
return false;
// Also confirm whether the user wants to save memory changes. private bool HasVCpuWeightChanged => _origVCpuWeight != _currentVCpuWeight;
// If not, don't close the properties dialog.
if (HasMemoryChanged)
{
long mem = Convert.ToInt64(this.nudMemory.Value * Util.BINARY_MEGA);
memoryAction = ConfirmAndCalcActions(mem);
if (memoryAction == null)
return false;
}
return true; private bool HasVCpusAtStartupChanged =>
} _isVCpuHotplugSupported && _origVCpusAtStartup != (long)comboBoxInitialVCPUs.SelectedItem;
}
private ChangeMemorySettingsAction ConfirmAndCalcActions(long mem) private bool HasTopologyChanged => _vm.GetCoresPerSocket() != comboBoxTopology.CoresPerSocket;
{
if (vm.memory_static_max / Util.BINARY_MEGA == mem / Util.BINARY_MEGA)
{
// don't want to show warning dialog just for rounding errors
mem = vm.memory_static_max;
}
else if (vm.power_state != vm_power_state.Halted)
{
var msg = vm.SupportsBallooning() && !Helpers.FeatureForbidden(vm, Host.RestrictDMC)
? Messages.CONFIRM_CHANGE_MEMORY_MAX_SINGULAR
: Messages.CONFIRM_CHANGE_MEMORY_SINGULAR;
using (var dlg = new WarningDialog(msg, private long SelectedVCpusMax => (long)comboBoxVCPUs.SelectedItem;
ThreeButtonDialog.ButtonYes, ThreeButtonDialog.ButtonNo))
{
if (dlg.ShowDialog(this) != DialogResult.Yes)
return null;
}
}
return new ChangeMemorySettingsAction(vm, private long SelectedVCpusAtStartup => _isVCpuHotplugSupported
string.Format(Messages.ACTION_CHANGE_MEMORY_SETTINGS, vm.Name()), ? (long)comboBoxInitialVCPUs.SelectedItem
vm.memory_static_min, mem, mem, mem, : (long)comboBoxVCPUs.SelectedItem;
VMOperationCommand.WarningDialogHAInvalidConfig, VMOperationCommand.StartDiagnosisForm, true);
}
public CPUMemoryEditPage()
{
InitializeComponent();
Text = Messages.CPU_AND_MEMORY;
transparentTrackBar1.Scroll += new EventHandler(tbPriority_Scroll);
this.nudMemory.TextChanged += new EventHandler(nudMemory_TextChanged);
this.nudMemory.LostFocus += new EventHandler(nudMemory_LostFocus);
}
public Image Image => Images.StaticImages._000_CPU_h32bit_16; public Image Image => Images.StaticImages._000_CPU_h32bit_16;
void nudMemory_LostFocus(object sender, EventArgs e) public string SubText => string.Format(Messages.CPU_SUB, SelectedVCpusAtStartup);
public CpuMemoryEditPage()
{ {
ValidateNud(nudMemory, (decimal)vm.memory_static_max / Util.BINARY_MEGA); InitializeComponent();
transparentTrackBar1.Scroll += tbPriority_Scroll;
Text = Messages.CPU;
} }
private void ValidateNud(NumericUpDown nud, Decimal defaultValue) private void InitializeVCpuControls()
{ {
if (!String.IsNullOrEmpty(nud.Text.Trim())) lblVCPUs.Text = _isVCpuHotplugSupported
return;
nud.Value = defaultValue >= nud.Minimum && defaultValue <= nud.Maximum ?
defaultValue : nud.Maximum;
nud.Text = nud.Value.ToString();
}
void nudMemory_TextChanged(object sender, EventArgs e)
{
decimal val;
if (decimal.TryParse(nudMemory.Text, out val))
{
if (val >= nudMemory.Minimum && val <= nudMemory.Maximum)
nudMemory_ValueChanged(null, null);
else if (val > nudMemory.Maximum)
ShowMemError(true, false);
else
ShowMemError(false, false);
}
if (this.nudMemory.Text == "")
{
_ValidToSave = false;
}
else
{
_ValidToSave = true;
}
}
private void tbPriority_Scroll(object sender, EventArgs e)
{
_CurrentVCPUWeight = Convert.ToDecimal(Math.Pow(4.0d, Convert.ToDouble(transparentTrackBar1.Value)));
if (transparentTrackBar1.Value == transparentTrackBar1.Max)
_CurrentVCPUWeight--;
}
/// <summary>
/// Must be a VM.
/// </summary>
public void SetXenObjects(IXenObject orig, IXenObject clone)
{
vm = (VM)clone;
ShowMemory = Helpers.FeatureForbidden(vm, Host.RestrictDMC);
Repopulate();
}
public void Repopulate()
{
VM vm = this.vm;
Text = ShowMemory ? Messages.CPU_AND_MEMORY : Messages.CPU;
if (!ShowMemory)
lblMemory.Visible = panel2.Visible = MemWarningLabel.Visible = false;
else if (vm.power_state != vm_power_state.Halted && vm.power_state != vm_power_state.Running)
{
panel2.Enabled = false;
MemWarningLabel.Text = Messages.MEM_NOT_WHEN_SUSPENDED;
MemWarningLabel.ForeColor = SystemColors.ControlText;
MemWarningLabel.Visible = true;
}
// Since updates come in dribs and drabs, avoid error if new max and min arrive
// out of sync and maximum < minimum.
if (vm.memory_dynamic_max >= vm.memory_dynamic_min &&
vm.memory_static_max >= vm.memory_static_min)
{
decimal min = Convert.ToDecimal(vm.memory_static_min / Util.BINARY_MEGA);
decimal max = Convert.ToDecimal(vm.MaxMemAllowed() / Util.BINARY_MEGA);
decimal value = Convert.ToDecimal(vm.memory_static_max / Util.BINARY_MEGA);
// Avoid setting the range to exclude the current value: CA-40041
if (value > max)
max = value;
if (value < min)
min = value;
this.nudMemory.Minimum = min;
this.nudMemory.Maximum = max;
this.nudMemory.Text = (this.nudMemory.Value = value).ToString();
}
Host currentHost = Helpers.GetCoordinator(this.vm.Connection);
if (currentHost != null)
{
// Show the performance warning about vCPUs > pCPUs.
// Don't show if the VM isn't running, since we don't know which server it will
// run on (and so can't count the number of pCPUs).
if ( vm.power_state == vm_power_state.Running
&& vm.VCPUs_at_startup > currentHost.host_CPUs.Count
&& !vm.GetIgnoreExcessiveVcpus())
{
lblVcpuWarning.Visible = true;
this.tableLayoutPanel1.RowStyles[1].SizeType = SizeType.Absolute;
this.tableLayoutPanel1.RowStyles[1].Height = 30;
}
else
{
lblVcpuWarning.Visible = false;
}
}
else
{
lblVcpuWarning.Visible = false;
}
isVcpuHotplugSupported = vm.SupportsVcpuHotplug();
minVCPUs = vm.MinVCPUs();
label1.Text = GetRubric();
_OrigMemory = nudMemory.Value;
_OrigVCPUsMax = vm.VCPUs_max > 0 ? vm.VCPUs_max : 1;
_OrigVCPUsAtStartup = vm.VCPUs_at_startup > 0 ? vm.VCPUs_at_startup : 1;
_OrigVCPUWeight = _CurrentVCPUWeight;
_OrigVCPUs = isVcpuHotplugSupported ? _OrigVCPUsMax : _OrigVCPUsAtStartup;
_prevVCPUsMax = _OrigVCPUsMax; // we use variable in RefreshCurrentVCPUs for checking if VcpusAtStartup and VcpusMax were equal before VcpusMax changed
_CurrentVCPUWeight = Convert.ToDecimal(vm.GetVcpuWeight());
InitializeVcpuControls();
_ValidToSave = true;
}
private void InitializeVcpuControls()
{
lblVCPUs.Text = isVcpuHotplugSupported
? Messages.VM_CPUMEMPAGE_MAX_VCPUS_LABEL ? Messages.VM_CPUMEMPAGE_MAX_VCPUS_LABEL
: Messages.VM_CPUMEMPAGE_VCPUS_LABEL; : Messages.VM_CPUMEMPAGE_VCPUS_LABEL;
labelInitialVCPUs.Text = vm.power_state == vm_power_state.Halted labelInitialVCPUs.Text = _vm.power_state == vm_power_state.Halted
? Messages.VM_CPUMEMPAGE_INITIAL_VCPUS_LABEL ? Messages.VM_CPUMEMPAGE_INITIAL_VCPUS_LABEL
: Messages.VM_CPUMEMPAGE_CURRENT_VCPUS_LABEL; : Messages.VM_CPUMEMPAGE_CURRENT_VCPUS_LABEL;
labelInitialVCPUs.Visible = comboBoxInitialVCPUs.Visible = isVcpuHotplugSupported;
comboBoxInitialVCPUs.Enabled = isVcpuHotplugSupported &&
(vm.power_state == vm_power_state.Halted ||
vm.power_state == vm_power_state.Running);
comboBoxVCPUs.Enabled = comboBoxTopology.Enabled = vm.power_state == vm_power_state.Halted; labelInitialVCPUs.Visible = comboBoxInitialVCPUs.Visible = _isVCpuHotplugSupported;
comboBoxInitialVCPUs.Enabled = _isVCpuHotplugSupported &&
(_vm.power_state == vm_power_state.Halted ||
_vm.power_state == vm_power_state.Running);
comboBoxTopology.Populate(vm.VCPUs_at_startup, vm.VCPUs_max, vm.GetCoresPerSocket(), vm.MaxCoresPerSocket()); comboBoxVCPUs.Enabled = comboBoxTopology.Enabled = _vm.power_state == vm_power_state.Halted;
comboBoxTopology.Populate(_vm.VCPUs_at_startup, _vm.VCPUs_max, _vm.GetCoresPerSocket(),
_vm.MaxCoresPerSocket());
// CA-12941 // CA-12941
// We set a sensible maximum based on the template, but if the user sets something higher // We set a sensible maximum based on the template, but if the user sets something higher
// from the CLI then use that as the maximum. // from the CLI then use that as the maximum.
var maxAllowed = vm.MaxVCPUsAllowed(); var maxAllowed = _vm.MaxVCPUsAllowed();
long maxVCPUs = maxAllowed < _OrigVCPUs ? _OrigVCPUs : maxAllowed; var maxVCpus = maxAllowed < _origVCpus ? _origVCpus : maxAllowed;
PopulateVCPUs(maxVCPUs, _OrigVCPUs); PopulateVCpus(maxVCpus, _origVCpus);
if (isVcpuHotplugSupported) if (_isVCpuHotplugSupported)
PopulateVCPUsAtStartup(_OrigVCPUsMax, _OrigVCPUsAtStartup); PopulateVCpusAtStartup(_origVCpusMax, _origVCpusAtStartup);
transparentTrackBar1.Value = Convert.ToInt32(Math.Log(Convert.ToDouble(vm.GetVcpuWeight())) / Math.Log(4.0d)); transparentTrackBar1.Value =
panel1.Enabled = vm.power_state == vm_power_state.Halted; Convert.ToInt32(Math.Log(Convert.ToDouble(_vm.GetVcpuWeight())) / Math.Log(4.0d));
panel1.Enabled = _vm.power_state == vm_power_state.Halted;
} }
private void PopulateVCPUComboBox(ComboBox comboBox, long min, long max, long currentValue, Predicate<long> isValid) private void Repopulate()
{
var vm = _vm;
_isVCpuHotplugSupported = vm.SupportsVcpuHotplug();
_minVCpus = vm.MinVCPUs();
label1.Text = Messages.VM_CPUMEMPAGE_RUBRIC;
if (_isVCpuHotplugSupported)
label1.Text += Messages.VM_CPUMEMPAGE_RUBRIC_HOTPLUG;
if (_vm.power_state != vm_power_state.Halted)
{
if (_isVCpuHotplugSupported)
{
labelInfo.Text = Messages.VM_CPUMEMPAGE_MAX_VCPUS_READONLY;
if (_vm.power_state != vm_power_state.Running)
labelInfo.Text += Messages.VM_CPUMEMPAGE_CURRENT_VCPUS_READONLY;
}
else
{
labelInfo.Text = Messages.VCPU_ONLY_WHEN_HALTED;
}
tableLayoutPanelInfo.Visible = true;
}
else
{
tableLayoutPanelInfo.Visible = false;
}
_origVCpusMax = vm.VCPUs_max > 0 ? vm.VCPUs_max : 1;
_origVCpusAtStartup = vm.VCPUs_at_startup > 0 ? vm.VCPUs_at_startup : 1;
_origVCpuWeight = _currentVCpuWeight;
_origVCpus = _isVCpuHotplugSupported ? _origVCpusMax : _origVCpusAtStartup;
_prevVCpusMax = _origVCpusMax; // we use variable in RefreshCurrentVCPUs for checking if VcpusAtStartup and VcpusMax were equal before VcpusMax changed
_currentVCpuWeight = Convert.ToDecimal(vm.GetVcpuWeight());
InitializeVCpuControls();
_validToSave = true;
}
private void PopulateVCpuComboBox(ComboBox comboBox, long min, long max, long currentValue,
Predicate<long> isValid)
{ {
comboBox.BeginUpdate(); comboBox.BeginUpdate();
comboBox.Items.Clear(); comboBox.Items.Clear();
for (long i = min; i <= max; ++i) for (var i = min; i <= max; ++i)
{ {
if (i == currentValue || isValid(i)) if (i == currentValue || isValid(i))
comboBox.Items.Add(i); comboBox.Items.Add(i);
} }
if (currentValue > max) if (currentValue > max)
comboBox.Items.Add(currentValue); comboBox.Items.Add(currentValue);
comboBox.SelectedItem = currentValue; comboBox.SelectedItem = currentValue;
comboBox.EndUpdate(); comboBox.EndUpdate();
} }
private void PopulateVCPUs(long maxVCPUs, long currentVCPUs) private void PopulateVCpus(long maxVCpus, long currentVCpus)
{ {
PopulateVCPUComboBox(comboBoxVCPUs, 1, maxVCPUs, currentVCPUs, i => comboBoxTopology.IsValidVCPU(i)); PopulateVCpuComboBox(comboBoxVCPUs, 1, maxVCpus, currentVCpus, i => comboBoxTopology.IsValidVCPU(i));
} }
private void PopulateVCPUsAtStartup(long max, long currentValue) private void PopulateVCpusAtStartup(long max, long currentValue)
{ {
long min = vm.power_state == vm_power_state.Halted ? 1 : _OrigVCPUsAtStartup; var min = _vm.power_state == vm_power_state.Halted ? 1 : _origVCpusAtStartup;
PopulateVCPUComboBox(comboBoxInitialVCPUs, min, max, currentValue, i => true); PopulateVCpuComboBox(comboBoxInitialVCPUs, min, max, currentValue, i => true);
} }
private string GetRubric() private void ShowCpuWarnings(IReadOnlyCollection<string> warnings)
{ {
StringBuilder sb = new StringBuilder(); var show = warnings.Count > 0;
sb.Append(Messages.VM_CPUMEMPAGE_RUBRIC); cpuWarningLabel.Text = show ? string.Join($"{Environment.NewLine}{Environment.NewLine}", warnings) : null;
// add hotplug text cpuWarningPictureBox.Visible = cpuWarningLabel.Visible = show;
if (isVcpuHotplugSupported)
sb.Append(Messages.VM_CPUMEMPAGE_RUBRIC_HOTPLUG);
// add power state warning
if (vm.power_state != vm_power_state.Halted)
{
sb.AppendLine();
sb.AppendLine();
sb.Append(isVcpuHotplugSupported ? Messages.VM_CPUMEMPAGE_MAX_VCPUS_READONLY : Messages.VCPU_ONLY_WHEN_HALTED);
}
// add power state warning for Current number of vCPUs
if (isVcpuHotplugSupported && vm.power_state != vm_power_state.Halted && vm.power_state != vm_power_state.Running)
{
sb.Append(Messages.VM_CPUMEMPAGE_CURRENT_VCPUS_READONLY);
}
return sb.ToString();
} }
public bool HasChanged private void ShowTopologyWarnings(IReadOnlyCollection<string> warnings)
{ {
get { return HasVCPUChanged || HasMemoryChanged || HasTopologyChanged || HasVCPUsAtStartupChanged || HasVCPUWeightChanged; } var show = warnings.Count > 0;
topologyWarningLabel.Text = show ? string.Join($"{Environment.NewLine}{Environment.NewLine}", warnings) : null;
topologyPictureBox.Visible = topologyWarningLabel.Visible = show;
} }
private bool HasMemoryChanged private void ValidateVCpuSettings()
{ {
get if (_vm == null || !comboBoxVCPUs.Enabled)
{
return _OrigMemory != nudMemory.Value;
}
}
private bool HasVCPUChanged
{
get
{
return _OrigVCPUs != (long)comboBoxVCPUs.SelectedItem;
}
}
private bool HasVCPUWeightChanged
{
get
{
return _OrigVCPUWeight != _CurrentVCPUWeight;
}
}
private bool HasVCPUsAtStartupChanged
{
get
{
return isVcpuHotplugSupported && _OrigVCPUsAtStartup != (long)comboBoxInitialVCPUs.SelectedItem;
}
}
private bool HasTopologyChanged
{
get
{
return vm.GetCoresPerSocket() != comboBoxTopology.CoresPerSocket;
}
}
private long SelectedVcpusMax
{
get
{
return (long)comboBoxVCPUs.SelectedItem;
}
}
private long SelectedVcpusAtStartup
{
get
{
return isVcpuHotplugSupported ? (long)comboBoxInitialVCPUs.SelectedItem : (long)comboBoxVCPUs.SelectedItem;
}
}
public AsyncAction SaveSettings()
{
List<AsyncAction> actions = new List<AsyncAction>();
if (HasVCPUWeightChanged)
{
vm.SetVcpuWeight(Convert.ToInt32(_CurrentVCPUWeight));
}
if (HasVCPUChanged || HasVCPUsAtStartupChanged)
{
actions.Add(new ChangeVCPUSettingsAction(vm, SelectedVcpusMax, SelectedVcpusAtStartup));
}
if (HasTopologyChanged)
{
vm.SetCoresPerSocket(comboBoxTopology.CoresPerSocket);
}
if (HasMemoryChanged)
{
actions.Add(memoryAction); // Calculated in ValidToSave
}
if (actions.Count == 0)
return null;
else if (actions.Count == 1)
return actions[0];
else
{
MultipleAction multipleAction = new MultipleAction(vm.Connection, "", "", "", actions, true);
return multipleAction;
}
}
/** Show local validation balloon tooltips */
public void ShowLocalValidationMessages() { }
public void HideLocalValidationMessages() { }
/** Unregister listeners, dispose balloon tooltips, etc. */
public void Cleanup() { }
/// <summary>
/// Shows the warning dialog about vCPUs > pCPUs.
/// </summary>
private void lblVcpuWarning_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (vm == null)
{
System.Diagnostics.Trace.Assert(false, "Selected object should be a vm");
return;
}
using (var dialog = new WarningDialog(Messages.VCPUS_MORE_THAN_PCPUS)
{
ShowCheckbox = true,
CheckboxCaption = Messages.DO_NOT_SHOW_THIS_MESSAGE
})
{
dialog.ShowDialog(this);
if (dialog.IsCheckBoxChecked)
{
// User clicked 'ignore': set flag in VM.
log.DebugFormat("Setting IgnoreExcessiveVcpus flag to true for VM {0}", vm.Name());
VM copyVm = (VM)vm.Clone();
copyVm.SetIgnoreExcessiveVcpus(true);
try
{
vm.Locked = true;
copyVm.SaveChanges(vm.Connection.Session);
}
finally
{
vm.Locked = false;
}
}
else if (Program.MainWindow.SelectObjectInTree(vm))
{
Program.MainWindow.SwitchToTab(MainWindow.Tab.General);
}
}
Refresh();
}
private void nudMemory_ValueChanged(object sender, EventArgs e)
{
ShowMemError(false, true);
}
private void ShowMemError(bool showAlways, bool testValue)
{
if (vm == null || !ShowMemory)
return; return;
Host selectedAffinity = vm.Connection.Resolve<Host>(vm.power_state == vm_power_state.Running ? vm.resident_on : vm.affinity); var homeHost = _vm.Home();
if (selectedAffinity != null) var maxPhysicalCpus = _vm.Connection.Cache.Hosts.Select(h => h.host_CPUs.Count).Max();
var homeHostPhysicalCpus = homeHost?.host_CPUs.Count;
var warnings = new List<string>();
if (comboBoxVCPUs.SelectedItem != null && maxPhysicalCpus < SelectedVCpusMax)
{ {
Host_metrics host_metrics = vm.Connection.Resolve<Host_metrics>(selectedAffinity.metrics); if (homeHostPhysicalCpus != null && homeHostPhysicalCpus < SelectedVCpusMax &&
if ((showAlways || (testValue && (host_metrics != null && (double)host_metrics.memory_total < (double)nudMemory.Value * (double)Util.BINARY_MEGA)))) maxPhysicalCpus >= SelectedVCpusMax)
{ {
MemWarningLabel.Visible = true; warnings.Add(Messages.VM_CPUMEMPAGE_VCPU_HOME_HOST_WARNING);
} }
else else if (maxPhysicalCpus < SelectedVCpusMax)
{ {
MemWarningLabel.Visible = false; warnings.Add(Messages.VM_CPUMEMPAGE_VCPU_WARNING);
} }
} }
}
private void comboBoxVCPUs_SelectedIndexChanged(object sender, EventArgs e) if (comboBoxVCPUs.SelectedItem != null && SelectedVCpusMax < _minVCpus)
{
ValidateVCPUSettings();
comboBoxTopology.Update((long)comboBoxVCPUs.SelectedItem);
ValidateTopologySettings();
RefreshCurrentVCPUs();
}
private void ValidateVCPUSettings()
{
if (vm == null || !comboBoxVCPUs.Enabled)
return;
Host selectedAffinity = vm.Home();
if (selectedAffinity == null && vm.Connection.Cache.Hosts.Length == 1)
selectedAffinity = vm.Connection.Cache.Hosts[0];
if (selectedAffinity != null && comboBoxVCPUs.SelectedItem != null && selectedAffinity.host_CPUs.Count < SelectedVcpusMax)
{ {
VCPUWarningLabel.Text = Messages.VM_CPUMEMPAGE_VCPU_WARNING; warnings.Add(string.Format(Messages.VM_CPUMEMPAGE_VCPU_MIN_WARNING, _minVCpus));
VCPUWarningLabel.Visible = true;
}
else if (comboBoxVCPUs.SelectedItem != null && SelectedVcpusMax < minVCPUs)
{
VCPUWarningLabel.Text = string.Format(Messages.VM_CPUMEMPAGE_VCPU_MIN_WARNING, minVCPUs);
VCPUWarningLabel.Visible = true;
}
else
{
VCPUWarningLabel.Visible = false;
} }
if (comboBoxInitialVCPUs.SelectedItem != null && SelectedVcpusAtStartup < minVCPUs) if (comboBoxVCPUs.SelectedItem != null && SelectedVCpusMax > VM.MAX_VCPUS_FOR_NON_TRUSTED_VMS)
{ {
initialVCPUWarningLabel.Text = string.Format(Messages.VM_CPUMEMPAGE_VCPU_MIN_WARNING, minVCPUs); warnings.Add(string.Format(Messages.VCPUS_UNTRUSTED_VM_WARNING, VM.MAX_VCPUS_FOR_NON_TRUSTED_VMS, BrandManager.ProductBrand));
initialVCPUWarningLabel.Visible = true;
} }
else
if (comboBoxInitialVCPUs.SelectedItem != null && SelectedVCpusAtStartup < _minVCpus)
{ {
initialVCPUWarningLabel.Visible = false; warnings.Add(string.Format(Messages.VM_CPUMEMPAGE_VCPU_MIN_WARNING, _minVCpus));
} }
ShowCpuWarnings(warnings);
} }
private void ValidateTopologySettings() private void ValidateTopologySettings()
{ {
var warnings = new List<string>();
if (comboBoxVCPUs.SelectedItem != null) if (comboBoxVCPUs.SelectedItem != null)
labelInvalidVCPUWarning.Text = VM.ValidVCPUConfiguration((long)comboBoxVCPUs.SelectedItem, comboBoxTopology.CoresPerSocket); {
var topologyWarning = VM.ValidVCPUConfiguration((long)comboBoxVCPUs.SelectedItem, comboBoxTopology.CoresPerSocket);
if (!string.IsNullOrEmpty(topologyWarning))
{
warnings.Add($"{topologyWarning}.");
}
}
ShowTopologyWarnings(warnings);
} }
private long _prevVCPUsMax; private void RefreshCurrentVCpus()
private void RefreshCurrentVCPUs()
{ {
// refresh comboBoxInitialVCPUs if it's visible and populated // refresh comboBoxInitialVCPUs if it's visible and populated
if (comboBoxInitialVCPUs.Visible && comboBoxInitialVCPUs.Items.Count > 0) if (comboBoxInitialVCPUs.Visible && comboBoxInitialVCPUs.Items.Count > 0)
@ -574,28 +274,88 @@ namespace XenAdmin.SettingsPanels
// So if VcpusMax is decreased below VcpusAtStartup, then VcpusAtStartup is decreased to that number too // So if VcpusMax is decreased below VcpusAtStartup, then VcpusAtStartup is decreased to that number too
// If VcpusAtStartup and VcpusMax are equal, and VcpusMax is changed, then VcpusAtStartup is changed to match // If VcpusAtStartup and VcpusMax are equal, and VcpusMax is changed, then VcpusAtStartup is changed to match
// But if the numbers are unequal, and VcpusMax is changed but is still higher than VcpusAtStartup, then VcpusAtStartup is unchanged // But if the numbers are unequal, and VcpusMax is changed but is still higher than VcpusAtStartup, then VcpusAtStartup is unchanged
var newValue = SelectedVcpusAtStartup; var newValue = SelectedVCpusAtStartup;
if (SelectedVcpusMax < SelectedVcpusAtStartup)
newValue = SelectedVcpusMax;
else if (SelectedVcpusAtStartup == _prevVCPUsMax && SelectedVcpusMax != _prevVCPUsMax)
newValue = SelectedVcpusMax;
PopulateVCPUsAtStartup(SelectedVcpusMax, newValue); if (SelectedVCpusMax < SelectedVCpusAtStartup)
_prevVCPUsMax = SelectedVcpusMax; newValue = SelectedVCpusMax;
else if (SelectedVCpusAtStartup == _prevVCpusMax && SelectedVCpusMax != _prevVCpusMax)
newValue = SelectedVCpusMax;
PopulateVCpusAtStartup(SelectedVCpusMax, newValue);
_prevVCpusMax = SelectedVCpusMax;
} }
} }
public String SubText #region IEditPage
public AsyncAction SaveSettings()
{ {
get var actions = new List<AsyncAction>();
if (HasVCpuWeightChanged)
{ {
return ShowMemory ? _vm.SetVcpuWeight(Convert.ToInt32(_currentVCpuWeight));
String.Format(Messages.CPU_AND_MEMORY_SUB, SelectedVcpusAtStartup, nudMemory.Value) : }
String.Format(Messages.CPU_SUB, SelectedVcpusAtStartup);
if (HasVCpuChanged || HasVCpusAtStartupChanged)
{
actions.Add(new ChangeVCPUSettingsAction(_vm, SelectedVCpusMax, SelectedVCpusAtStartup));
}
if (HasTopologyChanged)
{
_vm.SetCoresPerSocket(comboBoxTopology.CoresPerSocket);
}
switch (actions.Count)
{
case 0:
return null;
case 1:
return actions[0];
default:
{
var multipleAction = new MultipleAction(_vm.Connection, "", "", "", actions, true);
return multipleAction;
}
} }
} }
/// <summary>
/// Must be a VM.
/// </summary>
public void SetXenObjects(IXenObject orig, IXenObject clone)
{
_vm = (VM)clone;
Repopulate();
}
public bool ValidToSave => _validToSave;
/** Show local validation balloon tooltips */
public void ShowLocalValidationMessages()
{
// not applicable
}
public void HideLocalValidationMessages()
{
// not applicable
}
/** Unregister listeners, dispose balloon tooltips, etc. */
public void Cleanup()
{
// not applicable
}
public bool HasChanged => HasVCpuChanged || HasTopologyChanged ||
HasVCpusAtStartupChanged || HasVCpuWeightChanged;
#endregion
#region Events
private void comboBoxTopology_SelectedIndexChanged(object sender, EventArgs e) private void comboBoxTopology_SelectedIndexChanged(object sender, EventArgs e)
{ {
ValidateTopologySettings(); ValidateTopologySettings();
@ -603,7 +363,24 @@ namespace XenAdmin.SettingsPanels
private void comboBoxInitialVCPUs_SelectedIndexChanged(object sender, EventArgs e) private void comboBoxInitialVCPUs_SelectedIndexChanged(object sender, EventArgs e)
{ {
ValidateVCPUSettings(); ValidateVCpuSettings();
} }
private void comboBoxVCPUs_SelectedIndexChanged(object sender, EventArgs e)
{
ValidateVCpuSettings();
comboBoxTopology.Update((long)comboBoxVCPUs.SelectedItem);
ValidateTopologySettings();
RefreshCurrentVCpus();
}
private void tbPriority_Scroll(object sender, EventArgs e)
{
_currentVCpuWeight = Convert.ToDecimal(Math.Pow(4.0d, Convert.ToDouble(transparentTrackBar1.Value)));
if (transparentTrackBar1.Value == transparentTrackBar1.Max)
_currentVCpuWeight--;
}
#endregion
} }
} }

View File

@ -898,7 +898,7 @@
<value>500, 500</value> <value>500, 500</value>
</data> </data>
<data name="&gt;&gt;$this.Name" xml:space="preserve"> <data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>CPUMemoryEditPage</value> <value>CpuMemoryEditPage</value>
</data> </data>
<data name="&gt;&gt;$this.Type" xml:space="preserve"> <data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>

View File

@ -226,52 +226,178 @@
<value>True</value> <value>True</value>
</data> </data>
<data name="tableLayoutPanel1.ColumnCount" type="System.Int32, mscorlib"> <data name="tableLayoutPanel1.ColumnCount" type="System.Int32, mscorlib">
<value>4</value> <value>3</value>
</data> </data>
<data name="initialVCPUWarningLabel.AutoSize" type="System.Boolean, mscorlib"> <data name="warningsTableLayoutPanel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
<data name="initialVCPUWarningLabel.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="warningsTableLayoutPanel.AutoSizeMode" type="System.Windows.Forms.AutoSizeMode, System.Windows.Forms">
<value>Fill</value> <value>GrowAndShrink</value>
</data> </data>
<data name="initialVCPUWarningLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="warningsTableLayoutPanel.ColumnCount" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="cpuWarningPictureBox.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="initialVCPUWarningLabel.Location" type="System.Drawing.Point, System.Drawing"> <data name="cpuWarningPictureBox.Location" type="System.Drawing.Point, System.Drawing">
<value>185, 133</value> <value>3, 3</value>
</data> </data>
<data name="initialVCPUWarningLabel.Size" type="System.Drawing.Size, System.Drawing"> <data name="cpuWarningPictureBox.Size" type="System.Drawing.Size, System.Drawing">
<value>312, 27</value> <value>16, 16</value>
</data> </data>
<data name="initialVCPUWarningLabel.TabIndex" type="System.Int32, mscorlib"> <data name="cpuWarningPictureBox.TabIndex" type="System.Int32, mscorlib">
<value>19</value>
</data>
<data name="initialVCPUWarningLabel.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="initialVCPUWarningLabel.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;initialVCPUWarningLabel.Name" xml:space="preserve">
<value>initialVCPUWarningLabel</value>
</data>
<data name="&gt;&gt;initialVCPUWarningLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;initialVCPUWarningLabel.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;initialVCPUWarningLabel.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<data name="cpuWarningPictureBox.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;cpuWarningPictureBox.Name" xml:space="preserve">
<value>cpuWarningPictureBox</value>
</data>
<data name="&gt;&gt;cpuWarningPictureBox.Type" xml:space="preserve">
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cpuWarningPictureBox.Parent" xml:space="preserve">
<value>warningsTableLayoutPanel</value>
</data>
<data name="&gt;&gt;cpuWarningPictureBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="cpuWarningLabel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Left</value>
</data>
<data name="cpuWarningLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="cpuWarningLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="cpuWarningLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>25, 4</value>
</data>
<data name="cpuWarningLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 13</value>
</data>
<data name="cpuWarningLabel.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="cpuWarningLabel.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;cpuWarningLabel.Name" xml:space="preserve">
<value>cpuWarningLabel</value>
</data>
<data name="&gt;&gt;cpuWarningLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cpuWarningLabel.Parent" xml:space="preserve">
<value>warningsTableLayoutPanel</value>
</data>
<data name="&gt;&gt;cpuWarningLabel.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="topologyWarningLabel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Left</value>
</data>
<data name="topologyWarningLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="topologyWarningLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="topologyWarningLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>25, 32</value>
</data>
<data name="topologyWarningLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 13</value>
</data>
<data name="topologyWarningLabel.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="topologyWarningLabel.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;topologyWarningLabel.Name" xml:space="preserve">
<value>topologyWarningLabel</value>
</data>
<data name="&gt;&gt;topologyWarningLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;topologyWarningLabel.Parent" xml:space="preserve">
<value>warningsTableLayoutPanel</value>
</data>
<data name="&gt;&gt;topologyWarningLabel.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="topologyPictureBox.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="topologyPictureBox.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 31</value>
</data>
<data name="topologyPictureBox.Size" type="System.Drawing.Size, System.Drawing">
<value>16, 16</value>
</data>
<data name="topologyPictureBox.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="topologyPictureBox.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;topologyPictureBox.Name" xml:space="preserve">
<value>topologyPictureBox</value>
</data>
<data name="&gt;&gt;topologyPictureBox.Type" xml:space="preserve">
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;topologyPictureBox.Parent" xml:space="preserve">
<value>warningsTableLayoutPanel</value>
</data>
<data name="&gt;&gt;topologyPictureBox.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="warningsTableLayoutPanel.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="warningsTableLayoutPanel.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 255</value>
</data>
<data name="warningsTableLayoutPanel.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 20, 0, 0</value>
</data>
<data name="warningsTableLayoutPanel.RowCount" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="warningsTableLayoutPanel.Size" type="System.Drawing.Size, System.Drawing">
<value>500, 50</value>
</data>
<data name="warningsTableLayoutPanel.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;warningsTableLayoutPanel.Name" xml:space="preserve">
<value>warningsTableLayoutPanel</value>
</data>
<data name="&gt;&gt;warningsTableLayoutPanel.Type" xml:space="preserve">
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;warningsTableLayoutPanel.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;warningsTableLayoutPanel.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="warningsTableLayoutPanel.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="cpuWarningPictureBox" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="cpuWarningLabel" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="topologyWarningLabel" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="topologyPictureBox" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="AutoSize,0,Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,Absolute,6,AutoSize,0" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data>
<data name="comboBoxInitialVCPUs.Location" type="System.Drawing.Point, System.Drawing"> <data name="comboBoxInitialVCPUs.Location" type="System.Drawing.Point, System.Drawing">
<value>129, 136</value> <value>129, 130</value>
</data> </data>
<data name="comboBoxInitialVCPUs.Size" type="System.Drawing.Size, System.Drawing"> <data name="comboBoxInitialVCPUs.Size" type="System.Drawing.Size, System.Drawing">
<value>50, 21</value> <value>50, 21</value>
</data> </data>
<data name="comboBoxInitialVCPUs.TabIndex" type="System.Int32, mscorlib"> <data name="comboBoxInitialVCPUs.TabIndex" type="System.Int32, mscorlib">
<value>8</value> <value>6</value>
</data> </data>
<data name="&gt;&gt;comboBoxInitialVCPUs.Name" xml:space="preserve"> <data name="&gt;&gt;comboBoxInitialVCPUs.Name" xml:space="preserve">
<value>comboBoxInitialVCPUs</value> <value>comboBoxInitialVCPUs</value>
@ -285,33 +411,27 @@
<data name="&gt;&gt;comboBoxInitialVCPUs.ZOrder" xml:space="preserve"> <data name="&gt;&gt;comboBoxInitialVCPUs.ZOrder" xml:space="preserve">
<value>1</value> <value>1</value>
</data> </data>
<data name="labelInitialVCPUs.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Left</value>
</data>
<data name="labelInitialVCPUs.AutoSize" type="System.Boolean, mscorlib"> <data name="labelInitialVCPUs.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
<data name="labelInitialVCPUs.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="labelInitialVCPUs.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="labelInitialVCPUs.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="labelInitialVCPUs.Location" type="System.Drawing.Point, System.Drawing"> <data name="labelInitialVCPUs.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 136</value> <value>3, 134</value>
</data>
<data name="labelInitialVCPUs.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data> </data>
<data name="labelInitialVCPUs.Size" type="System.Drawing.Size, System.Drawing"> <data name="labelInitialVCPUs.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 21</value> <value>120, 13</value>
</data> </data>
<data name="labelInitialVCPUs.TabIndex" type="System.Int32, mscorlib"> <data name="labelInitialVCPUs.TabIndex" type="System.Int32, mscorlib">
<value>7</value> <value>5</value>
</data> </data>
<data name="labelInitialVCPUs.Text" xml:space="preserve"> <data name="labelInitialVCPUs.Text" xml:space="preserve">
<value>Initial number of v&amp;CPUs:</value> <value>Initial number of v&amp;CPUs:</value>
</data> </data>
<data name="labelInitialVCPUs.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="&gt;&gt;labelInitialVCPUs.Name" xml:space="preserve"> <data name="&gt;&gt;labelInitialVCPUs.Name" xml:space="preserve">
<value>labelInitialVCPUs</value> <value>labelInitialVCPUs</value>
</data> </data>
@ -324,90 +444,51 @@
<data name="&gt;&gt;labelInitialVCPUs.ZOrder" xml:space="preserve"> <data name="&gt;&gt;labelInitialVCPUs.ZOrder" xml:space="preserve">
<value>2</value> <value>2</value>
</data> </data>
<data name="labelInvalidVCPUWarning.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="labelInvalidVCPUWarning.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="labelInvalidVCPUWarning.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="labelInvalidVCPUWarning.Location" type="System.Drawing.Point, System.Drawing">
<value>129, 114</value>
</data>
<data name="labelInvalidVCPUWarning.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 0, 3, 6</value>
</data>
<data name="labelInvalidVCPUWarning.Size" type="System.Drawing.Size, System.Drawing">
<value>368, 13</value>
</data>
<data name="labelInvalidVCPUWarning.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;labelInvalidVCPUWarning.Name" xml:space="preserve">
<value>labelInvalidVCPUWarning</value>
</data>
<data name="&gt;&gt;labelInvalidVCPUWarning.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labelInvalidVCPUWarning.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;labelInvalidVCPUWarning.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="comboBoxTopology.Font" type="System.Drawing.Font, System.Drawing"> <data name="comboBoxTopology.Font" type="System.Drawing.Font, System.Drawing">
<value>Tahoma, 8pt</value> <value>Tahoma, 8pt</value>
</data> </data>
<data name="comboBoxTopology.Location" type="System.Drawing.Point, System.Drawing"> <data name="comboBoxTopology.Location" type="System.Drawing.Point, System.Drawing">
<value>129, 90</value> <value>129, 103</value>
</data> </data>
<data name="comboBoxTopology.Size" type="System.Drawing.Size, System.Drawing"> <data name="comboBoxTopology.Size" type="System.Drawing.Size, System.Drawing">
<value>250, 21</value> <value>250, 21</value>
</data> </data>
<data name="comboBoxTopology.TabIndex" type="System.Int32, mscorlib"> <data name="comboBoxTopology.TabIndex" type="System.Int32, mscorlib">
<value>6</value> <value>4</value>
</data> </data>
<data name="&gt;&gt;comboBoxTopology.Name" xml:space="preserve"> <data name="&gt;&gt;comboBoxTopology.Name" xml:space="preserve">
<value>comboBoxTopology</value> <value>comboBoxTopology</value>
</data> </data>
<data name="&gt;&gt;comboBoxTopology.Type" xml:space="preserve"> <data name="&gt;&gt;comboBoxTopology.Type" xml:space="preserve">
<value>XenAdmin.Controls.CPUTopologyComboBox, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value> <value>XenAdmin.Controls.CPUTopologyComboBox, [XenCenter_No_Space], Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;comboBoxTopology.Parent" xml:space="preserve"> <data name="&gt;&gt;comboBoxTopology.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value> <value>tableLayoutPanel1</value>
</data> </data>
<data name="&gt;&gt;comboBoxTopology.ZOrder" xml:space="preserve"> <data name="&gt;&gt;comboBoxTopology.ZOrder" xml:space="preserve">
<value>4</value> <value>3</value>
</data>
<data name="labelTopology.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Left</value>
</data> </data>
<data name="labelTopology.AutoSize" type="System.Boolean, mscorlib"> <data name="labelTopology.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
<data name="labelTopology.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="labelTopology.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="labelTopology.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="labelTopology.Location" type="System.Drawing.Point, System.Drawing"> <data name="labelTopology.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 90</value> <value>3, 107</value>
</data>
<data name="labelTopology.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data> </data>
<data name="labelTopology.Size" type="System.Drawing.Size, System.Drawing"> <data name="labelTopology.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 21</value> <value>54, 13</value>
</data> </data>
<data name="labelTopology.TabIndex" type="System.Int32, mscorlib"> <data name="labelTopology.TabIndex" type="System.Int32, mscorlib">
<value>5</value> <value>3</value>
</data> </data>
<data name="labelTopology.Text" xml:space="preserve"> <data name="labelTopology.Text" xml:space="preserve">
<value>&amp;Topology:</value> <value>&amp;Topology:</value>
</data> </data>
<data name="labelTopology.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="&gt;&gt;labelTopology.Name" xml:space="preserve"> <data name="&gt;&gt;labelTopology.Name" xml:space="preserve">
<value>labelTopology</value> <value>labelTopology</value>
</data> </data>
@ -418,139 +499,7 @@
<value>tableLayoutPanel1</value> <value>tableLayoutPanel1</value>
</data> </data>
<data name="&gt;&gt;labelTopology.ZOrder" xml:space="preserve"> <data name="&gt;&gt;labelTopology.ZOrder" xml:space="preserve">
<value>5</value> <value>4</value>
</data>
<data name="MemWarningLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="MemWarningLabel.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="MemWarningLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="MemWarningLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>230, 272</value>
</data>
<data name="MemWarningLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>267, 26</value>
</data>
<data name="MemWarningLabel.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
</data>
<data name="MemWarningLabel.Text" xml:space="preserve">
<value>The amount of physical memory allocated to this VM is greater than the total memory of its home server</value>
</data>
<data name="MemWarningLabel.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="MemWarningLabel.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;MemWarningLabel.Name" xml:space="preserve">
<value>MemWarningLabel</value>
</data>
<data name="&gt;&gt;MemWarningLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;MemWarningLabel.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;MemWarningLabel.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="panel2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="panel2.AutoSizeMode" type="System.Windows.Forms.AutoSizeMode, System.Windows.Forms">
<value>GrowAndShrink</value>
</data>
<data name="lblMB.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblMB.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lblMB.Location" type="System.Drawing.Point, System.Drawing">
<value>72, 3</value>
</data>
<data name="lblMB.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data>
<data name="lblMB.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 13</value>
</data>
<data name="lblMB.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="lblMB.Text" xml:space="preserve">
<value>MB</value>
</data>
<data name="lblMB.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="&gt;&gt;lblMB.Name" xml:space="preserve">
<value>lblMB</value>
</data>
<data name="&gt;&gt;lblMB.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblMB.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;lblMB.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="nudMemory.Location" type="System.Drawing.Point, System.Drawing">
<value>1, 0</value>
</data>
<data name="nudMemory.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 0</value>
</data>
<data name="nudMemory.Size" type="System.Drawing.Size, System.Drawing">
<value>71, 20</value>
</data>
<data name="nudMemory.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;nudMemory.Name" xml:space="preserve">
<value>nudMemory</value>
</data>
<data name="&gt;&gt;nudMemory.Type" xml:space="preserve">
<value>System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;nudMemory.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;nudMemory.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="panel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>126, 275</value>
</data>
<data name="panel2.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 3, 0, 3</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>101, 20</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="&gt;&gt;panel2.Name" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panel2.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel2.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;panel2.ZOrder" xml:space="preserve">
<value>7</value>
</data> </data>
<data name="panel1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <data name="panel1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value> <value>Top, Left, Right</value>
@ -571,7 +520,7 @@
<value>transparentTrackBar1</value> <value>transparentTrackBar1</value>
</data> </data>
<data name="&gt;&gt;transparentTrackBar1.Type" xml:space="preserve"> <data name="&gt;&gt;transparentTrackBar1.Type" xml:space="preserve">
<value>XenAdmin.Controls.TransparentTrackBar, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value> <value>XenAdmin.Controls.TransparentTrackBar, [XenCenter_No_Space], Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;transparentTrackBar1.Parent" xml:space="preserve"> <data name="&gt;&gt;transparentTrackBar1.Parent" xml:space="preserve">
<value>panel1</value> <value>panel1</value>
@ -580,10 +529,7 @@
<value>3</value> <value>3</value>
</data> </data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing"> <data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 206</value> <value>3, 190</value>
</data>
<data name="panel1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 24</value>
</data> </data>
<data name="panel1.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms"> <data name="panel1.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 6</value> <value>0, 0, 0, 6</value>
@ -592,7 +538,7 @@
<value>494, 42</value> <value>494, 42</value>
</data> </data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib"> <data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>9</value> <value>8</value>
</data> </data>
<data name="&gt;&gt;panel1.Name" xml:space="preserve"> <data name="&gt;&gt;panel1.Name" xml:space="preserve">
<value>panel1</value> <value>panel1</value>
@ -604,35 +550,29 @@
<value>tableLayoutPanel1</value> <value>tableLayoutPanel1</value>
</data> </data>
<data name="&gt;&gt;panel1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;panel1.ZOrder" xml:space="preserve">
<value>8</value> <value>5</value>
</data>
<data name="lblVCPUs.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Left</value>
</data> </data>
<data name="lblVCPUs.AutoSize" type="System.Boolean, mscorlib"> <data name="lblVCPUs.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
<data name="lblVCPUs.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="lblVCPUs.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="lblVCPUs.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="lblVCPUs.Location" type="System.Drawing.Point, System.Drawing"> <data name="lblVCPUs.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 63</value> <value>3, 80</value>
</data>
<data name="lblVCPUs.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data> </data>
<data name="lblVCPUs.Size" type="System.Drawing.Size, System.Drawing"> <data name="lblVCPUs.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 21</value> <value>95, 13</value>
</data> </data>
<data name="lblVCPUs.TabIndex" type="System.Int32, mscorlib"> <data name="lblVCPUs.TabIndex" type="System.Int32, mscorlib">
<value>2</value> <value>1</value>
</data> </data>
<data name="lblVCPUs.Text" xml:space="preserve"> <data name="lblVCPUs.Text" xml:space="preserve">
<value>&amp;Number of vCPUs:</value> <value>&amp;Number of vCPUs:</value>
</data> </data>
<data name="lblVCPUs.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="&gt;&gt;lblVCPUs.Name" xml:space="preserve"> <data name="&gt;&gt;lblVCPUs.Name" xml:space="preserve">
<value>lblVCPUs</value> <value>lblVCPUs</value>
</data> </data>
@ -643,121 +583,7 @@
<value>tableLayoutPanel1</value> <value>tableLayoutPanel1</value>
</data> </data>
<data name="&gt;&gt;lblVCPUs.ZOrder" xml:space="preserve"> <data name="&gt;&gt;lblVCPUs.ZOrder" xml:space="preserve">
<value>10</value> <value>7</value>
</data>
<data name="lblVcpuWarning.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblVcpuWarning.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lblVcpuWarning.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 41</value>
</data>
<data name="lblVcpuWarning.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 0, 3, 6</value>
</data>
<data name="lblVcpuWarning.Size" type="System.Drawing.Size, System.Drawing">
<value>183, 13</value>
</data>
<data name="lblVcpuWarning.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="lblVcpuWarning.Text" xml:space="preserve">
<value>How can I improve VM performance?</value>
</data>
<data name="lblVcpuWarning.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="&gt;&gt;lblVcpuWarning.Name" xml:space="preserve">
<value>lblVcpuWarning</value>
</data>
<data name="&gt;&gt;lblVcpuWarning.Type" xml:space="preserve">
<value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblVcpuWarning.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;lblVcpuWarning.ZOrder" xml:space="preserve">
<value>11</value>
</data>
<data name="lblMemory.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblMemory.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="lblMemory.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="lblMemory.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 275</value>
</data>
<data name="lblMemory.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 3</value>
</data>
<data name="lblMemory.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 20</value>
</data>
<data name="lblMemory.TabIndex" type="System.Int32, mscorlib">
<value>10</value>
</data>
<data name="lblMemory.Text" xml:space="preserve">
<value>&amp;VM memory:</value>
</data>
<data name="lblMemory.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="&gt;&gt;lblMemory.Name" xml:space="preserve">
<value>lblMemory</value>
</data>
<data name="&gt;&gt;lblMemory.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblMemory.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;lblMemory.ZOrder" xml:space="preserve">
<value>12</value>
</data>
<data name="VCPUWarningLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="VCPUWarningLabel.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="VCPUWarningLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="VCPUWarningLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>185, 60</value>
</data>
<data name="VCPUWarningLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>312, 27</value>
</data>
<data name="VCPUWarningLabel.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="VCPUWarningLabel.Text" xml:space="preserve">
<value>More vCPUs than physical CPUs may lead to reduced VM performance</value>
</data>
<data name="VCPUWarningLabel.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="VCPUWarningLabel.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;VCPUWarningLabel.Name" xml:space="preserve">
<value>VCPUWarningLabel</value>
</data>
<data name="&gt;&gt;VCPUWarningLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;VCPUWarningLabel.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;VCPUWarningLabel.ZOrder" xml:space="preserve">
<value>13</value>
</data> </data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib"> <data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
@ -771,11 +597,11 @@
<data name="label1.Location" type="System.Drawing.Point, System.Drawing"> <data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 0</value> <value>3, 0</value>
</data> </data>
<data name="label1.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms"> <data name="label1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 15</value> <value>3, 0, 3, 15</value>
</data> </data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing"> <data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>494, 41</value> <value>494, 26</value>
</data> </data>
<data name="label1.TabIndex" type="System.Int32, mscorlib"> <data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value> <value>0</value>
@ -793,16 +619,16 @@
<value>tableLayoutPanel1</value> <value>tableLayoutPanel1</value>
</data> </data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>14</value> <value>8</value>
</data> </data>
<data name="comboBoxVCPUs.Location" type="System.Drawing.Point, System.Drawing"> <data name="comboBoxVCPUs.Location" type="System.Drawing.Point, System.Drawing">
<value>129, 63</value> <value>129, 76</value>
</data> </data>
<data name="comboBoxVCPUs.Size" type="System.Drawing.Size, System.Drawing"> <data name="comboBoxVCPUs.Size" type="System.Drawing.Size, System.Drawing">
<value>50, 21</value> <value>50, 21</value>
</data> </data>
<data name="comboBoxVCPUs.TabIndex" type="System.Int32, mscorlib"> <data name="comboBoxVCPUs.TabIndex" type="System.Int32, mscorlib">
<value>3</value> <value>2</value>
</data> </data>
<data name="&gt;&gt;comboBoxVCPUs.Name" xml:space="preserve"> <data name="&gt;&gt;comboBoxVCPUs.Name" xml:space="preserve">
<value>comboBoxVCPUs</value> <value>comboBoxVCPUs</value>
@ -814,7 +640,97 @@
<value>tableLayoutPanel1</value> <value>tableLayoutPanel1</value>
</data> </data>
<data name="&gt;&gt;comboBoxVCPUs.ZOrder" xml:space="preserve"> <data name="&gt;&gt;comboBoxVCPUs.ZOrder" xml:space="preserve">
<value>15</value> <value>9</value>
</data>
<data name="tableLayoutPanelInfo.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="tableLayoutPanelInfo.AutoSizeMode" type="System.Windows.Forms.AutoSizeMode, System.Windows.Forms">
<value>GrowAndShrink</value>
</data>
<data name="tableLayoutPanelInfo.ColumnCount" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="pictureBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 3</value>
</data>
<data name="pictureBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>16, 16</value>
</data>
<data name="pictureBox1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;pictureBox1.Name" xml:space="preserve">
<value>pictureBox1</value>
</data>
<data name="&gt;&gt;pictureBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;pictureBox1.Parent" xml:space="preserve">
<value>tableLayoutPanelInfo</value>
</data>
<data name="&gt;&gt;pictureBox1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="labelInfo.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Left</value>
</data>
<data name="labelInfo.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="labelInfo.Location" type="System.Drawing.Point, System.Drawing">
<value>25, 4</value>
</data>
<data name="labelInfo.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 13</value>
</data>
<data name="labelInfo.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;labelInfo.Name" xml:space="preserve">
<value>labelInfo</value>
</data>
<data name="&gt;&gt;labelInfo.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labelInfo.Parent" xml:space="preserve">
<value>tableLayoutPanelInfo</value>
</data>
<data name="&gt;&gt;labelInfo.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="tableLayoutPanelInfo.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="tableLayoutPanelInfo.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 41</value>
</data>
<data name="tableLayoutPanelInfo.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 10</value>
</data>
<data name="tableLayoutPanelInfo.RowCount" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="tableLayoutPanelInfo.Size" type="System.Drawing.Size, System.Drawing">
<value>500, 22</value>
</data>
<data name="tableLayoutPanelInfo.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
</data>
<data name="&gt;&gt;tableLayoutPanelInfo.Name" xml:space="preserve">
<value>tableLayoutPanelInfo</value>
</data>
<data name="&gt;&gt;tableLayoutPanelInfo.Type" xml:space="preserve">
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tableLayoutPanelInfo.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;tableLayoutPanelInfo.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="tableLayoutPanelInfo.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="pictureBox1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="labelInfo" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="AutoSize,0,Percent,100" /&gt;&lt;Rows Styles="AutoSize,0" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data> </data>
<data name="tableLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="tableLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value> <value>Fill</value>
@ -826,10 +742,10 @@
<value>0, 0, 0, 0</value> <value>0, 0, 0, 0</value>
</data> </data>
<data name="tableLayoutPanel1.RowCount" type="System.Int32, mscorlib"> <data name="tableLayoutPanel1.RowCount" type="System.Int32, mscorlib">
<value>13</value> <value>8</value>
</data> </data>
<data name="tableLayoutPanel1.Size" type="System.Drawing.Size, System.Drawing"> <data name="tableLayoutPanel1.Size" type="System.Drawing.Size, System.Drawing">
<value>500, 500</value> <value>500, 400</value>
</data> </data>
<data name="tableLayoutPanel1.TabIndex" type="System.Int32, mscorlib"> <data name="tableLayoutPanel1.TabIndex" type="System.Int32, mscorlib">
<value>0</value> <value>0</value>
@ -847,22 +763,22 @@
<value>0</value> <value>0</value>
</data> </data>
<data name="tableLayoutPanel1.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms"> <data name="tableLayoutPanel1.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="initialVCPUWarningLabel" Row="6" RowSpan="1" Column="2" ColumnSpan="2" /&gt;&lt;Control Name="comboBoxInitialVCPUs" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="labelInitialVCPUs" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="labelInvalidVCPUWarning" Row="5" RowSpan="1" Column="1" ColumnSpan="3" /&gt;&lt;Control Name="comboBoxTopology" Row="4" RowSpan="1" Column="1" ColumnSpan="3" /&gt;&lt;Control Name="labelTopology" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="MemWarningLabel" Row="10" RowSpan="2" Column="3" ColumnSpan="1" /&gt;&lt;Control Name="panel2" Row="10" RowSpan="1" Column="1" ColumnSpan="2" /&gt;&lt;Control Name="panel1" Row="9" RowSpan="1" Column="0" ColumnSpan="4" /&gt;&lt;Control Name="lblPriority" Row="8" RowSpan="1" Column="0" ColumnSpan="4" /&gt;&lt;Control Name="lblVCPUs" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="lblVcpuWarning" Row="1" RowSpan="1" Column="0" ColumnSpan="4" /&gt;&lt;Control Name="lblMemory" Row="10" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="VCPUWarningLabel" Row="2" RowSpan="2" Column="2" ColumnSpan="2" /&gt;&lt;Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="4" /&gt;&lt;Control Name="comboBoxVCPUs" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="AutoSize,0,AutoSize,0,Absolute,45,Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,20,AutoSize,0,Absolute,20,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,100,Percent,50,Absolute,20" /&gt;&lt;/TableLayoutSettings&gt;</value> <value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="warningsTableLayoutPanel" Row="7" RowSpan="1" Column="0" ColumnSpan="3" /&gt;&lt;Control Name="comboBoxInitialVCPUs" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="labelInitialVCPUs" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="comboBoxTopology" Row="3" RowSpan="1" Column="1" ColumnSpan="2" /&gt;&lt;Control Name="labelTopology" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="panel1" Row="6" RowSpan="1" Column="0" ColumnSpan="3" /&gt;&lt;Control Name="lblPriority" Row="5" RowSpan="1" Column="0" ColumnSpan="3" /&gt;&lt;Control Name="lblVCPUs" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="3" /&gt;&lt;Control Name="comboBoxVCPUs" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="tableLayoutPanelInfo" Row="1" RowSpan="1" Column="0" ColumnSpan="3" /&gt;&lt;/Controls&gt;&lt;Columns Styles="AutoSize,0,AutoSize,0,Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data> </data>
<data name="lblPriority.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="lblPriority.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="lblPriority.Location" type="System.Drawing.Point, System.Drawing"> <data name="lblPriority.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 180</value> <value>3, 174</value>
</data> </data>
<data name="lblPriority.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms"> <data name="lblPriority.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 10, 0, 0</value> <value>3, 20, 3, 0</value>
</data> </data>
<data name="lblPriority.Size" type="System.Drawing.Size, System.Drawing"> <data name="lblPriority.Size" type="System.Drawing.Size, System.Drawing">
<value>179, 23</value> <value>179, 13</value>
</data> </data>
<data name="lblPriority.TabIndex" type="System.Int32, mscorlib"> <data name="lblPriority.TabIndex" type="System.Int32, mscorlib">
<value>8</value> <value>7</value>
</data> </data>
<data name="lblPriority.Text" xml:space="preserve"> <data name="lblPriority.Text" xml:space="preserve">
<value>vCPU priority for this virtual machine:</value> <value>vCPU priority for this virtual machine:</value>
@ -880,7 +796,7 @@
<value>tableLayoutPanel1</value> <value>tableLayoutPanel1</value>
</data> </data>
<data name="&gt;&gt;lblPriority.ZOrder" xml:space="preserve"> <data name="&gt;&gt;lblPriority.ZOrder" xml:space="preserve">
<value>9</value> <value>6</value>
</data> </data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
@ -892,13 +808,13 @@
<value>0, 0, 0, 0</value> <value>0, 0, 0, 0</value>
</data> </data>
<data name="$this.MinimumSize" type="System.Drawing.Size, System.Drawing"> <data name="$this.MinimumSize" type="System.Drawing.Size, System.Drawing">
<value>500, 500</value> <value>500, 400</value>
</data> </data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing"> <data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>500, 500</value> <value>500, 400</value>
</data> </data>
<data name="&gt;&gt;$this.Name" xml:space="preserve"> <data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>CPUMemoryEditPage</value> <value>CpuMemoryEditPage</value>
</data> </data>
<data name="&gt;&gt;$this.Type" xml:space="preserve"> <data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>

View File

@ -898,7 +898,7 @@
<value>500, 500</value> <value>500, 500</value>
</data> </data>
<data name="&gt;&gt;$this.Name" xml:space="preserve"> <data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>CPUMemoryEditPage</value> <value>CpuMemoryEditPage</value>
</data> </data>
<data name="&gt;&gt;$this.Type" xml:space="preserve"> <data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>

View File

@ -63,7 +63,6 @@ namespace XenAdmin.SettingsPanels
resources.ApplyResources(this.EmailNotificationCheckBox, "EmailNotificationCheckBox"); resources.ApplyResources(this.EmailNotificationCheckBox, "EmailNotificationCheckBox");
this.EmailNotificationCheckBox.Name = "EmailNotificationCheckBox"; this.EmailNotificationCheckBox.Name = "EmailNotificationCheckBox";
this.EmailNotificationCheckBox.UseVisualStyleBackColor = false; this.EmailNotificationCheckBox.UseVisualStyleBackColor = false;
this.EmailNotificationCheckBox.CheckedChanged += new System.EventHandler(this.EmailNotificationCheckBox_CheckedChanged);
// //
// groupBox1 // groupBox1
// //
@ -81,9 +80,9 @@ namespace XenAdmin.SettingsPanels
// //
// MailLanguageComboBox // MailLanguageComboBox
// //
resources.ApplyResources(this.MailLanguageComboBox, "MailLanguageComboBox");
this.MailLanguageComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.MailLanguageComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.MailLanguageComboBox.FormattingEnabled = true; this.MailLanguageComboBox.FormattingEnabled = true;
resources.ApplyResources(this.MailLanguageComboBox, "MailLanguageComboBox");
this.MailLanguageComboBox.Name = "MailLanguageComboBox"; this.MailLanguageComboBox.Name = "MailLanguageComboBox";
// //
// MailLanguageLabel // MailLanguageLabel

View File

@ -35,24 +35,25 @@ using System.Windows.Forms;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using XenAPI; using XenAPI;
using XenAdmin.Alerts;
using XenAdmin.Actions; using XenAdmin.Actions;
using XenAdmin.Core; using XenAdmin.Core;
using XenCenterLib;
namespace XenAdmin.SettingsPanels namespace XenAdmin.SettingsPanels
{ {
public partial class PerfmonAlertOptionsPage : UserControl, IEditPage public partial class PerfmonAlertOptionsPage : UserControl, IEditPage
{ {
private IXenObject _XenModelObject; // match anything with an @ sign in the middle
private PerfmonOptionsDefinition _PerfmonOptions; private static readonly Regex emailRegex = new Regex(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", RegexOptions.IgnoreCase);
private bool _OrigEmailNotificationCheckBox; private IXenObject _XenModelObject;
private string _OrigEmailAddressTextBox;
private string _OrigSmtpServerAddrTextBox; private bool _origEmailNotificationCheckBox;
private string _OrigSmtpServerPortTextBox; private string _origEmailAddressTextBox;
private string _OrigMailLanguageCode; private string _origSmtpServerAddrTextBox;
private bool _bSupportMailLanguage; private string _origSmtpServerPortTextBox;
private int _origMailLanguageIndex;
private readonly ToolTip InvalidParamToolTip; private readonly ToolTip InvalidParamToolTip;
@ -62,117 +63,112 @@ namespace XenAdmin.SettingsPanels
Text = Messages.EMAIL_OPTIONS; Text = Messages.EMAIL_OPTIONS;
InvalidParamToolTip = new ToolTip(); InvalidParamToolTip = new ToolTip
InvalidParamToolTip.IsBalloon = true;
InvalidParamToolTip.ToolTipIcon = ToolTipIcon.Warning;
InvalidParamToolTip.ToolTipTitle = Messages.INVALID_PARAMETER;
MailLanguageComboBox.DataSource = new BindingSource(PerfmonOptionsDefinition.MailLanguageDataSource(), null);
MailLanguageComboBox.DisplayMember = "Value";
MailLanguageComboBox.ValueMember = "Key";
EmailNotificationCheckBox_CheckedChanged(null, null);
}
public String SubText
{
get
{ {
if (!EmailNotificationCheckBox.Checked) IsBalloon = true,
return Messages.NONE_DEFINED; ToolTipIcon = ToolTipIcon.Warning,
ToolTipTitle = Messages.INVALID_PARAMETER
};
return EmailAddressTextBox.Text; MailLanguageComboBox.Items.Add(new ToStringWrapper<string>(Messages.MAIL_LANGUAGE_ENGLISH_CODE, Messages.MAIL_LANGUAGE_ENGLISH_NAME));
} MailLanguageComboBox.Items.Add(new ToStringWrapper<string>(Messages.MAIL_LANGUAGE_CHINESE_CODE, Messages.MAIL_LANGUAGE_CHINESE_NAME));
MailLanguageComboBox.Items.Add(new ToStringWrapper<string>(Messages.MAIL_LANGUAGE_JAPANESE_CODE, Messages.MAIL_LANGUAGE_JAPANESE_NAME));
} }
public string SubText => EmailNotificationCheckBox.Checked ? EmailAddressTextBox.Text : Messages.NONE_DEFINED;
public Image Image => Images.StaticImages._000_Email_h32bit_16; public Image Image => Images.StaticImages._000_Email_h32bit_16;
// match anything with an @ sign in the middle private static bool IsValidEmail(string s)
private static readonly Regex emailRegex = new Regex(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", RegexOptions.IgnoreCase);
public static bool IsValidEmail(string s)
{ {
return emailRegex.IsMatch(s); return emailRegex.IsMatch(s);
} }
private bool IsValidSmtpAddress() private bool IsValidSmtpAddress()
{ {
return !SmtpServerAddrTextBox.Text.ToCharArray().Any((c) => c >= 128) && SmtpServerAddrTextBox.Text.Trim().Length > 0; return !SmtpServerAddrTextBox.Text.ToCharArray().Any(c => c >= 128) && SmtpServerAddrTextBox.Text.Trim().Length > 0;
}
public void SetMailLanguageComboBoxValue(String code)
{
if (_bSupportMailLanguage && PerfmonOptionsDefinition.MailLanguageHasCode(code))
MailLanguageComboBox.SelectedValue = code; // Feature supported and code is valid
else
{
// Set default value
if (PerfmonOptionsDefinition.MailLanguageHasCode(BrandManager.PerfAlertMailDefaultLanguage))
MailLanguageComboBox.SelectedValue = BrandManager.PerfAlertMailDefaultLanguage;
else
MailLanguageComboBox.SelectedIndex = 0;
}
} }
public void SetXenObjects(IXenObject orig, IXenObject clone) public void SetXenObjects(IXenObject orig, IXenObject clone)
{ {
_XenModelObject = clone; _XenModelObject = clone;
_bSupportMailLanguage = Helpers.InvernessOrGreater(_XenModelObject.Connection); Populate();
Repopulate();
// Save original settings for change detection // Save original settings for change detection
_OrigEmailNotificationCheckBox = EmailNotificationCheckBox.Checked; _origEmailNotificationCheckBox = EmailNotificationCheckBox.Checked;
_OrigEmailAddressTextBox = EmailAddressTextBox.Text; _origEmailAddressTextBox = EmailAddressTextBox.Text;
_OrigSmtpServerAddrTextBox = SmtpServerAddrTextBox.Text; _origSmtpServerAddrTextBox = SmtpServerAddrTextBox.Text;
_OrigSmtpServerPortTextBox = SmtpServerPortTextBox.Text; _origSmtpServerPortTextBox = SmtpServerPortTextBox.Text;
_origMailLanguageIndex = MailLanguageComboBox.SelectedIndex;
} }
public void Repopulate()
private void Populate()
{ {
if (_XenModelObject == null) var pool = Helpers.GetPoolOfOne(_XenModelObject?.Connection);
if (pool == null)
return; return;
try
{
MailLanguageLabel.Visible = MailLanguageComboBox.Visible = _bSupportMailLanguage;
_PerfmonOptions = PerfmonOptionsDefinition.GetPerfmonOptionsDefinitions(_XenModelObject); pool.other_config.TryGetValue(Pool.MAIL_DESTINATION_KEY_NAME, out var mailDestination);
if (_PerfmonOptions != null) pool.other_config.TryGetValue(Pool.SMTP_MAILHUB_KEY_NAME, out var mailHub);
{ pool.other_config.TryGetValue(Pool.MAIL_LANGUAGE_KEY_NAME, out var mailLanguageCode);
EmailNotificationCheckBox.Checked = true;
EmailAddressTextBox.Text = _PerfmonOptions.MailDestination;
SmtpServerAddrTextBox.Text = PerfmonOptionsDefinition.GetSmtpServerAddress(_PerfmonOptions.MailHub);
SmtpServerPortTextBox.Text = PerfmonOptionsDefinition.GetSmtpPort(_PerfmonOptions.MailHub);
SetMailLanguageComboBoxValue(_PerfmonOptions.MailLanguageCode); EmailNotificationCheckBox.Checked = !string.IsNullOrWhiteSpace(mailDestination) && !string.IsNullOrWhiteSpace(mailHub);
if (_bSupportMailLanguage) // Save original MailLanguageCode for change detection
_OrigMailLanguageCode = _PerfmonOptions.MailLanguageCode; if (!string.IsNullOrWhiteSpace(mailDestination))
else EmailAddressTextBox.Text = mailDestination.Trim();
_OrigMailLanguageCode = null;
} if (!string.IsNullOrWhiteSpace(mailHub))
else
{
SetMailLanguageComboBoxValue(null);
_OrigMailLanguageCode = null;
}
}
catch
{ {
// ignored string[] words = mailHub.Trim().Split(':');
if (words.Length > 0)
SmtpServerAddrTextBox.Text = words[0];
if (words.Length > 1)
SmtpServerPortTextBox.Text = words[1];
} }
bool isLangSupported = Helpers.InvernessOrGreater(pool.Connection);
MailLanguageLabel.Visible = MailLanguageComboBox.Visible = isLangSupported;
int index = -1;
if (isLangSupported && !string.IsNullOrWhiteSpace(mailLanguageCode))
index = IndexOfLangItem(mailLanguageCode.Trim());
if (index == -1)
index = IndexOfLangItem(BrandManager.PerfAlertMailDefaultLanguage);
if (index == -1)
index = 0;
MailLanguageComboBox.SelectedIndex = index;
} }
public bool HasChanged private int IndexOfLangItem(string code)
{ {
get if (string.IsNullOrWhiteSpace(code))
return -1;
for (var index = 0; index < MailLanguageComboBox.Items.Count; index++)
{ {
return ((_OrigEmailNotificationCheckBox != EmailNotificationCheckBox.Checked) || var obj = MailLanguageComboBox.Items[index];
(_OrigEmailAddressTextBox != EmailAddressTextBox.Text) || if (obj is ToStringWrapper<string> wrapper && wrapper.item.ToLower() == code.ToLower())
(_OrigSmtpServerAddrTextBox != SmtpServerAddrTextBox.Text) || return index;
(_OrigSmtpServerPortTextBox != SmtpServerPortTextBox.Text) ||
(_bSupportMailLanguage && _OrigMailLanguageCode != MailLanguageComboBox.SelectedValue.ToString()));
} }
return -1;
} }
public bool HasChanged =>
_origEmailNotificationCheckBox != EmailNotificationCheckBox.Checked ||
_origEmailAddressTextBox != EmailAddressTextBox.Text ||
_origSmtpServerAddrTextBox != SmtpServerAddrTextBox.Text ||
_origSmtpServerPortTextBox != SmtpServerPortTextBox.Text ||
_origMailLanguageIndex != MailLanguageComboBox.SelectedIndex;
public void ShowLocalValidationMessages() public void ShowLocalValidationMessages()
{ {
if (!IsValidEmail(EmailAddressTextBox.Text)) if (!IsValidEmail(EmailAddressTextBox.Text))
@ -205,20 +201,9 @@ namespace XenAdmin.SettingsPanels
} }
} }
public bool ValidToSave public bool ValidToSave =>
{ !EmailNotificationCheckBox.Checked ||
get IsValidEmail(EmailAddressTextBox.Text) && Util.IsValidPort(SmtpServerPortTextBox.Text) && IsValidSmtpAddress();
{
if (EmailNotificationCheckBox.Checked)
{
return IsValidEmail(EmailAddressTextBox.Text) && Util.IsValidPort(SmtpServerPortTextBox.Text) && IsValidSmtpAddress();
}
else
{
return true;
}
}
}
public void Cleanup() public void Cleanup()
{ {
@ -227,25 +212,21 @@ namespace XenAdmin.SettingsPanels
public AsyncAction SaveSettings() public AsyncAction SaveSettings()
{ {
PerfmonOptionsDefinition perfmonOptions = null; // a null value will clear the definitions // a null value will clear the definitions
string mailDestination = null;
string mailHub = null;
string mailLangCode = null;
if (EmailNotificationCheckBox.Checked) if (EmailNotificationCheckBox.Checked)
{ {
string smtpMailHub = SmtpServerAddrTextBox.Text + ":" + SmtpServerPortTextBox.Text; mailDestination = EmailAddressTextBox.Text;
string mailLanguageCode = null; mailHub = SmtpServerAddrTextBox.Text + ":" + SmtpServerPortTextBox.Text;
if (_bSupportMailLanguage && null != MailLanguageComboBox.SelectedValue)
mailLanguageCode = MailLanguageComboBox.SelectedValue.ToString(); if (MailLanguageComboBox.Visible && MailLanguageComboBox.SelectedValue != null)
perfmonOptions = new PerfmonOptionsDefinition(smtpMailHub, EmailAddressTextBox.Text, mailLanguageCode); mailLangCode = MailLanguageComboBox.SelectedValue.ToString();
} }
return new PerfmonOptionsDefinitionAction(_XenModelObject.Connection, perfmonOptions, true); return new PerfmonOptionsDefinitionAction(_XenModelObject.Connection, mailDestination, mailHub, mailLangCode, true);
}
private void EmailNotificationCheckBox_CheckedChanged(object sender, EventArgs e)
{
EmailAddressTextBox.Enabled = EmailNotificationCheckBox.Checked;
SmtpServerAddrTextBox.Enabled = EmailNotificationCheckBox.Checked;
SmtpServerPortTextBox.Enabled = EmailNotificationCheckBox.Checked;
MailLanguageComboBox.Enabled = EmailNotificationCheckBox.Checked;
} }
} }
} }

View File

@ -59,46 +59,46 @@
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
<xsd:schema id="root" xmlns="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element msdata:IsDataSet="true" name="root"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata"> <xsd:element name="metadata">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element minOccurs="0" name="value" type="xsd:string"/> <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/> <xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string"/> <xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string"/> <xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space"/> <xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="assembly"> <xsd:element name="assembly">
<xsd:complexType> <xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/> <xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string"/> <xsd:attribute name="name" type="xsd:string" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="data"> <xsd:element name="data">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element minOccurs="0" msdata:Ordinal="1" name="value" type="xsd:string"/> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element minOccurs="0" msdata:Ordinal="2" name="comment" type="xsd:string"/> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute msdata:Ordinal="1" name="name" type="xsd:string" use="required"/> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute msdata:Ordinal="3" name="type" type="xsd:string"/> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute msdata:Ordinal="4" name="mimetype" type="xsd:string"/> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space"/> <xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element minOccurs="0" msdata:Ordinal="1" name="value" type="xsd:string"/> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/> <xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
</xsd:choice> </xsd:choice>
@ -117,409 +117,65 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <data name="SendEmailNoteLabel.Text" xml:space="preserve">
<data name="tableLayoutPanel1.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms"> <value>サーバーによりシステム アラートが生成されたときにメールが送信されるように設定できます。このプールまたはスタンドアロン サーバーでこの機能を有効にするには、アラート通知メールの送信先アドレスを入力してください。</value>
<value>&lt;?xml version="1.0" encoding="utf-16"?>&lt;TableLayoutSettings>&lt;Controls>&lt;Control Name="SendEmailNoteLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" />&lt;Control Name="EmailNotificationCheckBox" Row="1" RowSpan="1" Column="0" ColumnSpan="1" />&lt;Control Name="groupBox1" Row="2" RowSpan="1" Column="0" ColumnSpan="1" />&lt;/Controls>&lt;Columns Styles="Percent,100" />&lt;Rows Styles="AutoSize,0,AutoSize,0,Percent,100,Absolute,20" />&lt;/TableLayoutSettings></value>
</data> </data>
<data name="EmailAddressLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<value>NoControl</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<data name="EmailNotificationCheckBox.Size" type="System.Drawing.Size, System.Drawing"> <data name="EmailNotificationCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>160, 17</value> <value>164, 17</value>
</data> </data>
<data name="EmailNotificationCheckBox.Text" xml:space="preserve"> <data name="EmailNotificationCheckBox.Text" xml:space="preserve">
<value>アラートをメールで送信する(&amp;E)</value> <value>アラートをメールで送信する(&amp;E)</value>
</data> </data>
<data name="SendEmailNoteLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="MailLanguageComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>NoControl</value> <value>113, 71</value>
</data>
<data name="&gt;&gt;SmtpPortLabel.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="tableLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="groupBox1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>22, 5, 3, 3</value>
</data>
<data name="&gt;&gt;MailLanguageComboBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;SmtpServerPortTextBox.Name" xml:space="preserve">
<value>SmtpServerPortTextBox</value>
</data>
<data name="SmtpServerLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>74, 13</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
<data name="EmailNotificationCheckBox.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;SmtpServerLabel.Name" xml:space="preserve">
<value>SmtpServerLabel</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>PerfmonAlertOptionsPage</value>
</data>
<data name="SmtpServerPortTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>388, 45</value>
</data>
<data name="MailLanguageComboBox.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="SmtpPortLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;SmtpPortLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;SmtpServerAddrTextBox.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="SmtpServerPortTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>59, 20</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;EmailAddressTextBox.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="MailLanguageLabel.Text" xml:space="preserve">
<value>メール言語(&amp;L):</value>
</data>
<data name="&gt;&gt;MailLanguageComboBox.Name" xml:space="preserve">
<value>MailLanguageComboBox</value>
</data>
<data name="tableLayoutPanel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="SendEmailNoteLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="&gt;&gt;EmailAddressTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="MailLanguageLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 13</value>
</data>
<data name="tableLayoutPanel1.Size" type="System.Drawing.Size, System.Drawing">
<value>485, 333</value>
</data>
<data name="&gt;&gt;EmailAddressTextBox.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;MailLanguageLabel.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="SmtpServerLabel.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="MailLanguageLabel.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>送信先</value>
</data>
<data name="tableLayoutPanel1.RowCount" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="SmtpServerAddrTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>210, 20</value>
</data>
<data name="SmtpServerLabel.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="&gt;&gt;SmtpServerLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="SmtpPortLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 13</value>
</data>
<data name="SmtpServerPortTextBox.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 0</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="SmtpServerLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="MailLanguageLabel.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="MailLanguageLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;SendEmailNoteLabel.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="tableLayoutPanel1.ColumnCount" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="EmailAddressLabel.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="EmailAddressLabel.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="groupBox1.AutoSizeMode" type="System.Windows.Forms.AutoSizeMode, System.Windows.Forms">
<value>GrowAndShrink</value>
</data>
<data name="MailLanguageComboBox.TabIndex" type="System.Int32, mscorlib">
<value>9</value>
</data>
<data name="EmailNotificationCheckBox.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;EmailAddressLabel.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;SendEmailNoteLabel.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="SmtpServerPortTextBox.Text" xml:space="preserve">
<value>25</value>
</data>
<data name="SmtpServerAddrTextBox.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;SmtpServerAddrTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Type" xml:space="preserve">
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;MailLanguageLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="MailLanguageLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="&gt;&gt;SmtpServerPortTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="SmtpPortLabel.Text" xml:space="preserve">
<value>ポート(&amp;P):</value>
</data>
<data name="SmtpPortLabel.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 0</value>
</data>
<data name="&gt;&gt;EmailAddressLabel.Name" xml:space="preserve">
<value>EmailAddressLabel</value>
</data>
<data name="&gt;&gt;MailLanguageComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;SmtpServerPortTextBox.Parent" xml:space="preserve">
<value>groupBox1</value>
</data> </data>
<data name="MailLanguageComboBox.Size" type="System.Drawing.Size, System.Drawing"> <data name="MailLanguageComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>210, 21</value> <value>210, 21</value>
</data> </data>
<data name="&gt;&gt;SendEmailNoteLabel.Type" xml:space="preserve"> <data name="MailLanguageLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>74, 13</value>
</data> </data>
<data name="SmtpServerLabel.Location" type="System.Drawing.Point, System.Drawing"> <data name="MailLanguageLabel.Text" xml:space="preserve">
<value>8, 48</value> <value>メール言語(&amp;L):</value>
</data> </data>
<data name="&gt;&gt;SmtpServerAddrTextBox.Name" xml:space="preserve"> <data name="SmtpPortLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>SmtpServerAddrTextBox</value> <value>51, 13</value>
</data> </data>
<data name="groupBox1.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms"> <data name="SmtpPortLabel.Text" xml:space="preserve">
<value>5, 9, 5, 0</value> <value>ポート(&amp;P):</value>
</data> </data>
<data name="&gt;&gt;EmailNotificationCheckBox.Parent" xml:space="preserve"> <data name="SmtpServerPortTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>tableLayoutPanel1</value> <value>388, 45</value>
</data> </data>
<data name="&gt;&gt;SendEmailNoteLabel.Name" xml:space="preserve"> <data name="SmtpServerPortTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>SendEmailNoteLabel</value> <value>59, 20</value>
</data>
<data name="&gt;&gt;EmailAddressLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;MailLanguageLabel.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>22, 77</value>
</data>
<data name="SmtpServerLabel.Text" xml:space="preserve">
<value>SMTP サーバー(&amp;S):</value>
</data>
<data name="&gt;&gt;MailLanguageLabel.Name" xml:space="preserve">
<value>MailLanguageLabel</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>455, 108</value>
</data>
<data name="SmtpServerLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="SmtpServerAddrTextBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
<data name="&gt;&gt;SmtpServerLabel.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="SendEmailNoteLabel.Text" xml:space="preserve">
<value>サーバーによりシステム アラートが生成されたときにメールが送信されるように設定できます。このプールまたはスタンドアロン サーバーでこの機能を有効にするには、アラート通知メールの送信先アドレスを入力してください。</value>
</data>
<data name="SendEmailNoteLabel.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 10</value>
</data> </data>
<data name="EmailAddressTextBox.Location" type="System.Drawing.Point, System.Drawing"> <data name="EmailAddressTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>113, 19</value> <value>113, 19</value>
</data> </data>
<data name="MailLanguageComboBox.Location" type="System.Drawing.Point, System.Drawing"> <data name="EmailAddressTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>113, 71</value> <value>334, 20</value>
</data> </data>
<data name="EmailAddressLabel.AutoSize" type="System.Boolean, mscorlib"> <data name="EmailAddressLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>True</value> <value>92, 13</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Name" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;MailLanguageComboBox.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;SmtpServerAddrTextBox.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>XenAdmin.Controls.DecentGroupBox, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;EmailNotificationCheckBox.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="SmtpServerPortTextBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="EmailAddressTextBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
<data name="&gt;&gt;SmtpServerLabel.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="EmailNotificationCheckBox.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="&gt;&gt;SmtpPortLabel.Name" xml:space="preserve">
<value>SmtpPortLabel</value>
</data>
<data name="MailLanguageLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 74</value>
</data>
<data name="SmtpServerPortTextBox.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data> </data>
<data name="EmailAddressLabel.Text" xml:space="preserve"> <data name="EmailAddressLabel.Text" xml:space="preserve">
<value>メール アドレス(&amp;M):</value> <value>メール アドレス(&amp;M):</value>
</data> </data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>485, 333</value>
</data>
<data name="MailLanguageLabel.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
</data>
<data name="&gt;&gt;EmailAddressLabel.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="SmtpPortLabel.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="SmtpPortLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>330, 48</value>
</data>
<data name="EmailAddressTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>334, 20</value>
</data>
<data name="SmtpServerAddrTextBox.Location" type="System.Drawing.Point, System.Drawing"> <data name="SmtpServerAddrTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>113, 45</value> <value>113, 45</value>
</data> </data>
<data name="EmailAddressLabel.Size" type="System.Drawing.Size, System.Drawing"> <data name="SmtpServerAddrTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 13</value> <value>210, 20</value>
</data> </data>
<data name="SendEmailNoteLabel.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="SmtpServerLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>Fill</value> <value>96, 13</value>
</data> </data>
<data name="SendEmailNoteLabel.TabIndex" type="System.Int32, mscorlib"> <data name="SmtpServerLabel.Text" xml:space="preserve">
<value>32</value> <value>SMTP サーバー(&amp;S):</value>
</data> </data>
<data name="EmailAddressTextBox.TabIndex" type="System.Int32, mscorlib"> <data name="groupBox1.Text" xml:space="preserve">
<value>3</value> <value>送信先</value>
</data> </data>
<data name="SendEmailNoteLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;SmtpPortLabel.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="groupBox1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;EmailNotificationCheckBox.Name" xml:space="preserve">
<value>EmailNotificationCheckBox</value>
</data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="SmtpPortLabel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="&gt;&gt;EmailNotificationCheckBox.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="SmtpPortLabel.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="&gt;&gt;SmtpServerPortTextBox.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="SmtpServerAddrTextBox.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 0</value>
</data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="EmailAddressLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 22</value>
</data>
<data name="MailLanguageComboBox.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms">
<value>No</value>
</data>
<data name="SendEmailNoteLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>485, 39</value>
</data>
<data name="tableLayoutPanel1.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="EmailNotificationCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 52</value>
</data>
<data name="&gt;&gt;EmailAddressTextBox.Name" xml:space="preserve">
<value>EmailAddressTextBox</value>
</data>
<data name="SmtpPortLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>96, 96</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>ja</value>
</metadata>
</root> </root>

View File

@ -117,409 +117,394 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="tableLayoutPanel1.ColumnCount" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="SendEmailNoteLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="tableLayoutPanel1.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms"> <data name="SendEmailNoteLabel.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="SendEmailNoteLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="EmailNotificationCheckBox" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="groupBox1" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,Percent,100,Absolute,20" /&gt;&lt;/TableLayoutSettings&gt;</value> <value>Fill</value>
</data>
<data name="EmailAddressLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="EmailNotificationCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>160, 17</value>
</data>
<data name="EmailNotificationCheckBox.Text" xml:space="preserve">
<value>Send &amp;email alert notifications</value>
</data> </data>
<data name="SendEmailNoteLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="SendEmailNoteLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="&gt;&gt;SmtpPortLabel.ZOrder" xml:space="preserve"> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<value>2</value> <data name="SendEmailNoteLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data> </data>
<data name="tableLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms"> <data name="SendEmailNoteLabel.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>Fill</value> <value>0, 0, 0, 10</value>
</data> </data>
<data name="groupBox1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms"> <data name="SendEmailNoteLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>22, 5, 3, 3</value> <value>485, 26</value>
</data> </data>
<data name="&gt;&gt;MailLanguageComboBox.ZOrder" xml:space="preserve"> <data name="SendEmailNoteLabel.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="SendEmailNoteLabel.Text" xml:space="preserve">
<value>If you want to be notified via email when alerts are generated for your system's resources, enter an address where email notifications will be sent.</value>
</data>
<data name="&gt;&gt;SendEmailNoteLabel.Name" xml:space="preserve">
<value>SendEmailNoteLabel</value>
</data>
<data name="&gt;&gt;SendEmailNoteLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;SendEmailNoteLabel.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;SendEmailNoteLabel.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<data name="&gt;&gt;SmtpServerPortTextBox.Name" xml:space="preserve"> <data name="EmailNotificationCheckBox.AutoSize" type="System.Boolean, mscorlib">
<value>SmtpServerPortTextBox</value> <value>True</value>
</data> </data>
<data name="SmtpServerLabel.Size" type="System.Drawing.Size, System.Drawing"> <data name="EmailNotificationCheckBox.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>74, 13</value> <value>NoControl</value>
</data>
<data name="EmailNotificationCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 39</value>
</data>
<data name="EmailNotificationCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>160, 17</value>
</data> </data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="EmailNotificationCheckBox.TabIndex" type="System.Int32, mscorlib"> <data name="EmailNotificationCheckBox.TabIndex" type="System.Int32, mscorlib">
<value>0</value> <value>0</value>
</data> </data>
<data name="&gt;&gt;SmtpServerLabel.Name" xml:space="preserve"> <data name="EmailNotificationCheckBox.Text" xml:space="preserve">
<value>SmtpServerLabel</value> <value>Send email alert &amp;notifications</value>
</data> </data>
<data name="&gt;&gt;$this.Name" xml:space="preserve"> <data name="&gt;&gt;EmailNotificationCheckBox.Name" xml:space="preserve">
<value>PerfmonAlertOptionsPage</value> <value>EmailNotificationCheckBox</value>
</data> </data>
<data name="SmtpServerPortTextBox.Location" type="System.Drawing.Point, System.Drawing"> <data name="&gt;&gt;EmailNotificationCheckBox.Type" xml:space="preserve">
<value>368, 45</value> <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;EmailNotificationCheckBox.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;EmailNotificationCheckBox.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="groupBox1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="groupBox1.AutoSizeMode" type="System.Windows.Forms.AutoSizeMode, System.Windows.Forms">
<value>GrowAndShrink</value>
</data>
<data name="MailLanguageComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>100, 71</value>
</data>
<data name="MailLanguageComboBox.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms">
<value>No</value>
</data>
<data name="MailLanguageComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 21</value>
</data>
<data name="MailLanguageComboBox.TabIndex" type="System.Int32, mscorlib">
<value>9</value>
</data> </data>
<data name="MailLanguageComboBox.Visible" type="System.Boolean, mscorlib"> <data name="MailLanguageComboBox.Visible" type="System.Boolean, mscorlib">
<value>False</value> <value>False</value>
</data> </data>
<data name="SmtpPortLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;SmtpPortLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;SmtpServerAddrTextBox.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="SmtpServerPortTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>79, 20</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;EmailAddressTextBox.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="MailLanguageLabel.Text" xml:space="preserve">
<value>Mail &amp;language:</value>
</data>
<data name="&gt;&gt;MailLanguageComboBox.Name" xml:space="preserve"> <data name="&gt;&gt;MailLanguageComboBox.Name" xml:space="preserve">
<value>MailLanguageComboBox</value> <value>MailLanguageComboBox</value>
</data> </data>
<data name="tableLayoutPanel1.Location" type="System.Drawing.Point, System.Drawing"> <data name="&gt;&gt;MailLanguageComboBox.Type" xml:space="preserve">
<value>0, 0</value> <value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="SendEmailNoteLabel.Location" type="System.Drawing.Point, System.Drawing"> <data name="&gt;&gt;MailLanguageComboBox.Parent" xml:space="preserve">
<value>0, 0</value> <value>groupBox1</value>
</data> </data>
<data name="&gt;&gt;EmailAddressTextBox.Type" xml:space="preserve"> <data name="&gt;&gt;MailLanguageComboBox.ZOrder" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>0</value>
</data>
<data name="MailLanguageLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="MailLanguageLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="MailLanguageLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 74</value>
</data> </data>
<data name="MailLanguageLabel.Size" type="System.Drawing.Size, System.Drawing"> <data name="MailLanguageLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 13</value> <value>76, 13</value>
</data> </data>
<data name="tableLayoutPanel1.Size" type="System.Drawing.Size, System.Drawing"> <data name="MailLanguageLabel.TabIndex" type="System.Int32, mscorlib">
<value>485, 333</value> <value>8</value>
</data> </data>
<data name="&gt;&gt;EmailAddressTextBox.Parent" xml:space="preserve"> <data name="MailLanguageLabel.Text" xml:space="preserve">
<value>&amp;Mail language:</value>
</data>
<data name="MailLanguageLabel.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;MailLanguageLabel.Name" xml:space="preserve">
<value>MailLanguageLabel</value>
</data>
<data name="&gt;&gt;MailLanguageLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;MailLanguageLabel.Parent" xml:space="preserve">
<value>groupBox1</value> <value>groupBox1</value>
</data> </data>
<data name="&gt;&gt;MailLanguageLabel.ZOrder" xml:space="preserve"> <data name="&gt;&gt;MailLanguageLabel.ZOrder" xml:space="preserve">
<value>1</value> <value>1</value>
</data> </data>
<data name="SmtpServerLabel.TabIndex" type="System.Int32, mscorlib"> <data name="SmtpPortLabel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>4</value> <value>Top, Right</value>
</data> </data>
<data name="MailLanguageLabel.Visible" type="System.Boolean, mscorlib"> <data name="SmtpPortLabel.AutoSize" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="groupBox1.Text" xml:space="preserve">
<value>Delivery address</value>
</data>
<data name="tableLayoutPanel1.RowCount" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="SmtpServerAddrTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 20</value>
</data>
<data name="SmtpServerLabel.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="&gt;&gt;SmtpServerLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="SmtpPortLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>29, 13</value>
</data>
<data name="SmtpServerPortTextBox.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 0</value>
</data>
<data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>31</value>
</data>
<data name="SmtpServerLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
<data name="MailLanguageLabel.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing"> <data name="SmtpPortLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>MiddleLeft</value>
</data>
<data name="MailLanguageLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;SendEmailNoteLabel.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="tableLayoutPanel1.ColumnCount" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="EmailAddressLabel.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="EmailAddressLabel.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="groupBox1.AutoSizeMode" type="System.Windows.Forms.AutoSizeMode, System.Windows.Forms">
<value>GrowAndShrink</value>
</data>
<data name="MailLanguageComboBox.TabIndex" type="System.Int32, mscorlib">
<value>9</value>
</data>
<data name="EmailNotificationCheckBox.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;EmailAddressLabel.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;SendEmailNoteLabel.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="SmtpServerPortTextBox.Text" xml:space="preserve">
<value>25</value>
</data>
<data name="SmtpServerAddrTextBox.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;SmtpServerAddrTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Type" xml:space="preserve">
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;MailLanguageLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="MailLanguageLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value> <value>NoControl</value>
</data> </data>
<data name="&gt;&gt;SmtpServerPortTextBox.Type" xml:space="preserve"> <data name="SmtpPortLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>330, 48</value>
</data>
<data name="SmtpPortLabel.Text" xml:space="preserve">
<value>&amp;Port:</value>
</data> </data>
<data name="SmtpPortLabel.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms"> <data name="SmtpPortLabel.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 0</value> <value>0, 0, 0, 0</value>
</data> </data>
<data name="&gt;&gt;EmailAddressLabel.Name" xml:space="preserve"> <data name="SmtpPortLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>EmailAddressLabel</value> <value>29, 13</value>
</data> </data>
<data name="&gt;&gt;MailLanguageComboBox.Type" xml:space="preserve"> <data name="SmtpPortLabel.TabIndex" type="System.Int32, mscorlib">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>6</value>
</data>
<data name="SmtpPortLabel.Text" xml:space="preserve">
<value>&amp;Port:</value>
</data>
<data name="&gt;&gt;SmtpPortLabel.Name" xml:space="preserve">
<value>SmtpPortLabel</value>
</data>
<data name="&gt;&gt;SmtpPortLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;SmtpPortLabel.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;SmtpPortLabel.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="SmtpServerPortTextBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="SmtpServerPortTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>368, 45</value>
</data>
<data name="SmtpServerPortTextBox.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 0</value>
</data>
<data name="SmtpServerPortTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>79, 20</value>
</data>
<data name="SmtpServerPortTextBox.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="SmtpServerPortTextBox.Text" xml:space="preserve">
<value>25</value>
</data>
<data name="&gt;&gt;SmtpServerPortTextBox.Name" xml:space="preserve">
<value>SmtpServerPortTextBox</value>
</data>
<data name="&gt;&gt;SmtpServerPortTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;SmtpServerPortTextBox.Parent" xml:space="preserve"> <data name="&gt;&gt;SmtpServerPortTextBox.Parent" xml:space="preserve">
<value>groupBox1</value> <value>groupBox1</value>
</data> </data>
<data name="MailLanguageComboBox.Size" type="System.Drawing.Size, System.Drawing"> <data name="&gt;&gt;SmtpServerPortTextBox.ZOrder" xml:space="preserve">
<value>220, 21</value> <value>3</value>
</data> </data>
<data name="&gt;&gt;SendEmailNoteLabel.Type" xml:space="preserve"> <data name="EmailAddressTextBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="SmtpServerLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 48</value>
</data>
<data name="&gt;&gt;SmtpServerAddrTextBox.Name" xml:space="preserve">
<value>SmtpServerAddrTextBox</value>
</data>
<data name="groupBox1.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>5, 9, 5, 0</value>
</data>
<data name="&gt;&gt;EmailNotificationCheckBox.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;SendEmailNoteLabel.Name" xml:space="preserve">
<value>SendEmailNoteLabel</value>
</data>
<data name="&gt;&gt;EmailAddressLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;MailLanguageLabel.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>22, 77</value>
</data>
<data name="SmtpServerLabel.Text" xml:space="preserve">
<value>&amp;SMTP Server:</value>
</data>
<data name="&gt;&gt;MailLanguageLabel.Name" xml:space="preserve">
<value>MailLanguageLabel</value>
</data>
<data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>455, 108</value>
</data>
<data name="SmtpServerLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="SmtpServerAddrTextBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value> <value>Top, Left, Right</value>
</data> </data>
<data name="&gt;&gt;SmtpServerLabel.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="SendEmailNoteLabel.Text" xml:space="preserve">
<value>The server can update you by email regarding system alerts that are being generated by your managed servers. To enable this feature, enter an address where email notifications will be sent for the servers and VMs in this pool (or for this standalone server).</value>
</data>
<data name="SendEmailNoteLabel.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 10</value>
</data>
<data name="EmailAddressTextBox.Location" type="System.Drawing.Point, System.Drawing"> <data name="EmailAddressTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>100, 19</value> <value>100, 19</value>
</data> </data>
<data name="MailLanguageComboBox.Location" type="System.Drawing.Point, System.Drawing"> <data name="EmailAddressTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 71</value> <value>347, 20</value>
</data>
<data name="EmailAddressTextBox.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="&gt;&gt;EmailAddressTextBox.Name" xml:space="preserve">
<value>EmailAddressTextBox</value>
</data>
<data name="&gt;&gt;EmailAddressTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;EmailAddressTextBox.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;EmailAddressTextBox.ZOrder" xml:space="preserve">
<value>4</value>
</data> </data>
<data name="EmailAddressLabel.AutoSize" type="System.Boolean, mscorlib"> <data name="EmailAddressLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
<data name="&gt;&gt;tableLayoutPanel1.Name" xml:space="preserve"> <data name="EmailAddressLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>tableLayoutPanel1</value> <value>NoControl</value>
</data> </data>
<data name="&gt;&gt;MailLanguageComboBox.Parent" xml:space="preserve"> <data name="EmailAddressLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 22</value>
</data>
<data name="EmailAddressLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 13</value>
</data>
<data name="EmailAddressLabel.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="EmailAddressLabel.Text" xml:space="preserve">
<value>&amp;Email address:</value>
</data>
<data name="&gt;&gt;EmailAddressLabel.Name" xml:space="preserve">
<value>EmailAddressLabel</value>
</data>
<data name="&gt;&gt;EmailAddressLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;EmailAddressLabel.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="&gt;&gt;EmailAddressLabel.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="SmtpServerAddrTextBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
<data name="SmtpServerAddrTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>100, 45</value>
</data>
<data name="SmtpServerAddrTextBox.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 0</value>
</data>
<data name="SmtpServerAddrTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>220, 20</value>
</data>
<data name="SmtpServerAddrTextBox.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;SmtpServerAddrTextBox.Name" xml:space="preserve">
<value>SmtpServerAddrTextBox</value>
</data>
<data name="&gt;&gt;SmtpServerAddrTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;SmtpServerAddrTextBox.Parent" xml:space="preserve">
<value>groupBox1</value> <value>groupBox1</value>
</data> </data>
<data name="&gt;&gt;SmtpServerAddrTextBox.ZOrder" xml:space="preserve"> <data name="&gt;&gt;SmtpServerAddrTextBox.ZOrder" xml:space="preserve">
<value>6</value> <value>6</value>
</data> </data>
<data name="&gt;&gt;groupBox1.Type" xml:space="preserve"> <data name="SmtpServerLabel.AutoSize" type="System.Boolean, mscorlib">
<value>XenAdmin.Controls.DecentGroupBox, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value> <value>True</value>
</data> </data>
<data name="&gt;&gt;EmailNotificationCheckBox.ZOrder" xml:space="preserve"> <data name="SmtpServerLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>1</value> <value>NoControl</value>
</data> </data>
<data name="SmtpServerPortTextBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <data name="SmtpServerLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>Top, Right</value> <value>8, 48</value>
</data> </data>
<data name="EmailAddressTextBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <data name="SmtpServerLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>Top, Left, Right</value> <value>74, 13</value>
</data>
<data name="SmtpServerLabel.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="SmtpServerLabel.Text" xml:space="preserve">
<value>&amp;SMTP Server:</value>
</data>
<data name="&gt;&gt;SmtpServerLabel.Name" xml:space="preserve">
<value>SmtpServerLabel</value>
</data>
<data name="&gt;&gt;SmtpServerLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;SmtpServerLabel.Parent" xml:space="preserve"> <data name="&gt;&gt;SmtpServerLabel.Parent" xml:space="preserve">
<value>groupBox1</value> <value>groupBox1</value>
</data> </data>
<data name="EmailNotificationCheckBox.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="&gt;&gt;SmtpServerLabel.ZOrder" xml:space="preserve">
<value>NoControl</value>
</data>
<data name="&gt;&gt;SmtpPortLabel.Name" xml:space="preserve">
<value>SmtpPortLabel</value>
</data>
<data name="MailLanguageLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 74</value>
</data>
<data name="SmtpServerPortTextBox.TabIndex" type="System.Int32, mscorlib">
<value>7</value> <value>7</value>
</data> </data>
<data name="EmailAddressLabel.Text" xml:space="preserve"> <data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>E&amp;mail address:</value> <value>22, 64</value>
</data> </data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing"> <data name="groupBox1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>485, 333</value> <value>22, 5, 3, 3</value>
</data> </data>
<data name="MailLanguageLabel.TabIndex" type="System.Int32, mscorlib"> <data name="groupBox1.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>8</value> <value>5, 9, 5, 0</value>
</data> </data>
<data name="&gt;&gt;EmailAddressLabel.ZOrder" xml:space="preserve"> <data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>5</value> <value>455, 108</value>
</data> </data>
<data name="SmtpPortLabel.TabIndex" type="System.Int32, mscorlib"> <data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
<value>6</value> <value>31</value>
</data> </data>
<data name="SmtpPortLabel.Location" type="System.Drawing.Point, System.Drawing"> <data name="groupBox1.Text" xml:space="preserve">
<value>330, 48</value> <value>Delivery address</value>
</data>
<data name="EmailAddressTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>347, 20</value>
</data>
<data name="SmtpServerAddrTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>100, 45</value>
</data>
<data name="EmailAddressLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 13</value>
</data>
<data name="SendEmailNoteLabel.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="SendEmailNoteLabel.TabIndex" type="System.Int32, mscorlib">
<value>32</value>
</data>
<data name="EmailAddressTextBox.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="SendEmailNoteLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;SmtpPortLabel.Parent" xml:space="preserve">
<value>groupBox1</value>
</data>
<data name="groupBox1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;EmailNotificationCheckBox.Name" xml:space="preserve">
<value>EmailNotificationCheckBox</value>
</data> </data>
<data name="&gt;&gt;groupBox1.Name" xml:space="preserve"> <data name="&gt;&gt;groupBox1.Name" xml:space="preserve">
<value>groupBox1</value> <value>groupBox1</value>
</data> </data>
<data name="SmtpPortLabel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <data name="&gt;&gt;groupBox1.Type" xml:space="preserve">
<value>Top, Right</value> <value>XenAdmin.Controls.DecentGroupBox, [XenCenter_No_Space], Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;EmailNotificationCheckBox.Type" xml:space="preserve"> <data name="&gt;&gt;groupBox1.Parent" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>tableLayoutPanel1</value>
</data>
<data name="SmtpPortLabel.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="&gt;&gt;SmtpServerPortTextBox.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="SmtpServerAddrTextBox.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 3, 3, 0</value>
</data> </data>
<data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve"> <data name="&gt;&gt;groupBox1.ZOrder" xml:space="preserve">
<value>2</value> <value>2</value>
</data> </data>
<data name="&gt;&gt;$this.Type" xml:space="preserve"> <data name="tableLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>Fill</value>
</data> </data>
<data name="EmailAddressLabel.Location" type="System.Drawing.Point, System.Drawing"> <data name="tableLayoutPanel1.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 22</value> <value>0, 0</value>
</data> </data>
<data name="MailLanguageComboBox.RightToLeft" type="System.Windows.Forms.RightToLeft, System.Windows.Forms"> <data name="tableLayoutPanel1.RowCount" type="System.Int32, mscorlib">
<value>No</value> <value>3</value>
</data> </data>
<data name="SendEmailNoteLabel.Size" type="System.Drawing.Size, System.Drawing"> <data name="tableLayoutPanel1.Size" type="System.Drawing.Size, System.Drawing">
<value>485, 39</value> <value>485, 333</value>
</data> </data>
<data name="tableLayoutPanel1.TabIndex" type="System.Int32, mscorlib"> <data name="tableLayoutPanel1.TabIndex" type="System.Int32, mscorlib">
<value>32</value> <value>32</value>
</data> </data>
<data name="EmailNotificationCheckBox.Location" type="System.Drawing.Point, System.Drawing"> <data name="&gt;&gt;tableLayoutPanel1.Name" xml:space="preserve">
<value>3, 52</value> <value>tableLayoutPanel1</value>
</data> </data>
<data name="&gt;&gt;EmailAddressTextBox.Name" xml:space="preserve"> <data name="&gt;&gt;tableLayoutPanel1.Type" xml:space="preserve">
<value>EmailAddressTextBox</value> <value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="SmtpPortLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms"> <data name="&gt;&gt;tableLayoutPanel1.Parent" xml:space="preserve">
<value>NoControl</value> <value>$this</value>
</data> </data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing"> <data name="&gt;&gt;tableLayoutPanel1.ZOrder" xml:space="preserve">
<value>96, 96</value> <value>0</value>
</data>
<data name="tableLayoutPanel1.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="SendEmailNoteLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="EmailNotificationCheckBox" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="groupBox1" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,Percent,100,Absolute,20" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data> </data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>ja</value> <value>96, 96</value>
</metadata> </data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>485, 333</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>PerfmonAlertOptionsPage</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root> </root>

View File

@ -469,7 +469,6 @@ namespace XenAdmin.Wizards.CrossPoolMigrateWizard
summary = new VmTitleSummary(summary, pair.Value); summary = new VmTitleSummary(summary, pair.Value);
summary = new DestinationPoolSummary(summary, pair.Value, TargetConnection); summary = new DestinationPoolSummary(summary, pair.Value, TargetConnection);
summary = new TargetServerSummary(summary, pair.Value, TargetConnection);
summary = new TransferNetworkSummary(summary, m_pageTransferNetwork.NetworkUuid.Value); summary = new TransferNetworkSummary(summary, m_pageTransferNetwork.NetworkUuid.Value);
summary = new StorageSummary(summary, pair.Value, xenConnection); summary = new StorageSummary(summary, pair.Value, xenConnection);
summary = new NetworkSummary(summary, pair.Value, xenConnection); summary = new NetworkSummary(summary, pair.Value, xenConnection);

View File

@ -129,8 +129,8 @@
// //
// pictureBox1 // pictureBox1
// //
resources.ApplyResources(this.pictureBox1, "pictureBox1");
this.pictureBox1.Image = global::XenAdmin.Properties.Resources._000_WarningAlert_h32bit_32; this.pictureBox1.Image = global::XenAdmin.Properties.Resources._000_WarningAlert_h32bit_32;
resources.ApplyResources(this.pictureBox1, "pictureBox1");
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
// //

View File

@ -49,7 +49,6 @@ namespace XenAdmin.Wizards.GenericPages
internal abstract partial class SelectMultipleVMDestinationPage : XenTabPage internal abstract partial class SelectMultipleVMDestinationPage : XenTabPage
{ {
private Dictionary<string, VmMapping> m_vmMappings; private Dictionary<string, VmMapping> m_vmMappings;
public IXenObject SelectedTarget { get; set; }
private bool updatingDestinationCombobox; private bool updatingDestinationCombobox;
private bool restoreGridHomeServerSelection; private bool restoreGridHomeServerSelection;
private bool updatingHomeServerList; private bool updatingHomeServerList;
@ -58,6 +57,7 @@ namespace XenAdmin.Wizards.GenericPages
private readonly CollectionChangeEventHandler Host_CollectionChangedWithInvoke; private readonly CollectionChangeEventHandler Host_CollectionChangedWithInvoke;
private string _preferredHomeRef; private string _preferredHomeRef;
private IXenObject _selectedTargetPool; private IXenObject _selectedTargetPool;
private IXenObject _selectedTarget;
#region Nested classes #region Nested classes
@ -121,8 +121,24 @@ namespace XenAdmin.Wizards.GenericPages
get => _selectedTargetPool; get => _selectedTargetPool;
private set private set
{ {
var oldTargetPool = _selectedTargetPool;
_selectedTargetPool = value; _selectedTargetPool = value;
OnChosenItemChanged();
if (oldTargetPool?.opaque_ref != _selectedTargetPool?.opaque_ref)
OnSelectedTargetPoolChanged();
}
}
public IXenObject SelectedTarget
{
get => _selectedTarget;
set
{
var oldTarget = _selectedTarget;
_selectedTarget = value;
if (oldTarget?.opaque_ref != SelectedTarget?.opaque_ref)
OnSelectedTargetChanged();
} }
} }
@ -143,9 +159,14 @@ namespace XenAdmin.Wizards.GenericPages
/// </summary> /// </summary>
protected abstract string TargetServerSelectionIntroText { get; } protected abstract string TargetServerSelectionIntroText { get; }
protected virtual void OnChosenItemChanged() protected virtual void OnSelectedTargetPoolChanged()
{ } { }
protected virtual void OnSelectedTargetChanged()
{
}
protected void ShowWarning(string warningText) protected void ShowWarning(string warningText)
{ {
if (string.IsNullOrEmpty(warningText)) if (string.IsNullOrEmpty(warningText))
@ -208,15 +229,15 @@ namespace XenAdmin.Wizards.GenericPages
{ {
foreach (DataGridViewRow row in m_dataGridView.Rows) foreach (DataGridViewRow row in m_dataGridView.Rows)
{ {
string sysId = (string)row.Cells[0].Tag; var sysId = (string)row.Cells[0].Tag;
if (m_vmMappings.ContainsKey(sysId)) if (m_vmMappings.ContainsKey(sysId))
{ {
var mapping = m_vmMappings[sysId]; var mapping = m_vmMappings[sysId];
DataGridViewEnableableComboBoxCell cbCell = row.Cells[m_colTarget.Index] as DataGridViewEnableableComboBoxCell; var cbCell = row.Cells[m_colTarget.Index] as DataGridViewEnableableComboBoxCell;
System.Diagnostics.Debug.Assert(cbCell != null, "ComboBox cell was not found"); System.Diagnostics.Debug.Assert(cbCell != null, "ComboBox cell was not found");
IEnableableXenObjectComboBoxItem selectedItem = cbCell.Value as IEnableableXenObjectComboBoxItem; var selectedItem = cbCell.Value as IEnableableXenObjectComboBoxItem;
System.Diagnostics.Debug.Assert(selectedItem != null, "Vm has no target mapped"); System.Diagnostics.Debug.Assert(selectedItem != null, "Vm has no target mapped");
var type = selectedItem.Item.GetType(); var type = selectedItem.Item.GetType();
@ -231,7 +252,7 @@ namespace XenAdmin.Wizards.GenericPages
return m_vmMappings; return m_vmMappings;
} }
set { m_vmMappings = value; } set => m_vmMappings = value;
} }
#endregion #endregion
@ -257,8 +278,7 @@ namespace XenAdmin.Wizards.GenericPages
foreach (var item in m_comboBoxConnection.Items) foreach (var item in m_comboBoxConnection.Items)
{ {
DelayLoadingOptionComboBoxItem tempItem = item as DelayLoadingOptionComboBoxItem; if (item is DelayLoadingOptionComboBoxItem tempItem)
if (tempItem != null)
tempItem.ReasonUpdated -= DelayLoadedComboBoxItem_ReasonChanged; tempItem.ReasonUpdated -= DelayLoadedComboBoxItem_ReasonChanged;
} }
m_comboBoxConnection.Items.Clear(); m_comboBoxConnection.Items.Clear();
@ -290,11 +310,11 @@ namespace XenAdmin.Wizards.GenericPages
{ {
DelayLoadingOptionComboBoxItem item = null; DelayLoadingOptionComboBoxItem item = null;
Pool pool = Helpers.GetPool(xenConnection); var pool = Helpers.GetPool(xenConnection);
if (pool == null) if (pool == null)
{ {
Host host = Helpers.GetCoordinator(xenConnection); var host = Helpers.GetCoordinator(xenConnection);
if (host != null) if (host != null)
{ {
@ -345,7 +365,7 @@ namespace XenAdmin.Wizards.GenericPages
{ {
foreach (DataGridViewRow row in m_dataGridView.Rows) foreach (DataGridViewRow row in m_dataGridView.Rows)
{ {
string sysId = (string)row.Cells[m_colVmName.Index].Tag; var sysId = (string)row.Cells[m_colVmName.Index].Tag;
if (m_vmMappings.TryGetValue(sysId, out var mapping) && if (m_vmMappings.TryGetValue(sysId, out var mapping) &&
row.Cells[m_colTarget.Index] is DataGridViewEnableableComboBoxCell cbCell) row.Cells[m_colTarget.Index] is DataGridViewEnableableComboBoxCell cbCell)
@ -485,17 +505,16 @@ namespace XenAdmin.Wizards.GenericPages
Program.Invoke(this, () => Program.Invoke(this, () =>
{ {
int index = m_comboBoxConnection.Items.IndexOf(item); var index = m_comboBoxConnection.Items.IndexOf(item);
if (index < 0 || index >= m_comboBoxConnection.Items.Count) if (index < 0 || index >= m_comboBoxConnection.Items.Count)
return; return;
if (updatingDestinationCombobox || updatingHomeServerList) if (updatingDestinationCombobox || updatingHomeServerList)
return; return;
int selectedIndex = m_comboBoxConnection.SelectedIndex; var selectedIndex = m_comboBoxConnection.SelectedIndex;
var tempItem = m_comboBoxConnection.Items[index] as DelayLoadingOptionComboBoxItem; if (!(m_comboBoxConnection.Items[index] is DelayLoadingOptionComboBoxItem tempItem))
if (tempItem == null)
throw new NullReferenceException("Trying to update delay loaded reason but failed to extract reason"); throw new NullReferenceException("Trying to update delay loaded reason but failed to extract reason");
tempItem.CopyFrom(item); tempItem.CopyFrom(item);
@ -527,8 +546,7 @@ namespace XenAdmin.Wizards.GenericPages
if (item == null) if (item == null)
throw new NullReferenceException("Trying to update delay loaded reason but failed to extract reason"); throw new NullReferenceException("Trying to update delay loaded reason but failed to extract reason");
var cb = item.ParentComboBox as DataGridViewEnableableComboBoxCell; if (!(item.ParentComboBox is DataGridViewEnableableComboBoxCell cb))
if (cb == null)
return; return;
Program.Invoke(this, () => Program.Invoke(this, () =>
@ -595,7 +613,7 @@ namespace XenAdmin.Wizards.GenericPages
//If the item is delay loading and them item is disabled, null the selection made //If the item is delay loading and them item is disabled, null the selection made
//and clear the table containing server data //and clear the table containing server data
IEnableableXenObjectComboBoxItem item = m_comboBoxConnection.SelectedItem as IEnableableXenObjectComboBoxItem; var item = m_comboBoxConnection.SelectedItem as IEnableableXenObjectComboBoxItem;
if (item != null && !item.Enabled) if (item != null && !item.Enabled)
{ {
m_comboBoxConnection.SelectedIndex = -1; m_comboBoxConnection.SelectedIndex = -1;
@ -604,8 +622,7 @@ namespace XenAdmin.Wizards.GenericPages
return; return;
} }
AddHostRunningComboBoxItem exeItem = m_comboBoxConnection.SelectedItem as AddHostRunningComboBoxItem; if (m_comboBoxConnection.SelectedItem is AddHostRunningComboBoxItem exeItem && !updatingDestinationCombobox)
if (exeItem != null && !updatingDestinationCombobox)
exeItem.RunCommand(this); exeItem.RunCommand(this);
else if (!updatingDestinationCombobox) else if (!updatingDestinationCombobox)
@ -643,8 +660,7 @@ namespace XenAdmin.Wizards.GenericPages
m_dataGridView.BeginEdit(false); m_dataGridView.BeginEdit(false);
var editingControl = m_dataGridView.EditingControl as ComboBox; if (m_dataGridView.EditingControl is ComboBox editingControl)
if (editingControl != null)
editingControl.DroppedDown = true; editingControl.DroppedDown = true;
} }
@ -699,8 +715,7 @@ namespace XenAdmin.Wizards.GenericPages
{ {
foreach (var item in m_comboBoxConnection.Items) foreach (var item in m_comboBoxConnection.Items)
{ {
DelayLoadingOptionComboBoxItem comboBoxItem = item as DelayLoadingOptionComboBoxItem; if (item is DelayLoadingOptionComboBoxItem comboBoxItem)
if (comboBoxItem != null)
comboBoxItem.CancelFilters(); comboBoxItem.CancelFilters();
} }
} }

View File

@ -300,9 +300,6 @@
<data name="tableLayoutPanelWarning.ColumnCount" type="System.Int32, mscorlib"> <data name="tableLayoutPanelWarning.ColumnCount" type="System.Int32, mscorlib">
<value>2</value> <value>2</value>
</data> </data>
<data name="pictureBox1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Left</value>
</data>
<data name="pictureBox1.Location" type="System.Drawing.Point, System.Drawing"> <data name="pictureBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 3</value> <value>3, 3</value>
</data> </data>

View File

@ -166,46 +166,6 @@ namespace XenAdmin.Wizards.GenericPages
} }
} }
public class TargetServerSummary : MappingSummaryDecorator
{
private readonly VmMapping mapping;
private readonly IXenConnection connection;
public TargetServerSummary(MappingSummary summary, VmMapping mapping, IXenConnection connection)
: base(summary)
{
this.mapping = mapping;
this.connection = connection;
}
public override List<SummaryDetails> Details
{
get
{
List<SummaryDetails> decoratedSummary = summary.Details;
decoratedSummary.Add(new SummaryDetails(Messages.CPM_SUMMARY_KEY_HOME_SERVER, ResolveLabel()));
return decoratedSummary;
}
}
private string ResolveLabel()
{
if (mapping.XenRef is XenRef<Host>)
{
Host targetHost = connection.Resolve(mapping.XenRef as XenRef<Host>);
if (targetHost == null)
{
return Messages.UNKNOWN;
}
return mapping.TargetName;
}
return Messages.CPM_SUMMARY_UNSET;
}
}
public class StorageSummary : MappingSummaryDecorator public class StorageSummary : MappingSummaryDecorator
{ {
private readonly VmMapping mapping; private readonly VmMapping mapping;
@ -355,9 +315,6 @@ namespace XenAdmin.Wizards.GenericPages
this.summary = summary; this.summary = summary;
} }
public override List<SummaryDetails> Details public override List<SummaryDetails> Details => summary != null ? summary.Details : new List<SummaryDetails>();
{
get { return summary != null ? summary.Details : new List<SummaryDetails>(); }
}
} }
} }

View File

@ -87,10 +87,17 @@ namespace XenAdmin.Wizards.ImportWizard
public Func<IEnumerable<KeyValuePair<string, string>>> SummaryRetriever { private get; set; } public Func<IEnumerable<KeyValuePair<string, string>>> SummaryRetriever { private get; set; }
private bool _canStartVmsAutomatically = true;
public bool CanStartVmsAutomatically
{
get => _canStartVmsAutomatically;
set => _canStartVmsAutomatically = m_checkBoxStartVms.Enabled = m_checkBoxStartVms.Checked = value;
}
/// <summary> /// <summary>
/// Do the action described after the import/export has finished? /// Do the action described after the import/export has finished?
/// </summary> /// </summary>
public bool StartVmsAutomatically => m_checkBoxStartVms.Visible && m_checkBoxStartVms.Checked; public bool StartVmsAutomatically => CanStartVmsAutomatically && m_checkBoxStartVms.Visible && m_checkBoxStartVms.Checked;
public bool ShowStartVmsGroupBox public bool ShowStartVmsGroupBox
{ {

View File

@ -33,6 +33,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using XenAdmin.Actions.OvfActions; using XenAdmin.Actions.OvfActions;
using XenAdmin.Core;
using XenAdmin.Network; using XenAdmin.Network;
using XenAdmin.Wizards.GenericPages; using XenAdmin.Wizards.GenericPages;
using XenAdmin.Wizards.ImportWizard.Filters; using XenAdmin.Wizards.ImportWizard.Filters;
@ -49,12 +50,16 @@ namespace XenAdmin.Wizards.ImportWizard
private List<Xen_ConfigurationSettingData_Type> vgpuSettings = new List<Xen_ConfigurationSettingData_Type>(); private List<Xen_ConfigurationSettingData_Type> vgpuSettings = new List<Xen_ConfigurationSettingData_Type>();
private List<Xen_ConfigurationSettingData_Type> hardwarePlatformSettings = new List<Xen_ConfigurationSettingData_Type>(); private List<Xen_ConfigurationSettingData_Type> hardwarePlatformSettings = new List<Xen_ConfigurationSettingData_Type>();
private List<Xen_ConfigurationSettingData_Type> vendorDeviceSettings = new List<Xen_ConfigurationSettingData_Type>(); private List<Xen_ConfigurationSettingData_Type> vendorDeviceSettings = new List<Xen_ConfigurationSettingData_Type>();
private int _ovfMaxVCpusCount;
private long _ovfMemory;
private readonly List<long> _ovfVCpusCount;
public event Action<IXenConnection> ConnectionSelectionChanged; public event Action<IXenConnection> ConnectionSelectionChanged;
public ImportSelectHostPage() public ImportSelectHostPage()
{ {
InitializeText(); InitializeText();
ShowWarning(null);
_ovfVCpusCount = new List<long>();
} }
#region XenTabPage overrides #region XenTabPage overrides
@ -108,6 +113,52 @@ namespace XenAdmin.Wizards.ImportWizard
if (data == null) if (data == null)
continue; continue;
_ovfVCpusCount.Clear();
foreach (var rasdType in vhs.Item)
{
// Processor
if (rasdType.ResourceType.Value == 3 &&
int.TryParse(rasdType.VirtualQuantity.Value.ToString(), out var vCpusCount))
{
_ovfVCpusCount.Add(vCpusCount);
if (_ovfMaxVCpusCount < vCpusCount)
{
_ovfMaxVCpusCount = vCpusCount;
}
}
// Memory
if (rasdType.ResourceType.Value == 4 && double.TryParse(rasdType.VirtualQuantity.Value.ToString(), out var memory))
{
//The default memory unit is MB (2^20), however, the RASD may contain a different
//one with format byte*memoryBase^memoryPower (byte being a literal string)
double memoryBase = 2.0;
double memoryPower = 20.0;
if (rasdType.AllocationUnits.Value.ToLower().StartsWith("byte"))
{
string[] a1 = rasdType.AllocationUnits.Value.Split('*', '^');
if (a1.Length == 3)
{
if (!double.TryParse(a1[1].Trim(), out memoryBase))
memoryBase = 2.0;
if (!double.TryParse(a1[2].Trim(), out memoryPower))
memoryPower = 20.0;
}
}
double memoryMultiplier = Math.Pow(memoryBase, memoryPower);
memory *= memoryMultiplier;
if (memory > long.MaxValue)
memory = long.MaxValue;
if (_ovfMemory < memory)
_ovfMemory = (long)memory;
}
}
foreach (var s in data) foreach (var s in data)
{ {
if (s.Name == "vgpu") if (s.Name == "vgpu")
@ -127,7 +178,7 @@ namespace XenAdmin.Wizards.ImportWizard
protected override string TargetServerSelectionIntroText => Messages.IMPORT_WIZARD_DESTINATION_TABLE_INTRO; protected override string TargetServerSelectionIntroText => Messages.IMPORT_WIZARD_DESTINATION_TABLE_INTRO;
protected override void OnChosenItemChanged() protected override void OnSelectedTargetPoolChanged()
{ {
var warnings = new List<string>(); var warnings = new List<string>();
@ -150,12 +201,36 @@ namespace XenAdmin.Wizards.ImportWizard
else if (VmMappings.Count > 1) else if (VmMappings.Count > 1)
warnings.Add(Messages.IMPORT_VM_WITH_VGPU_WARNING_MANY); warnings.Add(Messages.IMPORT_VM_WITH_VGPU_WARNING_MANY);
} }
var ovfCountsAboveLimit = _ovfVCpusCount.Count(vCpusCount => vCpusCount > VM.MAX_VCPUS_FOR_NON_TRUSTED_VMS);
if (ovfCountsAboveLimit > 0)
{
warnings.Add(string.Format(Messages.IMPORT_VM_CPUS_COUNT_UNTRUSTED_WARNING, ovfCountsAboveLimit, VM.MAX_VCPUS_FOR_NON_TRUSTED_VMS, BrandManager.BrandConsole));
}
} }
ShowWarning(string.Join("\n", warnings)); ApplianceCanBeStarted = true;
if (ConnectionSelectionChanged != null) if (!CheckDestinationHasEnoughPhysicalCpus(out var physicalCpusWarningMessage))
ConnectionSelectionChanged(SelectedTargetPool?.Connection); {
warnings.Add(physicalCpusWarningMessage);
ApplianceCanBeStarted = false;
}
if (!CheckDestinationHasEnoughMemory(out var memoryWarningMessage))
{
warnings.Add(memoryWarningMessage);
ApplianceCanBeStarted = false;
}
ShowWarning(string.Join("\n\n", warnings));
ConnectionSelectionChanged?.Invoke(SelectedTargetPool?.Connection);
}
protected override void OnSelectedTargetChanged()
{
OnSelectedTargetPoolChanged();
} }
protected override DelayLoadingOptionComboBoxItem CreateDelayLoadingOptionComboBoxItem(IXenObject xenItem) protected override DelayLoadingOptionComboBoxItem CreateDelayLoadingOptionComboBoxItem(IXenObject xenItem)
@ -207,6 +282,120 @@ namespace XenAdmin.Wizards.ImportWizard
return true; return true;
} }
/// <summary>
/// Check if the appliance can be started on the selected host or pool. Note that if the user selects
/// a shared SR in other pages, the VM could still start. The check considers both vCPU count and memory requirements
/// of the appliance.
/// </summary>
public bool ApplianceCanBeStarted { get; private set; } = true;
private bool CheckDestinationHasEnoughPhysicalCpus(out string warningMessage)
{
warningMessage = string.Empty;
var selectedTarget = SelectedTarget ?? SelectedTargetPool;
var physicalCpusCount = GetPhysicalCpus(selectedTarget);
if (physicalCpusCount < 0 || physicalCpusCount >= _ovfMaxVCpusCount)
return true;
if (selectedTarget is Pool)
warningMessage = string.Format(Messages.IMPORT_WIZARD_CPUS_COUNT_MISMATCH_POOL, _ovfMaxVCpusCount, physicalCpusCount);
else if (selectedTarget is Host)
warningMessage = string.Format(Messages.IMPORT_WIZARD_CPUS_COUNT_MISMATCH_HOST, _ovfMaxVCpusCount, physicalCpusCount);
else
return true;
return false;
}
private bool CheckDestinationHasEnoughMemory(out string warningMessage)
{
warningMessage = string.Empty;
var selectedTarget = SelectedTarget ?? SelectedTargetPool;
var memory = GetFreeMemory(selectedTarget);
if (memory >= _ovfMemory)
return true;
if (selectedTarget is Pool)
warningMessage = string.Format(Messages.IMPORT_WIZARD_INSUFFICIENT_MEMORY_POOL, Util.MemorySizeStringSuitableUnits(_ovfMemory, true), Util.MemorySizeStringSuitableUnits(memory, true));
else if (selectedTarget is Host)
warningMessage = string.Format(Messages.IMPORT_WIZARD_INSUFFICIENT_MEMORY_HOST, Util.MemorySizeStringSuitableUnits(_ovfMemory, true), Util.MemorySizeStringSuitableUnits(memory, true));
else
return true;
return false;
}
/// <summary>
/// Returns the number of physical CPUs on the specified <paramref name="xenObject"/> (<see cref="Host"/> or <see cref="Pool"/>) or -1 if the value cannot be determined.
/// </summary>
/// <param name="xenObject">The XenObject for which to determine the number of physical CPUs.</param>
/// <returns>The number of physical CPUs on the specified <paramref name="xenObject"/> or -1 if the value cannot be determined.</returns>
private int GetPhysicalCpus(IXenObject xenObject)
{
var physicalCpusCount = -1;
switch (xenObject)
{
case Host host:
{
var hostCpuCount = host.CpuCount();
if(hostCpuCount > 0)
physicalCpusCount = hostCpuCount;
break;
}
case Pool pool:
{
var hosts = pool.Connection.Cache.Hosts;
var maxCpuCounts = hosts
.Select(h => h.CpuCount())
.ToList();
if (maxCpuCounts.Count > 0)
{
physicalCpusCount = maxCpuCounts.Max();
}
break;
}
}
return physicalCpusCount;
}
private long GetFreeMemory(IXenObject xenObject)
{
long memory = 0;
switch (xenObject)
{
case Host host:
{
var hostMemory = host.memory_available_calc();
if (hostMemory > 0)
memory = hostMemory;
break;
}
case Pool pool:
{
var hosts = pool.Connection.Cache.Hosts;
var maxMemories = hosts
.Select(h => h.memory_available_calc())
.ToList();
if (maxMemories.Count > 0)
{
memory = maxMemories.Max();
}
break;
}
}
return memory;
}
private bool CheckDestinationSupportsVendorDevice() private bool CheckDestinationSupportsVendorDevice()
{ {
var dundeeOrNewerHosts = SelectedTargetPool.Connection.Cache.Hosts; var dundeeOrNewerHosts = SelectedTargetPool.Connection.Cache.Hosts;

View File

@ -372,6 +372,21 @@ namespace XenAdmin.Wizards.ImportWizard
&& lunPerVdiMappingPage.MapLunsToVdisRequired && lunPerVdiMappingPage.MapLunsToVdisRequired
&& m_typeOfImport == ImportType.Ovf) && m_typeOfImport == ImportType.Ovf)
AddAfterPage(m_pageStorage, lunPerVdiMappingPage); AddAfterPage(m_pageStorage, lunPerVdiMappingPage);
// If the user has selected shared SRs, we cannot be sure that the VMs can't be started.
// m_pageHost.ApplianceCanBeStarted only checks the number of pCPUs on the selected target.
// We therefore allow users to selected "Start VMs automatically", as they will be shown
// an error message in case their configuration isn't valid.
var canStartVMsAutomatically = m_pageHost.ApplianceCanBeStarted ||
m_pageStorage.VmMappings.Values
.SelectMany(mapping => mapping.Storage.Values)
.Any(sr => sr != null && sr.shared);
if(canStartVMsAutomatically != m_pageFinish.CanStartVmsAutomatically)
{
m_pageFinish.CanStartVmsAutomatically = canStartVMsAutomatically;
NotifyNextPagesOfChange(m_pageFinish);
}
} }
else if (type == typeof(LunPerVdiImportPage)) else if (type == typeof(LunPerVdiImportPage))
{ {
@ -567,7 +582,7 @@ namespace XenAdmin.Wizards.ImportWizard
{ {
var temp = new List<Tuple>(); var temp = new List<Tuple>();
temp.Add(new Tuple(Messages.FINISH_PAGE_VMNAME, m_pageXvaStorage.ImportedVm.Name())); temp.Add(new Tuple(Messages.FINISH_PAGE_VMNAME, m_pageXvaStorage.ImportedVm.Name()));
temp.Add(new Tuple(Messages.FINISH_PAGE_TARGET, m_pageXvaHost.SelectedHost == null ? m_pageXvaHost.SelectedConnection.Name : m_pageXvaHost.SelectedHost.Name())); temp.Add(new Tuple(Messages.FINISH_PAGE_TARGET_FOR_VM, m_pageXvaHost.SelectedHost == null ? m_pageXvaHost.SelectedConnection.Name : m_pageXvaHost.SelectedHost.Name()));
temp.Add(new Tuple(Messages.FINISH_PAGE_STORAGE, m_pageXvaStorage.SR.Name())); temp.Add(new Tuple(Messages.FINISH_PAGE_STORAGE, m_pageXvaStorage.SR.Name()));
var con = m_pageXvaHost.SelectedHost == null ? m_pageXvaHost.SelectedConnection : m_pageXvaHost.SelectedHost.Connection; var con = m_pageXvaHost.SelectedHost == null ? m_pageXvaHost.SelectedConnection : m_pageXvaHost.SelectedHost.Connection;
@ -632,11 +647,9 @@ namespace XenAdmin.Wizards.ImportWizard
foreach (var mapping in m_vmMappings.Values) foreach (var mapping in m_vmMappings.Values)
{ {
var targetLbl = m_vmMappings.Count == 1 ? Messages.FINISH_PAGE_TARGET : string.Format(Messages.FINISH_PAGE_TARGET_FOR_VM, mapping.VmNameLabel);
var storageLbl = m_vmMappings.Count == 1 ? Messages.FINISH_PAGE_STORAGE : string.Format(Messages.FINISH_PAGE_STORAGE_FOR_VM, mapping.VmNameLabel); var storageLbl = m_vmMappings.Count == 1 ? Messages.FINISH_PAGE_STORAGE : string.Format(Messages.FINISH_PAGE_STORAGE_FOR_VM, mapping.VmNameLabel);
var networkLbl = m_vmMappings.Count == 1 ? Messages.FINISH_PAGE_NETWORK : string.Format(Messages.FINISH_PAGE_NETWORK_FOR_VM, mapping.VmNameLabel); var networkLbl = m_vmMappings.Count == 1 ? Messages.FINISH_PAGE_NETWORK : string.Format(Messages.FINISH_PAGE_NETWORK_FOR_VM, mapping.VmNameLabel);
temp.Add(new Tuple(targetLbl, mapping.TargetName));
bool first = true; bool first = true;
foreach (var sr in mapping.Storage) foreach (var sr in mapping.Storage)
{ {

View File

@ -62,7 +62,7 @@ namespace XenAdmin.Wizards.NewVMWizard
private readonly Page_CloudConfigParameters page_CloudConfigParameters; private readonly Page_CloudConfigParameters page_CloudConfigParameters;
private Host m_affinity; private Host m_affinity;
private bool BlockAffinitySelection = false; private bool BlockAffinitySelection;
private bool gpuCapability; private bool gpuCapability;
public AsyncAction Action; public AsyncAction Action;
@ -131,7 +131,7 @@ namespace XenAdmin.Wizards.NewVMWizard
} }
#endregion #endregion
page_8_Finish.SummaryRetreiver = GetSummary; page_8_Finish.SummaryRetriever = GetSummary;
AddPages(page_1_Template, page_2_Name, page_3_InstallationMedia, page_4_HomeServer, AddPages(page_1_Template, page_2_Name, page_3_InstallationMedia, page_4_HomeServer,
page_5_CpuMem, page_6_Storage, page_7_Networking, page_8_Finish); page_5_CpuMem, page_6_Storage, page_7_Networking, page_8_Finish);
@ -161,8 +161,8 @@ namespace XenAdmin.Wizards.NewVMWizard
page_3_InstallationMedia.SelectedUrl, page_3_InstallationMedia.SelectedUrl,
page_3_InstallationMedia.SelectedBootMode, page_3_InstallationMedia.SelectedBootMode,
m_affinity, m_affinity,
page_5_CpuMem.SelectedVcpusMax, page_5_CpuMem.SelectedVCpusMax,
page_5_CpuMem.SelectedVcpusAtStartup, page_5_CpuMem.SelectedVCpusAtStartup,
(long)page_5_CpuMem.SelectedMemoryDynamicMin, (long)page_5_CpuMem.SelectedMemoryDynamicMin,
(long)page_5_CpuMem.SelectedMemoryDynamicMax, (long)page_5_CpuMem.SelectedMemoryDynamicMax,
(long)page_5_CpuMem.SelectedMemoryStaticMax, (long)page_5_CpuMem.SelectedMemoryStaticMax,
@ -185,13 +185,14 @@ namespace XenAdmin.Wizards.NewVMWizard
base.FinishWizard(); base.FinishWizard();
} }
protected override void OnKeyPress(System.Windows.Forms.KeyPressEventArgs e) protected override void OnKeyPress(KeyPressEventArgs e)
{ {
if (page_CloudConfigParameters != null && page_CloudConfigParameters.ActiveControl is TextBox && e.KeyChar == (char)Keys.Enter) if (page_CloudConfigParameters != null && page_CloudConfigParameters.ActiveControl is TextBox && e.KeyChar == (char)Keys.Enter)
return; return;
base.OnKeyPress(e); base.OnKeyPress(e);
} }
protected override void UpdateWizardContent(XenTabPage senderPage) protected override void UpdateWizardContent(XenTabPage senderPage)
{ {
var prevPageType = senderPage.GetType(); var prevPageType = senderPage.GetType();
@ -284,6 +285,10 @@ namespace XenAdmin.Wizards.NewVMWizard
AddAfterPage(page_6_Storage, page_6b_LunPerVdi); AddAfterPage(page_6_Storage, page_6b_LunPerVdi);
} }
} }
else if (prevPageType == typeof(Page_CpuMem))
{
page_8_Finish.CanStartImmediately = CanStartVm();
}
} }
protected override string WizardPaneHelpID() protected override string WizardPaneHelpID()
@ -291,6 +296,22 @@ namespace XenAdmin.Wizards.NewVMWizard
return CurrentStepTabPage is RBACWarningPage ? FormatHelpId("Rbac") : base.WizardPaneHelpID(); return CurrentStepTabPage is RBACWarningPage ? FormatHelpId("Rbac") : base.WizardPaneHelpID();
} }
private bool CanStartVm()
{
var homeHost = page_6_Storage.FullCopySR?.Home();
if (homeHost != null)
{
if (homeHost.CpuCount() < page_5_CpuMem.SelectedVCpusMax)
return false;
if (homeHost.memory_available_calc() < page_5_CpuMem.SelectedMemoryDynamicMin)
return false;
}
return page_5_CpuMem.CanStartVm;
}
private void ShowXenAppXenDesktopWarning(IXenConnection connection) private void ShowXenAppXenDesktopWarning(IXenConnection connection)
{ {
if (connection != null && connection.Cache.Hosts.Any(h => h.DesktopFeaturesEnabled() || h.DesktopPlusFeaturesEnabled() || h.DesktopCloudFeaturesEnabled())) if (connection != null && connection.Cache.Hosts.Any(h => h.DesktopFeaturesEnabled() || h.DesktopPlusFeaturesEnabled() || h.DesktopCloudFeaturesEnabled()))

View File

@ -29,63 +29,104 @@ namespace XenAdmin.Wizards.NewVMWizard
private void InitializeComponent() private void InitializeComponent()
{ {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Page_CpuMem)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Page_CpuMem));
this.labelVCPUs = new System.Windows.Forms.Label(); this.warningsTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
this.label5 = new System.Windows.Forms.Label(); this.cpuWarningPictureBox = new System.Windows.Forms.PictureBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.cpuWarningLabel = new System.Windows.Forms.Label();
this.ErrorLabel = new System.Windows.Forms.Label(); this.memoryWarningLabel = new System.Windows.Forms.Label();
this.ErrorPanel = new System.Windows.Forms.Panel(); this.memoryPictureBox = new System.Windows.Forms.PictureBox();
this.spinnerDynMin = new XenAdmin.Controls.Ballooning.MemorySpinner();
this.spinnerDynMax = new XenAdmin.Controls.Ballooning.MemorySpinner();
this.spinnerStatMax = new XenAdmin.Controls.Ballooning.MemorySpinner();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.vCPUWarningLabel = new System.Windows.Forms.Label();
this.initialVCPUWarningLabel = new System.Windows.Forms.Label();
this.comboBoxInitialVCPUs = new System.Windows.Forms.ComboBox();
this.labelInitialVCPUs = new System.Windows.Forms.Label();
this.labelInvalidVCPUWarning = new System.Windows.Forms.Label();
this.comboBoxTopology = new XenAdmin.Controls.CPUTopologyComboBox();
this.labelTopology = new System.Windows.Forms.Label();
this.comboBoxVCPUs = new System.Windows.Forms.ComboBox();
this.labelDynMin = new System.Windows.Forms.Label();
this.labelDynMax = new System.Windows.Forms.Label();
this.labelStatMax = new System.Windows.Forms.Label();
this.labelDynMinInfo = new System.Windows.Forms.Label();
this.labelDynMaxInfo = new System.Windows.Forms.Label();
this.labelStatMaxInfo = new System.Windows.Forms.Label(); this.labelStatMaxInfo = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.labelDynMaxInfo = new System.Windows.Forms.Label();
this.ErrorPanel.SuspendLayout(); this.labelDynMinInfo = new System.Windows.Forms.Label();
this.labelStatMax = new System.Windows.Forms.Label();
this.labelDynMax = new System.Windows.Forms.Label();
this.labelDynMin = new System.Windows.Forms.Label();
this.spinnerDynMin = new XenAdmin.Controls.Ballooning.MemorySpinner();
this.comboBoxVCPUs = new System.Windows.Forms.ComboBox();
this.labelTopology = new System.Windows.Forms.Label();
this.spinnerDynMax = new XenAdmin.Controls.Ballooning.MemorySpinner();
this.labelVCPUs = new System.Windows.Forms.Label();
this.spinnerStatMax = new XenAdmin.Controls.Ballooning.MemorySpinner();
this.label5 = new System.Windows.Forms.Label();
this.comboBoxTopology = new XenAdmin.Controls.CPUTopologyComboBox();
this.labelInitialVCPUs = new System.Windows.Forms.Label();
this.comboBoxInitialVCPUs = new System.Windows.Forms.ComboBox();
this.initialVCPUWarningLabel = new System.Windows.Forms.Label();
this.vCPUWarningLabel = new System.Windows.Forms.Label();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.pictureBoxTopology = new System.Windows.Forms.PictureBox();
this.labelTopologyWarning = new System.Windows.Forms.Label();
this.warningsTableLayoutPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.cpuWarningPictureBox)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.memoryPictureBox)).BeginInit();
this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxTopology)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// labelVCPUs // warningsTableLayoutPanel
// //
resources.ApplyResources(this.labelVCPUs, "labelVCPUs"); resources.ApplyResources(this.warningsTableLayoutPanel, "warningsTableLayoutPanel");
this.labelVCPUs.Name = "labelVCPUs"; this.tableLayoutPanel1.SetColumnSpan(this.warningsTableLayoutPanel, 4);
this.warningsTableLayoutPanel.Controls.Add(this.pictureBoxTopology, 0, 2);
this.warningsTableLayoutPanel.Controls.Add(this.cpuWarningPictureBox, 0, 0);
this.warningsTableLayoutPanel.Controls.Add(this.cpuWarningLabel, 1, 0);
this.warningsTableLayoutPanel.Controls.Add(this.memoryWarningLabel, 1, 4);
this.warningsTableLayoutPanel.Controls.Add(this.memoryPictureBox, 0, 4);
this.warningsTableLayoutPanel.Controls.Add(this.labelTopologyWarning, 1, 2);
this.warningsTableLayoutPanel.Name = "warningsTableLayoutPanel";
// //
// label5 // cpuWarningPictureBox
// //
resources.ApplyResources(this.label5, "label5"); this.cpuWarningPictureBox.Image = global::XenAdmin.Properties.Resources._000_Alert2_h32bit_16;
this.tableLayoutPanel1.SetColumnSpan(this.label5, 4); resources.ApplyResources(this.cpuWarningPictureBox, "cpuWarningPictureBox");
this.label5.Name = "label5"; this.cpuWarningPictureBox.Name = "cpuWarningPictureBox";
this.cpuWarningPictureBox.TabStop = false;
// //
// pictureBox1 // cpuWarningLabel
// //
this.pictureBox1.Image = global::XenAdmin.Properties.Resources._000_Alert2_h32bit_16; resources.ApplyResources(this.cpuWarningLabel, "cpuWarningLabel");
resources.ApplyResources(this.pictureBox1, "pictureBox1"); this.cpuWarningLabel.Name = "cpuWarningLabel";
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.TabStop = false;
// //
// ErrorLabel // memoryWarningLabel
// //
resources.ApplyResources(this.ErrorLabel, "ErrorLabel"); resources.ApplyResources(this.memoryWarningLabel, "memoryWarningLabel");
this.ErrorLabel.Name = "ErrorLabel"; this.memoryWarningLabel.Name = "memoryWarningLabel";
// //
// ErrorPanel // memoryPictureBox
// //
this.ErrorPanel.Controls.Add(this.ErrorLabel); this.memoryPictureBox.Image = global::XenAdmin.Properties.Resources._000_Alert2_h32bit_16;
this.ErrorPanel.Controls.Add(this.pictureBox1); resources.ApplyResources(this.memoryPictureBox, "memoryPictureBox");
resources.ApplyResources(this.ErrorPanel, "ErrorPanel"); this.memoryPictureBox.Name = "memoryPictureBox";
this.ErrorPanel.Name = "ErrorPanel"; this.memoryPictureBox.TabStop = false;
//
// labelStatMaxInfo
//
resources.ApplyResources(this.labelStatMaxInfo, "labelStatMaxInfo");
this.labelStatMaxInfo.Name = "labelStatMaxInfo";
//
// labelDynMaxInfo
//
resources.ApplyResources(this.labelDynMaxInfo, "labelDynMaxInfo");
this.labelDynMaxInfo.Name = "labelDynMaxInfo";
//
// labelDynMinInfo
//
resources.ApplyResources(this.labelDynMinInfo, "labelDynMinInfo");
this.labelDynMinInfo.Name = "labelDynMinInfo";
//
// labelStatMax
//
resources.ApplyResources(this.labelStatMax, "labelStatMax");
this.labelStatMax.Name = "labelStatMax";
//
// labelDynMax
//
resources.ApplyResources(this.labelDynMax, "labelDynMax");
this.labelDynMax.Name = "labelDynMax";
//
// labelDynMin
//
resources.ApplyResources(this.labelDynMin, "labelDynMin");
this.labelDynMin.Name = "labelDynMin";
// //
// spinnerDynMin // spinnerDynMin
// //
@ -95,6 +136,19 @@ namespace XenAdmin.Wizards.NewVMWizard
this.spinnerDynMin.Name = "spinnerDynMin"; this.spinnerDynMin.Name = "spinnerDynMin";
this.spinnerDynMin.SpinnerValueChanged += new System.EventHandler(this.memory_ValueChanged); this.spinnerDynMin.SpinnerValueChanged += new System.EventHandler(this.memory_ValueChanged);
// //
// comboBoxVCPUs
//
this.comboBoxVCPUs.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxVCPUs.FormattingEnabled = true;
resources.ApplyResources(this.comboBoxVCPUs, "comboBoxVCPUs");
this.comboBoxVCPUs.Name = "comboBoxVCPUs";
this.comboBoxVCPUs.SelectedIndexChanged += new System.EventHandler(this.vCPU_ValueChanged);
//
// labelTopology
//
resources.ApplyResources(this.labelTopology, "labelTopology");
this.labelTopology.Name = "labelTopology";
//
// spinnerDynMax // spinnerDynMax
// //
resources.ApplyResources(this.spinnerDynMax, "spinnerDynMax"); resources.ApplyResources(this.spinnerDynMax, "spinnerDynMax");
@ -103,6 +157,11 @@ namespace XenAdmin.Wizards.NewVMWizard
this.spinnerDynMax.Name = "spinnerDynMax"; this.spinnerDynMax.Name = "spinnerDynMax";
this.spinnerDynMax.SpinnerValueChanged += new System.EventHandler(this.memory_ValueChanged); this.spinnerDynMax.SpinnerValueChanged += new System.EventHandler(this.memory_ValueChanged);
// //
// labelVCPUs
//
resources.ApplyResources(this.labelVCPUs, "labelVCPUs");
this.labelVCPUs.Name = "labelVCPUs";
//
// spinnerStatMax // spinnerStatMax
// //
resources.ApplyResources(this.spinnerStatMax, "spinnerStatMax"); resources.ApplyResources(this.spinnerStatMax, "spinnerStatMax");
@ -111,63 +170,11 @@ namespace XenAdmin.Wizards.NewVMWizard
this.spinnerStatMax.Name = "spinnerStatMax"; this.spinnerStatMax.Name = "spinnerStatMax";
this.spinnerStatMax.SpinnerValueChanged += new System.EventHandler(this.memory_ValueChanged); this.spinnerStatMax.SpinnerValueChanged += new System.EventHandler(this.memory_ValueChanged);
// //
// tableLayoutPanel1 // label5
// //
resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); resources.ApplyResources(this.label5, "label5");
this.tableLayoutPanel1.Controls.Add(this.vCPUWarningLabel, 2, 1); this.tableLayoutPanel1.SetColumnSpan(this.label5, 4);
this.tableLayoutPanel1.Controls.Add(this.initialVCPUWarningLabel, 2, 4); this.label5.Name = "label5";
this.tableLayoutPanel1.Controls.Add(this.comboBoxInitialVCPUs, 1, 4);
this.tableLayoutPanel1.Controls.Add(this.labelInitialVCPUs, 0, 4);
this.tableLayoutPanel1.Controls.Add(this.labelInvalidVCPUWarning, 1, 3);
this.tableLayoutPanel1.Controls.Add(this.comboBoxTopology, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.label5, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.spinnerStatMax, 1, 8);
this.tableLayoutPanel1.Controls.Add(this.labelVCPUs, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.spinnerDynMax, 1, 7);
this.tableLayoutPanel1.Controls.Add(this.labelTopology, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.comboBoxVCPUs, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.spinnerDynMin, 1, 6);
this.tableLayoutPanel1.Controls.Add(this.labelDynMin, 0, 6);
this.tableLayoutPanel1.Controls.Add(this.labelDynMax, 0, 7);
this.tableLayoutPanel1.Controls.Add(this.labelStatMax, 0, 8);
this.tableLayoutPanel1.Controls.Add(this.labelDynMinInfo, 3, 6);
this.tableLayoutPanel1.Controls.Add(this.labelDynMaxInfo, 3, 7);
this.tableLayoutPanel1.Controls.Add(this.labelStatMaxInfo, 3, 8);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
//
// vCPUWarningLabel
//
resources.ApplyResources(this.vCPUWarningLabel, "vCPUWarningLabel");
this.tableLayoutPanel1.SetColumnSpan(this.vCPUWarningLabel, 2);
this.vCPUWarningLabel.ForeColor = System.Drawing.Color.Red;
this.vCPUWarningLabel.Name = "vCPUWarningLabel";
//
// initialVCPUWarningLabel
//
resources.ApplyResources(this.initialVCPUWarningLabel, "initialVCPUWarningLabel");
this.tableLayoutPanel1.SetColumnSpan(this.initialVCPUWarningLabel, 2);
this.initialVCPUWarningLabel.ForeColor = System.Drawing.Color.Red;
this.initialVCPUWarningLabel.Name = "initialVCPUWarningLabel";
//
// comboBoxInitialVCPUs
//
this.comboBoxInitialVCPUs.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxInitialVCPUs.FormattingEnabled = true;
resources.ApplyResources(this.comboBoxInitialVCPUs, "comboBoxInitialVCPUs");
this.comboBoxInitialVCPUs.Name = "comboBoxInitialVCPUs";
this.comboBoxInitialVCPUs.SelectedIndexChanged += new System.EventHandler(this.comboBoxInitialVCPUs_SelectedIndexChanged);
//
// labelInitialVCPUs
//
resources.ApplyResources(this.labelInitialVCPUs, "labelInitialVCPUs");
this.labelInitialVCPUs.Name = "labelInitialVCPUs";
//
// labelInvalidVCPUWarning
//
resources.ApplyResources(this.labelInvalidVCPUWarning, "labelInvalidVCPUWarning");
this.tableLayoutPanel1.SetColumnSpan(this.labelInvalidVCPUWarning, 3);
this.labelInvalidVCPUWarning.ForeColor = System.Drawing.Color.Red;
this.labelInvalidVCPUWarning.Name = "labelInvalidVCPUWarning";
// //
// comboBoxTopology // comboBoxTopology
// //
@ -178,89 +185,113 @@ namespace XenAdmin.Wizards.NewVMWizard
this.comboBoxTopology.Name = "comboBoxTopology"; this.comboBoxTopology.Name = "comboBoxTopology";
this.comboBoxTopology.SelectedIndexChanged += new System.EventHandler(this.comboBoxTopology_SelectedIndexChanged); this.comboBoxTopology.SelectedIndexChanged += new System.EventHandler(this.comboBoxTopology_SelectedIndexChanged);
// //
// labelTopology // labelInitialVCPUs
// //
resources.ApplyResources(this.labelTopology, "labelTopology"); resources.ApplyResources(this.labelInitialVCPUs, "labelInitialVCPUs");
this.labelTopology.Name = "labelTopology"; this.labelInitialVCPUs.Name = "labelInitialVCPUs";
// //
// comboBoxVCPUs // comboBoxInitialVCPUs
// //
this.comboBoxVCPUs.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxInitialVCPUs.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxVCPUs.FormattingEnabled = true; this.comboBoxInitialVCPUs.FormattingEnabled = true;
resources.ApplyResources(this.comboBoxVCPUs, "comboBoxVCPUs"); resources.ApplyResources(this.comboBoxInitialVCPUs, "comboBoxInitialVCPUs");
this.comboBoxVCPUs.Name = "comboBoxVCPUs"; this.comboBoxInitialVCPUs.Name = "comboBoxInitialVCPUs";
this.comboBoxVCPUs.SelectedIndexChanged += new System.EventHandler(this.vCPU_ValueChanged); this.comboBoxInitialVCPUs.SelectedIndexChanged += new System.EventHandler(this.comboBoxInitialVCPUs_SelectedIndexChanged);
// //
// labelDynMin // initialVCPUWarningLabel
// //
resources.ApplyResources(this.labelDynMin, "labelDynMin"); resources.ApplyResources(this.initialVCPUWarningLabel, "initialVCPUWarningLabel");
this.labelDynMin.Name = "labelDynMin"; this.tableLayoutPanel1.SetColumnSpan(this.initialVCPUWarningLabel, 2);
this.initialVCPUWarningLabel.ForeColor = System.Drawing.Color.Red;
this.initialVCPUWarningLabel.Name = "initialVCPUWarningLabel";
// //
// labelDynMax // vCPUWarningLabel
// //
resources.ApplyResources(this.labelDynMax, "labelDynMax"); resources.ApplyResources(this.vCPUWarningLabel, "vCPUWarningLabel");
this.labelDynMax.Name = "labelDynMax"; this.tableLayoutPanel1.SetColumnSpan(this.vCPUWarningLabel, 2);
this.vCPUWarningLabel.ForeColor = System.Drawing.Color.Red;
this.vCPUWarningLabel.Name = "vCPUWarningLabel";
// //
// labelStatMax // tableLayoutPanel1
// //
resources.ApplyResources(this.labelStatMax, "labelStatMax"); resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
this.labelStatMax.Name = "labelStatMax"; this.tableLayoutPanel1.Controls.Add(this.vCPUWarningLabel, 2, 1);
this.tableLayoutPanel1.Controls.Add(this.initialVCPUWarningLabel, 2, 3);
this.tableLayoutPanel1.Controls.Add(this.comboBoxInitialVCPUs, 1, 3);
this.tableLayoutPanel1.Controls.Add(this.labelInitialVCPUs, 0, 3);
this.tableLayoutPanel1.Controls.Add(this.comboBoxTopology, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.label5, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.spinnerStatMax, 1, 7);
this.tableLayoutPanel1.Controls.Add(this.labelVCPUs, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.spinnerDynMax, 1, 6);
this.tableLayoutPanel1.Controls.Add(this.labelTopology, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.comboBoxVCPUs, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.spinnerDynMin, 1, 5);
this.tableLayoutPanel1.Controls.Add(this.labelDynMin, 0, 5);
this.tableLayoutPanel1.Controls.Add(this.labelDynMax, 0, 6);
this.tableLayoutPanel1.Controls.Add(this.labelStatMax, 0, 7);
this.tableLayoutPanel1.Controls.Add(this.labelDynMinInfo, 3, 5);
this.tableLayoutPanel1.Controls.Add(this.labelDynMaxInfo, 3, 6);
this.tableLayoutPanel1.Controls.Add(this.labelStatMaxInfo, 3, 7);
this.tableLayoutPanel1.Controls.Add(this.warningsTableLayoutPanel, 0, 8);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
// //
// labelDynMinInfo // pictureBoxTopology
// //
resources.ApplyResources(this.labelDynMinInfo, "labelDynMinInfo"); this.pictureBoxTopology.Image = global::XenAdmin.Properties.Resources._000_Alert2_h32bit_16;
this.labelDynMinInfo.Name = "labelDynMinInfo"; resources.ApplyResources(this.pictureBoxTopology, "pictureBoxTopology");
this.pictureBoxTopology.Name = "pictureBoxTopology";
this.pictureBoxTopology.TabStop = false;
// //
// labelDynMaxInfo // labelTopologyWarning
// //
resources.ApplyResources(this.labelDynMaxInfo, "labelDynMaxInfo"); resources.ApplyResources(this.labelTopologyWarning, "labelTopologyWarning");
this.labelDynMaxInfo.Name = "labelDynMaxInfo"; this.labelTopologyWarning.Name = "labelTopologyWarning";
//
// labelStatMaxInfo
//
resources.ApplyResources(this.labelStatMaxInfo, "labelStatMaxInfo");
this.labelStatMaxInfo.Name = "labelStatMaxInfo";
// //
// Page_CpuMem // Page_CpuMem
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.ErrorPanel);
this.Name = "Page_CpuMem"; this.Name = "Page_CpuMem";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.warningsTableLayoutPanel.ResumeLayout(false);
this.ErrorPanel.ResumeLayout(false); this.warningsTableLayoutPanel.PerformLayout();
this.ErrorPanel.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.cpuWarningPictureBox)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.memoryPictureBox)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout(); this.tableLayoutPanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxTopology)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
#endregion #endregion
private System.Windows.Forms.Label labelVCPUs; private System.Windows.Forms.TableLayoutPanel warningsTableLayoutPanel;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label ErrorLabel;
private System.Windows.Forms.Panel ErrorPanel;
private XenAdmin.Controls.Ballooning.MemorySpinner spinnerDynMin;
private XenAdmin.Controls.Ballooning.MemorySpinner spinnerDynMax;
private XenAdmin.Controls.Ballooning.MemorySpinner spinnerStatMax;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label labelTopology; private System.Windows.Forms.Label vCPUWarningLabel;
private Controls.CPUTopologyComboBox comboBoxTopology; private System.Windows.Forms.Label initialVCPUWarningLabel;
private System.Windows.Forms.ComboBox comboBoxVCPUs;
private System.Windows.Forms.ComboBox comboBoxInitialVCPUs; private System.Windows.Forms.ComboBox comboBoxInitialVCPUs;
private System.Windows.Forms.Label labelInitialVCPUs; private System.Windows.Forms.Label labelInitialVCPUs;
private System.Windows.Forms.Label labelInvalidVCPUWarning; private Controls.CPUTopologyComboBox comboBoxTopology;
private System.Windows.Forms.Label label5;
private Controls.Ballooning.MemorySpinner spinnerStatMax;
private System.Windows.Forms.Label labelVCPUs;
private Controls.Ballooning.MemorySpinner spinnerDynMax;
private System.Windows.Forms.Label labelTopology;
private System.Windows.Forms.ComboBox comboBoxVCPUs;
private Controls.Ballooning.MemorySpinner spinnerDynMin;
private System.Windows.Forms.Label labelDynMin; private System.Windows.Forms.Label labelDynMin;
private System.Windows.Forms.Label labelDynMax; private System.Windows.Forms.Label labelDynMax;
private System.Windows.Forms.Label labelStatMax; private System.Windows.Forms.Label labelStatMax;
private System.Windows.Forms.Label labelDynMinInfo; private System.Windows.Forms.Label labelDynMinInfo;
private System.Windows.Forms.Label labelDynMaxInfo; private System.Windows.Forms.Label labelDynMaxInfo;
private System.Windows.Forms.Label labelStatMaxInfo; private System.Windows.Forms.Label labelStatMaxInfo;
private System.Windows.Forms.Label vCPUWarningLabel; private System.Windows.Forms.PictureBox cpuWarningPictureBox;
private System.Windows.Forms.Label initialVCPUWarningLabel; private System.Windows.Forms.Label cpuWarningLabel;
private System.Windows.Forms.Label memoryWarningLabel;
private System.Windows.Forms.PictureBox memoryPictureBox;
private System.Windows.Forms.PictureBox pictureBoxTopology;
private System.Windows.Forms.Label labelTopologyWarning;
} }
} }

View File

@ -41,21 +41,27 @@ namespace XenAdmin.Wizards.NewVMWizard
{ {
public partial class Page_CpuMem : XenTabPage public partial class Page_CpuMem : XenTabPage
{ {
private VM Template; private VM _template;
// number of spinners to show // number of spinners to show
enum MemoryMode private enum MemoryMode
{ {
JustMemory = 1, JustMemory = 1,
MinimumAndMaximum = 2, MinimumAndMaximum = 2,
MinimumMaximumAndStaticMax = 3 MinimumMaximumAndStaticMax = 3
} }
MemoryMode memoryMode = MemoryMode.JustMemory;
double memoryRatio = 0.0; // the permitted ratio of dynamic_min / static_max private MemoryMode _memoryMode = MemoryMode.JustMemory;
bool initialising = true;
private bool isVcpuHotplugSupported; private double _memoryRatio; // the permitted ratio of dynamic_min / static_max
private int minVCPUs; private bool _initializing = true;
private bool _isVCpuHotplugSupported;
private int _minVCpus;
private long _maxVCpus;
private long _maxMemTotal;
private long _maxMemFree;
private long _prevVCpusMax;
public VM SelectedTemplate { private get; set; }
// Please note that the comboBoxVCPUs control can represent two different VM properties, depending whether the VM supports vCPU hotplug or not: // Please note that the comboBoxVCPUs control can represent two different VM properties, depending whether the VM supports vCPU hotplug or not:
// When vCPU hotplug is not supported, comboBoxVCPUs represents the initial number of vCPUs (VCPUs_at_startup). In this case we will also set the VM property VCPUs_max to the same value. // When vCPU hotplug is not supported, comboBoxVCPUs represents the initial number of vCPUs (VCPUs_at_startup). In this case we will also set the VM property VCPUs_max to the same value.
@ -66,72 +72,90 @@ namespace XenAdmin.Wizards.NewVMWizard
InitializeComponent(); InitializeComponent();
} }
public override string Text public override string Text => Messages.NEWVMWIZARD_CPUMEMPAGE_NAME;
public override string PageTitle => Messages.NEWVMWIZARD_CPUMEMPAGE_TITLE;
public override string HelpID => "CPU&Memory";
public double SelectedMemoryDynamicMin => spinnerDynMin.Value;
public double SelectedMemoryDynamicMax => _memoryMode == MemoryMode.JustMemory ? spinnerDynMin.Value : spinnerDynMax.Value;
public bool CanStartVm => _maxVCpus > 0 && SelectedVCpusMax <= _maxVCpus && _maxMemFree > 0 && SelectedMemoryDynamicMin <= _maxMemFree && _maxMemTotal > 0 && SelectedMemoryDynamicMin <= _maxMemTotal;
public double SelectedMemoryStaticMax =>
_memoryMode == MemoryMode.JustMemory ? spinnerDynMin.Value :
_memoryMode == MemoryMode.MinimumAndMaximum ? spinnerDynMax.Value :
spinnerStatMax.Value;
public long SelectedVCpusMax => comboBoxVCPUs.SelectedItem == null ? -1 : (long)comboBoxVCPUs.SelectedItem;
public long SelectedVCpusAtStartup
{ {
get { return Messages.NEWVMWIZARD_CPUMEMPAGE_NAME; } get
{
if (_isVCpuHotplugSupported)
return comboBoxInitialVCPUs.SelectedItem == null ? -1 : (long)comboBoxInitialVCPUs.SelectedItem;
return comboBoxVCPUs.SelectedItem == null ? -1 : (long)comboBoxVCPUs.SelectedItem;
}
} }
public override string PageTitle public long SelectedCoresPerSocket => comboBoxTopology.CoresPerSocket;
{
get { return Messages.NEWVMWIZARD_CPUMEMPAGE_TITLE; }
}
public override string HelpID
{
get { return "CPU&Memory"; }
}
protected override void PageLoadedCore(PageLoadedDirection direction) protected override void PageLoadedCore(PageLoadedDirection direction)
{ {
if (SelectedTemplate == Template) if (SelectedTemplate == _template)
return; return;
initialising = true; _initializing = true;
Template = SelectedTemplate; _template = SelectedTemplate;
if (Template.SupportsBallooning() && !Helpers.FeatureForbidden(Template, Host.RestrictDMC)) if (_template.SupportsBallooning() && !Helpers.FeatureForbidden(_template, Host.RestrictDMC))
memoryMode = Template.memory_dynamic_max == Template.memory_static_max ? MemoryMode.MinimumAndMaximum : MemoryMode.MinimumMaximumAndStaticMax; _memoryMode = _template.memory_dynamic_max == _template.memory_static_max ? MemoryMode.MinimumAndMaximum : MemoryMode.MinimumMaximumAndStaticMax;
else else
memoryMode = MemoryMode.JustMemory; _memoryMode = MemoryMode.JustMemory;
memoryRatio = VMMemoryControlsEdit.GetMemoryRatio(Template); _memoryRatio = VMMemoryControlsEdit.GetMemoryRatio(_template);
FreeSpinnerLimits(); FreeSpinnerLimits();
if (memoryMode == MemoryMode.JustMemory) if (_memoryMode == MemoryMode.JustMemory)
{ {
spinnerDynMin.Initialize(Template.memory_static_max, Template.memory_static_max); spinnerDynMin.Initialize(_template.memory_static_max, _template.memory_static_max);
labelDynMin.Text = Messages.MEMORY_COLON; labelDynMin.Text = Messages.MEMORY_COLON;
} }
else else
{ {
labelDynMin.Text = Messages.DYNAMIC_MIN_COLON; labelDynMin.Text = Messages.DYNAMIC_MIN_COLON;
spinnerDynMin.Initialize(Template.memory_dynamic_min, Template.memory_static_max); spinnerDynMin.Initialize(_template.memory_dynamic_min, _template.memory_static_max);
FreeSpinnerLimits(); // same as CA-33831 FreeSpinnerLimits(); // same as CA-33831
spinnerDynMax.Initialize(Template.memory_dynamic_max, Template.memory_static_max); spinnerDynMax.Initialize(_template.memory_dynamic_max, _template.memory_static_max);
if (memoryMode == MemoryMode.MinimumMaximumAndStaticMax) if (_memoryMode == MemoryMode.MinimumMaximumAndStaticMax)
{ {
FreeSpinnerLimits(); FreeSpinnerLimits();
spinnerStatMax.Initialize(Template.memory_static_max, Template.memory_static_max); spinnerStatMax.Initialize(_template.memory_static_max, _template.memory_static_max);
} }
} }
labelDynMaxInfo.Visible = labelDynMax.Visible = spinnerDynMax.Visible = memoryMode == MemoryMode.MinimumAndMaximum || memoryMode == MemoryMode.MinimumMaximumAndStaticMax; labelDynMaxInfo.Visible = labelDynMax.Visible = spinnerDynMax.Visible = _memoryMode == MemoryMode.MinimumAndMaximum || _memoryMode == MemoryMode.MinimumMaximumAndStaticMax;
labelStatMaxInfo.Visible = labelStatMax.Visible = spinnerStatMax.Visible = memoryMode == MemoryMode.MinimumMaximumAndStaticMax; labelStatMaxInfo.Visible = labelStatMax.Visible = spinnerStatMax.Visible = _memoryMode == MemoryMode.MinimumMaximumAndStaticMax;
isVcpuHotplugSupported = Template.SupportsVcpuHotplug(); _isVCpuHotplugSupported = _template.SupportsVcpuHotplug();
minVCPUs = Template.MinVCPUs(); _minVCpus = _template.MinVCPUs();
_prevVCPUsMax = Template.VCPUs_max; // we use variable in RefreshCurrentVCPUs for checking if VcpusAtStartup and VcpusMax were equal before VcpusMax changed _prevVCpusMax = _template.VCPUs_max; // we use variable in RefreshCurrentVCPUs for checking if VcpusAtStartup and VcpusMax were equal before VcpusMax changed
label5.Text = GetRubric(); label5.Text = GetRubric();
InitialiseVcpuControls(); InitialiseVCpuControls();
SetSpinnerLimitsAndIncrement(); SetSpinnerLimitsAndIncrement();
ValidateMemorySettings();
ValidateVCpuSettings();
ValidateInitialVCpuSettings();
OnPageUpdated();
ValuesUpdated(); _initializing = false;
initialising = false;
} }
public override void SelectDefaultControl() public override void SelectDefaultControl()
@ -139,27 +163,27 @@ namespace XenAdmin.Wizards.NewVMWizard
comboBoxVCPUs.Select(); comboBoxVCPUs.Select();
} }
private void InitialiseVcpuControls() private void InitialiseVCpuControls()
{ {
labelVCPUs.Text = isVcpuHotplugSupported labelVCPUs.Text = _isVCpuHotplugSupported
? Messages.VM_CPUMEMPAGE_MAX_VCPUS_LABEL ? Messages.VM_CPUMEMPAGE_MAX_VCPUS_LABEL
: Messages.VM_CPUMEMPAGE_VCPUS_LABEL; : Messages.VM_CPUMEMPAGE_VCPUS_LABEL;
labelInitialVCPUs.Text = Messages.VM_CPUMEMPAGE_INITIAL_VCPUS_LABEL; labelInitialVCPUs.Text = Messages.VM_CPUMEMPAGE_INITIAL_VCPUS_LABEL;
labelInitialVCPUs.Visible = comboBoxInitialVCPUs.Visible = isVcpuHotplugSupported; labelInitialVCPUs.Visible = comboBoxInitialVCPUs.Visible = _isVCpuHotplugSupported;
comboBoxTopology.Populate(Template.VCPUs_at_startup, Template.VCPUs_max, Template.GetCoresPerSocket(), Template.MaxCoresPerSocket()); comboBoxTopology.Populate(_template.VCPUs_at_startup, _template.VCPUs_max, _template.GetCoresPerSocket(), _template.MaxCoresPerSocket());
PopulateVCPUs(Template.MaxVCPUsAllowed(), isVcpuHotplugSupported ? Template.VCPUs_max : Template.VCPUs_at_startup); PopulateVCpus(_template.MaxVCPUsAllowed(), _isVCpuHotplugSupported ? _template.VCPUs_max : _template.VCPUs_at_startup);
if (isVcpuHotplugSupported) if (_isVCpuHotplugSupported)
PopulateVCPUsAtStartup(Template.VCPUs_max, Template.VCPUs_at_startup); PopulateVCpusAtStartup(_template.VCPUs_max, _template.VCPUs_at_startup);
} }
private void PopulateVCPUComboBox(ComboBox comboBox, long min, long max, long currentValue, Predicate<long> isValid) private void PopulateVCpuComboBox(ComboBox comboBox, long min, long max, long currentValue, Predicate<long> isValid)
{ {
comboBox.BeginUpdate(); comboBox.BeginUpdate();
comboBox.Items.Clear(); comboBox.Items.Clear();
for (long i = min; i <= max; ++i) for (var i = min; i <= max; ++i)
{ {
if (i == currentValue || isValid(i)) if (i == currentValue || isValid(i))
comboBox.Items.Add(i); comboBox.Items.Add(i);
@ -170,43 +194,41 @@ namespace XenAdmin.Wizards.NewVMWizard
comboBox.EndUpdate(); comboBox.EndUpdate();
} }
private void PopulateVCPUs(long maxVCPUs, long currentVCPUs) private void PopulateVCpus(long maxVCpus, long currentVCpus)
{ {
PopulateVCPUComboBox(comboBoxVCPUs, 1, maxVCPUs, currentVCPUs, i => comboBoxTopology.IsValidVCPU(i)); PopulateVCpuComboBox(comboBoxVCPUs, 1, maxVCpus, currentVCpus, i => comboBoxTopology.IsValidVCPU(i));
} }
private void PopulateVCPUsAtStartup(long max, long currentValue) private void PopulateVCpusAtStartup(long max, long currentValue)
{ {
PopulateVCPUComboBox(comboBoxInitialVCPUs, 1, max, currentValue, i => true); PopulateVCpuComboBox(comboBoxInitialVCPUs, 1, max, currentValue, i => true);
} }
private string GetRubric() private string GetRubric()
{ {
StringBuilder sb = new StringBuilder(); var sb = new StringBuilder();
sb.Append(Messages.NEWVMWIZARD_CPUMEMPAGE_RUBRIC); sb.Append(Messages.NEWVMWIZARD_CPUMEMPAGE_RUBRIC);
// add hotplug text // add hotplug text
if (isVcpuHotplugSupported) if (_isVCpuHotplugSupported)
sb.Append(Messages.VM_CPUMEMPAGE_RUBRIC_HOTPLUG); sb.Append(Messages.VM_CPUMEMPAGE_RUBRIC_HOTPLUG);
return sb.ToString(); return sb.ToString();
} }
public VM SelectedTemplate { private get; set; }
// Return the larger of the template's MaxMemAllowed and the template's static max, // Return the larger of the template's MaxMemAllowed and the template's static max,
// to avoid crashes in the spinners (CA-40041). // to avoid crashes in the spinners (CA-40041).
private long MaxMemAllowed private long MaxMemAllowed
{ {
get get
{ {
long msm = Template.memory_static_max; var msm = _template.memory_static_max;
long mma = Template.MaxMemAllowed(); var mma = _template.MaxMemAllowed();
return (msm > mma ? msm : mma); return (msm > mma ? msm : mma);
} }
} }
private void FreeSpinnerLimits() private void FreeSpinnerLimits()
{ {
long maxMemAllowed = MaxMemAllowed; var maxMemAllowed = MaxMemAllowed;
spinnerDynMin.SetRange(0, maxMemAllowed); spinnerDynMin.SetRange(0, maxMemAllowed);
spinnerDynMax.SetRange(0, maxMemAllowed); spinnerDynMax.SetRange(0, maxMemAllowed);
spinnerStatMax.SetRange(0, maxMemAllowed); spinnerStatMax.SetRange(0, maxMemAllowed);
@ -214,29 +236,29 @@ namespace XenAdmin.Wizards.NewVMWizard
private void SetSpinnerLimitsAndIncrement() private void SetSpinnerLimitsAndIncrement()
{ {
spinnerDynMin.Increment = spinnerDynMax.Increment = spinnerStatMax.Increment = VMMemoryControlsEdit.CalcIncrement(Template.memory_static_max, spinnerDynMin.Units); spinnerDynMin.Increment = spinnerDynMax.Increment = spinnerStatMax.Increment = VMMemoryControlsEdit.CalcIncrement(_template.memory_static_max, spinnerDynMin.Units);
long maxMemAllowed = MaxMemAllowed; var maxMemAllowed = MaxMemAllowed;
double min = Template.memory_static_min; double min = _template.memory_static_min;
if (memoryMode == MemoryMode.JustMemory) if (_memoryMode == MemoryMode.JustMemory)
{ {
spinnerDynMin.SetRange(min, maxMemAllowed); spinnerDynMin.SetRange(min, maxMemAllowed);
ShowMemoryMinMaxInformation(labelDynMinInfo, min, maxMemAllowed); ShowMemoryMinMaxInformation(labelDynMinInfo, min, maxMemAllowed);
return; return;
} }
long min2 = (long)(SelectedMemoryStaticMax * memoryRatio); var min2 = (long)(SelectedMemoryStaticMax * _memoryRatio);
if (min < min2) if (min < min2)
min = min2; min = min2;
double max = SelectedMemoryDynamicMax; var max = SelectedMemoryDynamicMax;
if (max < min) if (max < min)
max = min; max = min;
spinnerDynMin.SetRange(min, max); spinnerDynMin.SetRange(min, max);
ShowMemoryMinMaxInformation(labelDynMinInfo, min, max); ShowMemoryMinMaxInformation(labelDynMinInfo, min, max);
spinnerDynMax.SetRange(SelectedMemoryDynamicMin, spinnerDynMax.SetRange(SelectedMemoryDynamicMin,
memoryMode == MemoryMode.MinimumAndMaximum ? maxMemAllowed : SelectedMemoryStaticMax); _memoryMode == MemoryMode.MinimumAndMaximum ? maxMemAllowed : SelectedMemoryStaticMax);
ShowMemoryMinMaxInformation(labelDynMaxInfo, SelectedMemoryDynamicMin, ShowMemoryMinMaxInformation(labelDynMaxInfo, SelectedMemoryDynamicMin,
memoryMode == MemoryMode.MinimumAndMaximum ? maxMemAllowed : SelectedMemoryStaticMax); _memoryMode == MemoryMode.MinimumAndMaximum ? maxMemAllowed : SelectedMemoryStaticMax);
spinnerStatMax.SetRange(SelectedMemoryDynamicMax, maxMemAllowed); spinnerStatMax.SetRange(SelectedMemoryDynamicMax, maxMemAllowed);
ShowMemoryMinMaxInformation(labelStatMaxInfo, SelectedMemoryDynamicMax, maxMemAllowed); ShowMemoryMinMaxInformation(labelStatMaxInfo, SelectedMemoryDynamicMax, maxMemAllowed);
@ -249,159 +271,174 @@ namespace XenAdmin.Wizards.NewVMWizard
spinnerStatMax.Enabled = false; spinnerStatMax.Enabled = false;
} }
public double SelectedMemoryDynamicMin
{
get
{
return spinnerDynMin.Value;
}
}
public double SelectedMemoryDynamicMax
{
get
{
return memoryMode == MemoryMode.JustMemory ? spinnerDynMin.Value : spinnerDynMax.Value;
}
}
public double SelectedMemoryStaticMax
{
get
{
return
memoryMode == MemoryMode.JustMemory ? spinnerDynMin.Value :
memoryMode == MemoryMode.MinimumAndMaximum ? spinnerDynMax.Value :
spinnerStatMax.Value;
}
}
public long SelectedVcpusMax
{
get
{
return (long)comboBoxVCPUs.SelectedItem;
}
}
public long SelectedVcpusAtStartup
{
get
{
return isVcpuHotplugSupported ? (long)comboBoxInitialVCPUs.SelectedItem : (long)comboBoxVCPUs.SelectedItem;
}
}
public long SelectedCoresPerSocket
{
get
{
return comboBoxTopology.CoresPerSocket;
}
}
public override List<KeyValuePair<string, string>> PageSummary public override List<KeyValuePair<string, string>> PageSummary
{ {
get get
{ {
List<KeyValuePair<string, string>> sum = new List<KeyValuePair<string, string>>(); var sum = new List<KeyValuePair<string, string>>();
if (isVcpuHotplugSupported) if (_isVCpuHotplugSupported)
{ {
sum.Add(new KeyValuePair<string, string>(Messages.NEWVMWIZARD_CPUMEMPAGE_MAX_VCPUS, SelectedVcpusMax.ToString())); sum.Add(new KeyValuePair<string, string>(Messages.NEWVMWIZARD_CPUMEMPAGE_MAX_VCPUS, SelectedVCpusMax.ToString()));
sum.Add(new KeyValuePair<string, string>(Messages.NEWVMWIZARD_CPUMEMPAGE_INITIAL_VCPUS, SelectedVcpusAtStartup.ToString())); sum.Add(new KeyValuePair<string, string>(Messages.NEWVMWIZARD_CPUMEMPAGE_INITIAL_VCPUS, SelectedVCpusAtStartup.ToString()));
} }
else else
{ {
sum.Add(new KeyValuePair<string, string>(Messages.NEWVMWIZARD_CPUMEMPAGE_VCPUS, SelectedVcpusAtStartup.ToString())); sum.Add(new KeyValuePair<string, string>(Messages.NEWVMWIZARD_CPUMEMPAGE_VCPUS, SelectedVCpusAtStartup.ToString()));
} }
sum.Add(new KeyValuePair<string, string>(Messages.NEWVMWIZARD_CPUMEMPAGE_TOPOLOGY, comboBoxTopology.Text)); sum.Add(new KeyValuePair<string, string>(Messages.NEWVMWIZARD_CPUMEMPAGE_TOPOLOGY, comboBoxTopology.Text));
if (memoryMode == MemoryMode.JustMemory) if (_memoryMode == MemoryMode.JustMemory)
sum.Add(new KeyValuePair<string, string>(Messages.MEMORY, Util.MemorySizeStringSuitableUnits(SelectedMemoryStaticMax, false))); sum.Add(new KeyValuePair<string, string>(Messages.MEMORY, Util.MemorySizeStringSuitableUnits(SelectedMemoryStaticMax, false)));
else else
{ {
sum.Add(new KeyValuePair<string, string>(Messages.DYNAMIC_MIN, Util.MemorySizeStringSuitableUnits(SelectedMemoryDynamicMin, false))); sum.Add(new KeyValuePair<string, string>(Messages.DYNAMIC_MIN, Util.MemorySizeStringSuitableUnits(SelectedMemoryDynamicMin, false)));
sum.Add(new KeyValuePair<string, string>(Messages.DYNAMIC_MAX, Util.MemorySizeStringSuitableUnits(SelectedMemoryDynamicMax, false))); sum.Add(new KeyValuePair<string, string>(Messages.DYNAMIC_MAX, Util.MemorySizeStringSuitableUnits(SelectedMemoryDynamicMax, false)));
if (memoryMode == MemoryMode.MinimumMaximumAndStaticMax) if (_memoryMode == MemoryMode.MinimumMaximumAndStaticMax)
sum.Add(new KeyValuePair<string, string>(Messages.STATIC_MAX, Util.MemorySizeStringSuitableUnits(SelectedMemoryStaticMax, false))); sum.Add(new KeyValuePair<string, string>(Messages.STATIC_MAX, Util.MemorySizeStringSuitableUnits(SelectedMemoryStaticMax, false)));
} }
return sum; return sum;
} }
} }
private void ValuesUpdated() private void ValidateMemorySettings()
{ {
CheckForError(); Host maxMemTotalHost = null;
OnPageUpdated(); Host maxMemFreeHost = null;
} _maxMemTotal = 0;
_maxMemFree = 0;
private void CheckForError()
{ foreach (var host in Connection.Cache.Hosts)
long max_mem_total = 0;
long max_mem_free = 0;
long max_vcpus = 0;
Host max_mem_total_host = null;
Host max_mem_free_host = null;
Host max_vcpus_host = null;
foreach (Host host in Connection.Cache.Hosts)
{ {
long host_cpus = 0; var metrics = Connection.Resolve(host.metrics);
foreach (Host_cpu cpu in Connection.Cache.Host_cpus) if (metrics != null && metrics.memory_total > _maxMemTotal)
{ {
if (cpu.host.opaque_ref.Equals(host.opaque_ref)) _maxMemTotal = metrics.memory_total;
host_cpus++; maxMemTotalHost = host;
}
Host_metrics metrics = Connection.Resolve(host.metrics);
if (host_cpus > max_vcpus)
{
max_vcpus = host_cpus;
max_vcpus_host = host;
}
if (metrics != null && metrics.memory_total > max_mem_total)
{
max_mem_total = metrics.memory_total;
max_mem_total_host = host;
} }
// The available memory of a server is taken to be the current memory_free, // The available memory of a server is taken to be the current memory_free,
// plus however much we can squeeze down the existing VMs. This assumes // plus however much we can squeeze down the existing VMs. This assumes
// that the overhead won't increase when we create the new VM, so it // that the overhead won't increase when we create the new VM, so it
// has false negatives. // has false negatives.
long memory_free = host.memory_available_calc(); var memoryFree = host.memory_available_calc();
if (metrics != null && memory_free > max_mem_free) if (metrics != null && memoryFree > _maxMemFree)
{ {
max_mem_free = memory_free; _maxMemFree = memoryFree;
max_mem_free_host = host; maxMemFreeHost = host;
} }
} }
if (max_mem_total_host != null && SelectedMemoryDynamicMin > max_mem_total) if (maxMemTotalHost != null && SelectedMemoryDynamicMin > _maxMemTotal)
{ {
ErrorPanel.Visible = true; ShowMemoryWarning(string.Format(Messages.NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN_TOTAL, Util.MemorySizeStringSuitableUnits(_maxMemTotal, false)));
ErrorLabel.Text = string.Format(Messages.NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN1, Helpers.GetName(max_mem_total_host).Ellipsise(50), Util.MemorySizeStringSuitableUnits(max_mem_total, false));
} }
else if (max_mem_free_host != null && SelectedMemoryDynamicMin > max_mem_free) else if (maxMemFreeHost != null && SelectedMemoryDynamicMin > _maxMemFree)
{ {
ErrorPanel.Visible = true; ShowMemoryWarning(string.Format(Messages.NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN_FREE, Util.MemorySizeStringSuitableUnits(_maxMemFree, false)));
ErrorLabel.Text = string.Format(Messages.NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN2, Helpers.GetName(max_mem_free_host).Ellipsise(50), Util.MemorySizeStringSuitableUnits(max_mem_free, false));
}
else if (max_vcpus_host != null && SelectedVcpusMax > max_vcpus)
{
ErrorPanel.Visible = true;
ErrorLabel.Text = string.Format(Messages.NEWVMWIZARD_CPUMEMPAGE_VCPUSWARN, Helpers.GetName(max_vcpus_host).Ellipsise(50), max_vcpus);
} }
else else
{ {
ErrorPanel.Visible = false; ShowMemoryWarning();
} }
} }
private void ValidateVCpuSettings()
{
Host maxVCpusHost = null;
_maxVCpus = 0;
var warnings = new List<string>();
foreach (var host in Connection.Cache.Hosts)
{
long hostCpus = 0;
foreach (var cpu in Connection.Cache.Host_cpus)
{
if (cpu.host.opaque_ref.Equals(host.opaque_ref))
hostCpus++;
}
if (hostCpus > _maxVCpus)
{
_maxVCpus = hostCpus;
maxVCpusHost = host;
}
}
if (maxVCpusHost != null && SelectedVCpusMax > _maxVCpus)
{
var isStandAloneHost = Helpers.GetPool(maxVCpusHost.Connection) == null;
if (isStandAloneHost)
{
warnings.Add(string.Format(Messages.NEWVMWIZARD_CPUMEMPAGE_VCPUSWARN_STANDALONE_HOST, SelectedVCpusMax, _maxVCpus));
}
else
{
warnings.Add(string.Format(Messages.NEWVMWIZARD_CPUMEMPAGE_VCPUSWARN_POOL, SelectedVCpusMax, _maxVCpus));
}
}
if (SelectedVCpusMax > VM.MAX_VCPUS_FOR_NON_TRUSTED_VMS)
{
warnings.Add(string.Format(Messages.VCPUS_UNTRUSTED_VM_WARNING, VM.MAX_VCPUS_FOR_NON_TRUSTED_VMS, BrandManager.BrandConsole));
}
ShowCpuWarning(string.Join("\n\n", warnings));
if (SelectedVCpusMax < _minVCpus)
{
vCPUWarningLabel.Text = string.Format(Messages.VM_CPUMEMPAGE_VCPU_MIN_WARNING, _minVCpus);
vCPUWarningLabel.Visible = true;
}
else
{
vCPUWarningLabel.Visible = false;
}
}
private void ValidateInitialVCpuSettings()
{
if (SelectedVCpusAtStartup < _minVCpus)
{
initialVCPUWarningLabel.Text = string.Format(Messages.VM_CPUMEMPAGE_VCPU_MIN_WARNING, _minVCpus);
initialVCPUWarningLabel.Visible = true;
}
else
{
initialVCPUWarningLabel.Visible = false;
}
}
private void ValidateTopologySettings()
{
if (comboBoxVCPUs.SelectedItem != null)
ShowTopologyWarning(VM.ValidVCPUConfiguration((long)comboBoxVCPUs.SelectedItem, comboBoxTopology.CoresPerSocket));
}
private void ShowMemoryWarning(string text = null)
{
var show = !string.IsNullOrEmpty(text);
memoryWarningLabel.Text = show ? text : null;
memoryPictureBox.Visible = memoryWarningLabel.Visible = show;
}
private void ShowTopologyWarning(string text = null)
{
var show = !string.IsNullOrEmpty(text);
labelTopologyWarning.Text = show ? text : null;
pictureBoxTopology.Visible = labelTopologyWarning.Visible = show;
}
private void ShowCpuWarning(string text = null)
{
var show = !string.IsNullOrEmpty(text);
cpuWarningLabel.Text = show ? text : null;
cpuWarningPictureBox.Visible = cpuWarningLabel.Visible = show;
}
private void ShowMemoryMinMaxInformation(Label label, double min, double max) private void ShowMemoryMinMaxInformation(Label label, double min, double max)
{ {
label.Text = string.Format( label.Text = string.Format(
@ -415,55 +452,27 @@ namespace XenAdmin.Wizards.NewVMWizard
return Util.MemorySizeStringSuitableUnits(numberOfBytes, true); return Util.MemorySizeStringSuitableUnits(numberOfBytes, true);
} }
#region Control event handlers
private void vCPU_ValueChanged(object sender, EventArgs e) private void vCPU_ValueChanged(object sender, EventArgs e)
{ {
comboBoxTopology.Update((long)comboBoxVCPUs.SelectedItem); comboBoxTopology.Update((long)comboBoxVCPUs.SelectedItem);
ValuesUpdated(); ValidateVCpuSettings();
ValidateVCPUSettings(); RefreshCurrentVCpus();
RefreshCurrentVCPUs(); OnPageUpdated();
} }
private void memory_ValueChanged(object sender, EventArgs e) private void memory_ValueChanged(object sender, EventArgs e)
{ {
if (initialising) if (_initializing)
return; return;
SetSpinnerLimitsAndIncrement(); SetSpinnerLimitsAndIncrement();
ValuesUpdated(); ValidateMemorySettings();
} OnPageUpdated();
private void ValidateVCPUSettings()
{
if (comboBoxVCPUs.SelectedItem != null && SelectedVcpusMax < minVCPUs)
{
vCPUWarningLabel.Text = string.Format(Messages.VM_CPUMEMPAGE_VCPU_MIN_WARNING, minVCPUs);
vCPUWarningLabel.Visible = true;
}
else
{
vCPUWarningLabel.Visible = false;
}
if (comboBoxInitialVCPUs.SelectedItem != null && SelectedVcpusAtStartup < minVCPUs)
{
initialVCPUWarningLabel.Text = string.Format(Messages.VM_CPUMEMPAGE_VCPU_MIN_WARNING, minVCPUs);
initialVCPUWarningLabel.Visible = true;
}
else
{
initialVCPUWarningLabel.Visible = false;
}
} }
private void ValidateTopologySettings() private void RefreshCurrentVCpus()
{
if (comboBoxVCPUs.SelectedItem != null)
labelInvalidVCPUWarning.Text = VM.ValidVCPUConfiguration((long)comboBoxVCPUs.SelectedItem, comboBoxTopology.CoresPerSocket);
}
private long _prevVCPUsMax;
private void RefreshCurrentVCPUs()
{ {
// refresh comboBoxInitialVCPUs if it's visible and populated // refresh comboBoxInitialVCPUs if it's visible and populated
if (comboBoxInitialVCPUs.Visible && comboBoxInitialVCPUs.Items.Count > 0) if (comboBoxInitialVCPUs.Visible && comboBoxInitialVCPUs.Items.Count > 0)
@ -472,15 +481,15 @@ namespace XenAdmin.Wizards.NewVMWizard
// So if VcpusMax is decreased below VcpusAtStartup, then VcpusAtStartup is decreased to that number too // So if VcpusMax is decreased below VcpusAtStartup, then VcpusAtStartup is decreased to that number too
// If VcpusAtStartup and VcpusMax are equal, and VcpusMax is changed, then VcpusAtStartup is changed to match // If VcpusAtStartup and VcpusMax are equal, and VcpusMax is changed, then VcpusAtStartup is changed to match
// But if the numbers are unequal, and VcpusMax is changed but is still higher than VcpusAtStartup, then VcpusAtStartup is unchanged // But if the numbers are unequal, and VcpusMax is changed but is still higher than VcpusAtStartup, then VcpusAtStartup is unchanged
var newValue = SelectedVcpusAtStartup; var newValue = SelectedVCpusAtStartup;
if (SelectedVcpusMax < SelectedVcpusAtStartup) if (SelectedVCpusMax < SelectedVCpusAtStartup)
newValue = SelectedVcpusMax; newValue = SelectedVCpusMax;
else if (SelectedVcpusAtStartup == _prevVCPUsMax && SelectedVcpusMax != _prevVCPUsMax) else if (SelectedVCpusAtStartup == _prevVCpusMax && SelectedVCpusMax != _prevVCpusMax)
newValue = SelectedVcpusMax; newValue = SelectedVCpusMax;
PopulateVCPUsAtStartup(SelectedVcpusMax, newValue); PopulateVCpusAtStartup(SelectedVCpusMax, newValue);
_prevVCPUsMax = SelectedVcpusMax; _prevVCpusMax = SelectedVCpusMax;
} }
} }
@ -491,7 +500,9 @@ namespace XenAdmin.Wizards.NewVMWizard
private void comboBoxInitialVCPUs_SelectedIndexChanged(object sender, EventArgs e) private void comboBoxInitialVCPUs_SelectedIndexChanged(object sender, EventArgs e)
{ {
ValidateVCPUSettings(); ValidateInitialVCpuSettings();
} }
#endregion
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -31,22 +31,16 @@ namespace XenAdmin.Wizards.NewVMWizard
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Page_Finish)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Page_Finish));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.AutoStartCheckBox = new System.Windows.Forms.CheckBox(); this.AutoStartCheckBox = new System.Windows.Forms.CheckBox();
this.SummaryGridView = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx(); this.SummaryGridView = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx();
this.PropertyColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.PropertyColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ValueColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ValueColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.label1 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.SummaryGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.SummaryGridView)).BeginInit();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// richTextBox1
//
resources.ApplyResources(this.richTextBox1, "richTextBox1");
this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.TabStop = false;
//
// AutoStartCheckBox // AutoStartCheckBox
// //
resources.ApplyResources(this.AutoStartCheckBox, "AutoStartCheckBox"); resources.ApplyResources(this.AutoStartCheckBox, "AutoStartCheckBox");
@ -57,9 +51,9 @@ namespace XenAdmin.Wizards.NewVMWizard
// //
// SummaryGridView // SummaryGridView
// //
resources.ApplyResources(this.SummaryGridView, "SummaryGridView");
this.SummaryGridView.BackgroundColor = System.Drawing.SystemColors.Control; this.SummaryGridView.BackgroundColor = System.Drawing.SystemColors.Control;
this.SummaryGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.SummaryGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
this.SummaryGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.SummaryGridView.ColumnHeadersVisible = false; this.SummaryGridView.ColumnHeadersVisible = false;
this.SummaryGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.SummaryGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.PropertyColumn, this.PropertyColumn,
@ -72,6 +66,7 @@ namespace XenAdmin.Wizards.NewVMWizard
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.ControlText; dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False; dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.SummaryGridView.DefaultCellStyle = dataGridViewCellStyle1; this.SummaryGridView.DefaultCellStyle = dataGridViewCellStyle1;
resources.ApplyResources(this.SummaryGridView, "SummaryGridView");
this.SummaryGridView.Name = "SummaryGridView"; this.SummaryGridView.Name = "SummaryGridView";
this.SummaryGridView.ReadOnly = true; this.SummaryGridView.ReadOnly = true;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
@ -94,26 +89,38 @@ namespace XenAdmin.Wizards.NewVMWizard
this.ValueColumn.Name = "ValueColumn"; this.ValueColumn.Name = "ValueColumn";
this.ValueColumn.ReadOnly = true; this.ValueColumn.ReadOnly = true;
// //
// tableLayoutPanel1
//
resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.AutoStartCheckBox, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.SummaryGridView, 0, 1);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// Page_Finish // Page_Finish
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.SummaryGridView); this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.AutoStartCheckBox);
this.Controls.Add(this.richTextBox1);
this.Name = "Page_Finish"; this.Name = "Page_Finish";
((System.ComponentModel.ISupportInitialize)(this.SummaryGridView)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.SummaryGridView)).EndInit();
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
#endregion #endregion
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.CheckBox AutoStartCheckBox; private System.Windows.Forms.CheckBox AutoStartCheckBox;
private XenAdmin.Controls.DataGridViewEx.DataGridViewEx SummaryGridView; private XenAdmin.Controls.DataGridViewEx.DataGridViewEx SummaryGridView;
private System.Windows.Forms.DataGridViewTextBoxColumn PropertyColumn; private System.Windows.Forms.DataGridViewTextBoxColumn PropertyColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn ValueColumn; private System.Windows.Forms.DataGridViewTextBoxColumn ValueColumn;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label label1;
} }
} }

View File

@ -40,54 +40,47 @@ namespace XenAdmin.Wizards.NewVMWizard
public Page_Finish() public Page_Finish()
{ {
InitializeComponent(); InitializeComponent();
richTextBox1.Text = Messages.NEWVMWIZARD_FINISHPAGE;
} }
public override string Text public override string Text => Messages.NEWVMWIZARD_FINISHPAGE_NAME;
{
get { return Messages.NEWVMWIZARD_FINISHPAGE_NAME; }
}
public override string PageTitle public override string PageTitle => Messages.NEWVMWIZARD_FINISHPAGE_TITLE;
{
get { return Messages.NEWVMWIZARD_FINISHPAGE_TITLE; }
}
public override string HelpID public override string HelpID => "Finish";
{
get { return "Finish"; }
}
public override string NextText(bool isLastPage) public override string NextText(bool isLastPage)
{ {
return Messages.NEWVMWIZARD_FINISHPAGE_CREATE; return Messages.NEWVMWIZARD_FINISHPAGE_CREATE;
} }
public bool StartImmediately public bool StartImmediately => AutoStartCheckBox.Checked;
private bool _canStartImmediately = true;
public bool CanStartImmediately
{ {
get get => _canStartImmediately;
{ set => _canStartImmediately = AutoStartCheckBox.Checked = AutoStartCheckBox.Enabled = value;
return AutoStartCheckBox.Checked;
}
} }
protected override void PageLoadedCore(PageLoadedDirection direction) protected override void PageLoadedCore(PageLoadedDirection direction)
{ {
SummaryGridView.Rows.Clear(); SummaryGridView.Rows.Clear();
if (SummaryRetreiver == null) if (SummaryRetriever == null)
return; return;
var entries = SummaryRetreiver.Invoke(); var entries = SummaryRetriever.Invoke();
foreach (KeyValuePair<string, string> pair in entries) foreach (var pair in entries)
SummaryGridView.Rows.Add(pair.Key, pair.Value); SummaryGridView.Rows.Add(pair.Key, pair.Value);
} }
public override void SelectDefaultControl() public override void SelectDefaultControl()
{ {
AutoStartCheckBox.Select(); if(CanStartImmediately)
AutoStartCheckBox.Select();
} }
public Func<IEnumerable<KeyValuePair<string, string>>> SummaryRetreiver { private get; set; } public Func<IEnumerable<KeyValuePair<string, string>>> SummaryRetriever { private get; set; }
} }
} }

View File

@ -112,50 +112,23 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="richTextBox1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="richTextBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 4</value>
</data>
<data name="richTextBox1.Size" type="System.Drawing.Size, System.Drawing">
<value>508, 86</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="richTextBox1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="richTextBox1.Text" xml:space="preserve">
<value />
</data>
<data name="&gt;&gt;richTextBox1.Name" xml:space="preserve">
<value>richTextBox1</value>
</data>
<data name="&gt;&gt;richTextBox1.Type" xml:space="preserve">
<value>System.Windows.Forms.RichTextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;richTextBox1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;richTextBox1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="AutoStartCheckBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Left</value>
</data>
<data name="AutoStartCheckBox.AutoSize" type="System.Boolean, mscorlib"> <data name="AutoStartCheckBox.AutoSize" type="System.Boolean, mscorlib">
<value>True</value> <value>True</value>
</data> </data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="AutoStartCheckBox.Location" type="System.Drawing.Point, System.Drawing"> <data name="AutoStartCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 288</value> <value>3, 288</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="AutoStartCheckBox.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 10, 3, 3</value>
</data>
<data name="AutoStartCheckBox.Size" type="System.Drawing.Size, System.Drawing"> <data name="AutoStartCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>172, 17</value> <value>172, 17</value>
</data> </data>
@ -169,18 +142,15 @@
<value>AutoStartCheckBox</value> <value>AutoStartCheckBox</value>
</data> </data>
<data name="&gt;&gt;AutoStartCheckBox.Type" xml:space="preserve"> <data name="&gt;&gt;AutoStartCheckBox.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;AutoStartCheckBox.Parent" xml:space="preserve"> <data name="&gt;&gt;AutoStartCheckBox.Parent" xml:space="preserve">
<value>$this</value> <value>tableLayoutPanel1</value>
</data> </data>
<data name="&gt;&gt;AutoStartCheckBox.ZOrder" xml:space="preserve"> <data name="&gt;&gt;AutoStartCheckBox.ZOrder" xml:space="preserve">
<value>1</value> <value>1</value>
</data> </data>
<data name="SummaryGridView.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms"> <metadata name="PropertyColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Top, Bottom, Left, Right</value>
</data>
<metadata name="PropertyColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<data name="PropertyColumn.HeaderText" xml:space="preserve"> <data name="PropertyColumn.HeaderText" xml:space="preserve">
@ -189,17 +159,20 @@
<data name="PropertyColumn.Width" type="System.Int32, mscorlib"> <data name="PropertyColumn.Width" type="System.Int32, mscorlib">
<value>5</value> <value>5</value>
</data> </data>
<metadata name="ValueColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="ValueColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<data name="ValueColumn.HeaderText" xml:space="preserve"> <data name="ValueColumn.HeaderText" xml:space="preserve">
<value>Value</value> <value>Value</value>
</data> </data>
<data name="SummaryGridView.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="SummaryGridView.Location" type="System.Drawing.Point, System.Drawing"> <data name="SummaryGridView.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 97</value> <value>3, 44</value>
</data> </data>
<data name="SummaryGridView.Size" type="System.Drawing.Size, System.Drawing"> <data name="SummaryGridView.Size" type="System.Drawing.Size, System.Drawing">
<value>508, 142</value> <value>509, 231</value>
</data> </data>
<data name="SummaryGridView.TabIndex" type="System.Int32, mscorlib"> <data name="SummaryGridView.TabIndex" type="System.Int32, mscorlib">
<value>3</value> <value>3</value>
@ -208,15 +181,81 @@
<value>SummaryGridView</value> <value>SummaryGridView</value>
</data> </data>
<data name="&gt;&gt;SummaryGridView.Type" xml:space="preserve"> <data name="&gt;&gt;SummaryGridView.Type" xml:space="preserve">
<value>XenAdmin.Controls.DataGridViewEx.DataGridViewEx, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value> <value>XenAdmin.Controls.DataGridViewEx.DataGridViewEx, [XenCenter_No_Space], Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;SummaryGridView.Parent" xml:space="preserve"> <data name="&gt;&gt;SummaryGridView.Parent" xml:space="preserve">
<value>$this</value> <value>tableLayoutPanel1</value>
</data> </data>
<data name="&gt;&gt;SummaryGridView.ZOrder" xml:space="preserve"> <data name="&gt;&gt;SummaryGridView.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="tableLayoutPanel1.ColumnCount" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 0</value>
</data>
<data name="label1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 0, 3, 15</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>509, 26</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value> <value>0</value>
</data> </data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <data name="label1.Text" xml:space="preserve">
<value>All the necessary information has been collected and the wizard is ready to provision the new virtual machine using the settings shown below.</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tableLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="tableLayoutPanel1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
<data name="tableLayoutPanel1.RowCount" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="tableLayoutPanel1.Size" type="System.Drawing.Size, System.Drawing">
<value>515, 308</value>
</data>
<data name="tableLayoutPanel1.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Name" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Type" xml:space="preserve">
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="tableLayoutPanel1.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="AutoStartCheckBox" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="SummaryGridView" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,Percent,100,AutoSize,0" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing"> <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
@ -229,18 +268,18 @@
<value>PropertyColumn</value> <value>PropertyColumn</value>
</data> </data>
<data name="&gt;&gt;PropertyColumn.Type" xml:space="preserve"> <data name="&gt;&gt;PropertyColumn.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;ValueColumn.Name" xml:space="preserve"> <data name="&gt;&gt;ValueColumn.Name" xml:space="preserve">
<value>ValueColumn</value> <value>ValueColumn</value>
</data> </data>
<data name="&gt;&gt;ValueColumn.Type" xml:space="preserve"> <data name="&gt;&gt;ValueColumn.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="&gt;&gt;$this.Name" xml:space="preserve"> <data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>Page_Finish</value> <value>Page_Finish</value>
</data> </data>
<data name="&gt;&gt;$this.Type" xml:space="preserve"> <data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>XenAdmin.Controls.XenTabPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value> <value>XenAdmin.Controls.XenTabPage, [XenCenter_No_Space], Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
</root> </root>

View File

@ -1391,11 +1391,11 @@
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
<Compile Include="SettingsPanels\BootDevice.cs" /> <Compile Include="SettingsPanels\BootDevice.cs" />
<Compile Include="SettingsPanels\CPUMemoryEditPage.cs"> <Compile Include="SettingsPanels\CpuMemoryEditPage.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="SettingsPanels\CPUMemoryEditPage.Designer.cs"> <Compile Include="SettingsPanels\CpuMemoryEditPage.Designer.cs">
<DependentUpon>CPUMemoryEditPage.cs</DependentUpon> <DependentUpon>CpuMemoryEditPage.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="SettingsPanels\GeneralEditPage.cs"> <Compile Include="SettingsPanels\GeneralEditPage.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
@ -2667,8 +2667,8 @@
<DependentUpon>VMHAEditPage.cs</DependentUpon> <DependentUpon>VMHAEditPage.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="SettingsPanels\CPUMemoryEditPage.resx"> <EmbeddedResource Include="SettingsPanels\CpuMemoryEditPage.resx">
<DependentUpon>CPUMemoryEditPage.cs</DependentUpon> <DependentUpon>CpuMemoryEditPage.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="SettingsPanels\GeneralEditPage.resx"> <EmbeddedResource Include="SettingsPanels\GeneralEditPage.resx">
@ -5660,12 +5660,12 @@
<EmbeddedResource Include="SettingsPanels\BootOptionsEditPage.zh-CN.resx"> <EmbeddedResource Include="SettingsPanels\BootOptionsEditPage.zh-CN.resx">
<DependentUpon>BootOptionsEditPage.cs</DependentUpon> <DependentUpon>BootOptionsEditPage.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="SettingsPanels\CPUMemoryEditPage.ja.resx"> <EmbeddedResource Include="SettingsPanels\CpuMemoryEditPage.ja.resx">
<DependentUpon>CPUMemoryEditPage.cs</DependentUpon> <DependentUpon>CpuMemoryEditPage.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="SettingsPanels\CPUMemoryEditPage.zh-CN.resx"> <EmbeddedResource Include="SettingsPanels\CpuMemoryEditPage.zh-CN.resx">
<DependentUpon>CPUMemoryEditPage.cs</DependentUpon> <DependentUpon>CpuMemoryEditPage.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="SettingsPanels\CustomFieldsDisplayPage.ja.resx"> <EmbeddedResource Include="SettingsPanels\CustomFieldsDisplayPage.ja.resx">

View File

@ -490,20 +490,23 @@ namespace XenAdmin.Actions.OvfActions
if (rasds != null && rasds.Length > 0) if (rasds != null && rasds.Length > 0)
{ {
//The default memory unit is MB (2^20), however, the RASD may contain a different //The default memory unit is MB (2^20), however, the RASD may contain a different
//one with format Bytes*memoryBase^memoryPower (Bytes being a literal string) //one with format byte*memoryBase^memoryPower (byte being a literal string)
double memoryPower = 20.0;
double memoryBase = 2.0; double memoryBase = 2.0;
double memoryPower = 20.0;
foreach (RASD_Type rasd in rasds) foreach (RASD_Type rasd in rasds)
{ {
if (rasd.AllocationUnits.Value.ToLower().StartsWith("bytes")) if (rasd.AllocationUnits.Value.ToLower().StartsWith("byte"))
{ {
string[] a1 = rasd.AllocationUnits.Value.Split('*', '^'); string[] a1 = rasd.AllocationUnits.Value.Split('*', '^');
if (a1.Length == 3) if (a1.Length == 3)
{ {
memoryBase = Convert.ToDouble(a1[1]); if (!double.TryParse(a1[1].Trim(), out memoryBase))
memoryPower = Convert.ToDouble(a1[2]); memoryBase = 2.0;
if (!double.TryParse(a1[2].Trim(), out memoryPower))
memoryPower = 20.0;
} }
} }

View File

@ -28,7 +28,6 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
using XenAdmin.Alerts;
using XenAdmin.Core; using XenAdmin.Core;
using XenAdmin.Network; using XenAdmin.Network;
using XenAPI; using XenAPI;
@ -38,49 +37,54 @@ namespace XenAdmin.Actions
{ {
public class PerfmonOptionsDefinitionAction : AsyncAction public class PerfmonOptionsDefinitionAction : AsyncAction
{ {
private readonly Pool pool; private readonly Pool _pool;
private readonly PerfmonOptionsDefinition perfmonOptions; private readonly string _mailDestination;
private readonly string _mailHub;
private readonly string _mailLangCode;
public PerfmonOptionsDefinitionAction(IXenConnection connection, PerfmonOptionsDefinition perfmonOptions, bool suppressHistory) public PerfmonOptionsDefinitionAction(IXenConnection connection, string mailDestination, string mailHub, string mailLangCode, bool suppressHistory)
: base(connection, Messages.ACTION_CHANGE_EMAIL_OPTIONS, suppressHistory) : base(connection, Messages.ACTION_CHANGE_EMAIL_OPTIONS, suppressHistory)
{ {
this.perfmonOptions = perfmonOptions; _mailDestination = mailDestination;
pool = Helpers.GetPoolOfOne(connection); _mailHub = mailHub;
Description = string.Format(Messages.ACTION_CHANGING_EMAIL_OPTIONS_FOR, pool); _mailLangCode = mailLangCode;
_pool = Helpers.GetPoolOfOne(connection);
ApiMethodsToRoleCheck.AddWithKey("pool.remove_from_other_config", PerfmonOptionsDefinition.MAIL_DESTINATION_KEY_NAME); Description = string.Format(Messages.ACTION_CHANGING_EMAIL_OPTIONS_FOR, _pool);
ApiMethodsToRoleCheck.AddWithKey("pool.remove_from_other_config", PerfmonOptionsDefinition.SMTP_MAILHUB_KEY_NAME);
ApiMethodsToRoleCheck.AddWithKey("pool.remove_from_other_config", PerfmonOptionsDefinition.MAIL_LANGUAGE_KEY_NAME);
if (perfmonOptions != null) ApiMethodsToRoleCheck.AddWithKey("pool.remove_from_other_config", Pool.MAIL_DESTINATION_KEY_NAME);
ApiMethodsToRoleCheck.AddWithKey("pool.remove_from_other_config", Pool.SMTP_MAILHUB_KEY_NAME);
ApiMethodsToRoleCheck.AddWithKey("pool.remove_from_other_config", Pool.MAIL_LANGUAGE_KEY_NAME);
if (_mailDestination != null && _mailHub != null)
{ {
ApiMethodsToRoleCheck.AddWithKey("pool.add_to_other_config", PerfmonOptionsDefinition.MAIL_DESTINATION_KEY_NAME); ApiMethodsToRoleCheck.AddWithKey("pool.add_to_other_config", Pool.MAIL_DESTINATION_KEY_NAME);
ApiMethodsToRoleCheck.AddWithKey("pool.add_to_other_config", PerfmonOptionsDefinition.SMTP_MAILHUB_KEY_NAME); ApiMethodsToRoleCheck.AddWithKey("pool.add_to_other_config", Pool.SMTP_MAILHUB_KEY_NAME);
if (perfmonOptions.MailLanguageCode != null) if (_mailLangCode != null)
ApiMethodsToRoleCheck.AddWithKey("pool.add_to_other_config", PerfmonOptionsDefinition.MAIL_LANGUAGE_KEY_NAME); ApiMethodsToRoleCheck.AddWithKey("pool.add_to_other_config", Pool.MAIL_LANGUAGE_KEY_NAME);
} }
} }
protected override void Run() protected override void Run()
{ {
if (pool == null) if (_pool == null)
return; return;
Pool.remove_from_other_config(Session, pool.opaque_ref, PerfmonOptionsDefinition.MAIL_DESTINATION_KEY_NAME); Pool.remove_from_other_config(Session, _pool.opaque_ref, Pool.MAIL_DESTINATION_KEY_NAME);
if (perfmonOptions != null) if (_mailDestination != null)
Pool.add_to_other_config(Session, pool.opaque_ref, PerfmonOptionsDefinition.MAIL_DESTINATION_KEY_NAME, perfmonOptions.MailDestination); Pool.add_to_other_config(Session, _pool.opaque_ref, Pool.MAIL_DESTINATION_KEY_NAME, _mailDestination);
Pool.remove_from_other_config(Session, pool.opaque_ref, PerfmonOptionsDefinition.SMTP_MAILHUB_KEY_NAME); Pool.remove_from_other_config(Session, _pool.opaque_ref, Pool.SMTP_MAILHUB_KEY_NAME);
if (perfmonOptions != null) if (_mailHub != null)
Pool.add_to_other_config(Session, pool.opaque_ref, PerfmonOptionsDefinition.SMTP_MAILHUB_KEY_NAME, perfmonOptions.MailHub); Pool.add_to_other_config(Session, _pool.opaque_ref, Pool.SMTP_MAILHUB_KEY_NAME, _mailHub);
Pool.remove_from_other_config(Session, pool.opaque_ref, PerfmonOptionsDefinition.MAIL_LANGUAGE_KEY_NAME); Pool.remove_from_other_config(Session, _pool.opaque_ref, Pool.MAIL_LANGUAGE_KEY_NAME);
if (perfmonOptions?.MailLanguageCode != null) if (_mailLangCode != null)
Pool.add_to_other_config(Session, pool.opaque_ref, PerfmonOptionsDefinition.MAIL_LANGUAGE_KEY_NAME, perfmonOptions.MailLanguageCode); Pool.add_to_other_config(Session, _pool.opaque_ref, Pool.MAIL_LANGUAGE_KEY_NAME, _mailLangCode);
} }
} }
} }

View File

@ -35,9 +35,9 @@ using XenAPI;
namespace XenAdmin.Actions namespace XenAdmin.Actions
{ {
/// <summary> /// <summary>
/// Saves changes on a VBD, then tries to plug the VBD into a VM. /// Creates a VBD, then tries to plug it into a VM.
/// </summary> /// </summary>
public class VbdSaveAndPlugAction : AsyncAction public class VbdCreateAndPlugAction : AsyncAction
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
@ -48,24 +48,21 @@ namespace XenAdmin.Actions
/// </summary> /// </summary>
public event Action<string> ShowUserInstruction; public event Action<string> ShowUserInstruction;
public VbdSaveAndPlugAction(VM vm, VBD vbd, string vdiName, Session session, bool suppress) public VbdCreateAndPlugAction(VM vm, VBD vbd, string vdiName, bool suppress)
: base(vm.Connection, string.Format(Messages.ATTACHING_VIRTUAL_DISK, vdiName, vm.Name()), "", suppress) : base(vm.Connection, string.Format(Messages.ATTACHING_VIRTUAL_DISK, vdiName, vm.Name()), "", suppress)
{ {
VM = vm; VM = vm;
this.vbd = vbd; this.vbd = vbd;
// Preserve existing session if provided.
if (session != null)
this.Session = session;
ApiMethodsToRoleCheck.Add("vbd.async_plug"); ApiMethodsToRoleCheck.Add("vbd.create");
ApiMethodsToRoleCheck.Add("vbd.set_userdevice");
if (VM.IsHVM() || !vbd.empty)
ApiMethodsToRoleCheck.AddRange("vbd.get_allowed_operations", "vbd.async_plug");
} }
protected override void Run() protected override void Run()
{ {
// First, save changes to the VBD. string vbdServerRef = VBD.create(Session, vbd);
string vbdServerRef = vbd.SaveChanges(Session, null, null);
if (!VM.IsHVM() && vbd.empty) if (!VM.IsHVM() && vbd.empty)
{ {
@ -79,13 +76,13 @@ namespace XenAdmin.Actions
{ {
log.DebugFormat("Attempting to hot plug VBD {0}.", vbd.uuid); log.DebugFormat("Attempting to hot plug VBD {0}.", vbd.uuid);
this.RelatedTask = XenAPI.VBD.async_plug(Session, vbdServerRef); RelatedTask = VBD.async_plug(Session, vbdServerRef);
PollToCompletion(); PollToCompletion();
this.Description = Messages.ATTACHDISKWIZARD_ATTACHED; Description = Messages.ATTACHDISKWIZARD_ATTACHED;
} }
else else
{ {
VM vm = this.Connection.Resolve(vbd.VM); VM vm = Connection.Resolve(vbd.VM);
if (vm != null && vm.power_state != vm_power_state.Halted) if (vm != null && vm.power_state != vm_power_state.Halted)
{ {
if (vbd.type == vbd_type.CD) if (vbd.type == vbd_type.CD)

View File

@ -49,42 +49,42 @@ namespace XenAdmin.Actions
#region RBAC Dependencies #region RBAC Dependencies
ApiMethodsToRoleCheck.Add("vm.assert_agile"); ApiMethodsToRoleCheck.Add("vm.assert_agile");
ApiMethodsToRoleCheck.AddRange(XenAPI.Role.CommonSessionApiList); ApiMethodsToRoleCheck.AddRange(Role.CommonSessionApiList);
#endregion #endregion
} }
protected override void Run() protected override void Run()
{ {
VBD cdrom = VM.FindVMCDROM(); VBD cdrom = VM.FindVMCDROM();
if (cdrom == null) if (cdrom == null)
{ {
Description = Messages.NEW_DVD_DRIVE_CREATING; Description = Messages.NEW_DVD_DRIVE_CREATING;
// could not find a cd, try and make one
if (VM.VBDs.Count >= VM.MaxVBDsAllowed()) if (VM.VBDs.Count >= VM.MaxVBDsAllowed())
{ {
throw new Exception(Messages.CDDRIVE_MAX_ALLOWED_VBDS); throw new Exception(Messages.CDDRIVE_MAX_ALLOWED_VBDS);
} }
List<String> allowedDevices = new List<String>(XenAPI.VM.get_allowed_VBD_devices(Session, VM.opaque_ref)); var allowedDevices = new List<string>(VM.get_allowed_VBD_devices(Session, VM.opaque_ref));
if (allowedDevices == null || allowedDevices.Count == 0) if (allowedDevices == null || allowedDevices.Count == 0)
{ {
throw new Exception(Messages.CDDRIVE_MAX_ALLOWED_VBDS); throw new Exception(Messages.CDDRIVE_MAX_ALLOWED_VBDS);
} }
XenAPI.VBD cdDrive = new XenAPI.VBD VBD cdDrive = new VBD
{ {
VM = new XenAPI.XenRef<XenAPI.VM>(VM.opaque_ref), VM = new XenRef<VM>(VM.opaque_ref),
bootable = false, bootable = false,
device = "", device = "",
userdevice = allowedDevices.Contains("3") ? "3" : allowedDevices[0], userdevice = allowedDevices.Contains("3") ? "3" : allowedDevices[0],
empty = true, empty = true,
type = XenAPI.vbd_type.CD, type = vbd_type.CD,
mode = XenAPI.vbd_mode.RO mode = vbd_mode.RO
}; };
var cdCreate = new VbdSaveAndPlugAction(VM, cdDrive, Messages.DVD_DRIVE, Session, true); var cdCreate = new VbdCreateAndPlugAction(VM, cdDrive, Messages.DVD_DRIVE, true);
cdCreate.ShowUserInstruction += msg => ShowUserInstruction?.Invoke(msg); cdCreate.ShowUserInstruction += msg => ShowUserInstruction?.Invoke(msg);
cdCreate.RunSync(Session); cdCreate.RunSync(Session);
Description = Messages.NEW_DVD_DRIVE_DONE; Description = Messages.NEW_DVD_DRIVE_DONE;

View File

@ -1,284 +0,0 @@
/* Copyright (c) Cloud Software Group, Inc.
*
* Redistribution and use in source and binary forms,
* with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above
* copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using XenAPI;
using XenAdmin.Network;
using XenAdmin.Core;
namespace XenAdmin.Alerts
{
public class PerfmonOptionsDefinition
{
public const String MAIL_DESTINATION_KEY_NAME = "mail-destination";
public const String SMTP_MAILHUB_KEY_NAME = "ssmtp-mailhub";
public const String MAIL_LANGUAGE_KEY_NAME = "mail-language";
private class MailLanguageList
{
private Dictionary<String, String> _list;
public MailLanguageList(Dictionary<String, String> initList)
{
_list = new Dictionary<String, String>(initList);
}
public String CodeFromName(String name)
{
String ret = null;
if (null == name)
return ret;
foreach(KeyValuePair<String, String> pair in _list)
{
if(pair.Value == name)
{
ret = pair.Key;
break;
}
}
return ret;
}
public String NameFromCode(String code)
{
String ret = null;
if (null == code)
return ret;
foreach (KeyValuePair<String, String> pair in _list)
{
if (pair.Key == code)
{
ret = pair.Value;
break;
}
}
return ret;
}
public bool HasCode(String code)
{
return null == code ? false : _list.ContainsKey(code);
}
public Dictionary<String, String> dataSource()
{
return new Dictionary<String, String>(_list);
}
}
private static readonly char[] mailHubDelim = new char[] { ':' };
private readonly String mailHub;
private readonly String mailDestination;
private readonly String mailLanguageCode;
private static MailLanguageList ml_list = new MailLanguageList(new Dictionary<String, String>() {
{Messages.MAIL_LANGUAGE_ENGLISH_CODE, Messages.MAIL_LANGUAGE_ENGLISH_NAME},
{Messages.MAIL_LANGUAGE_CHINESE_CODE, Messages.MAIL_LANGUAGE_CHINESE_NAME},
{Messages.MAIL_LANGUAGE_JAPANESE_CODE, Messages.MAIL_LANGUAGE_JAPANESE_NAME}
});
public PerfmonOptionsDefinition(String mailHub, String mailDestination, String mailLanguageCode)
{
this.mailHub = mailHub;
this.mailDestination = mailDestination;
this.mailLanguageCode = mailLanguageCode;
}
public String MailHub
{
get
{
return mailHub;
}
}
public String MailDestination
{
get
{
return mailDestination;
}
}
public String MailLanguageCode
{
get
{
return mailLanguageCode;
}
}
public String MailLanguageName
{
get
{
return ml_list.NameFromCode(mailLanguageCode);
}
}
public static String GetSmtpServerAddress(string mailHub)
{
try
{
string[] words = mailHub.Split(mailHubDelim);
if (words.Length > 0)
{
return words[0];
}
}
catch
{
// ignored
}
return "";
}
public static String GetSmtpPort(string mailHub)
{
try
{
string[] words = mailHub.Split(mailHubDelim);
if (words.Length > 1)
{
return words[1];
}
}
catch
{
// ignored
}
return "25";
}
public override string ToString()
{
return String.Format("mail-destination: {0} ssmtp-mailhub: {1}", MailDestination, MailHub);
}
public static PerfmonOptionsDefinition GetPerfmonOptionsDefinitions(IXenObject xmo)
{
if (xmo == null)
return null;
IXenConnection connection = xmo.Connection;
if (connection == null)
return null;
string mailDestination = GetMailDestination(connection);
string mailHub = GetSmtpMailHub(connection);
string mailLanguageCode = GetMailLanguageCode(connection);
if (mailDestination == null || mailHub == null)
return null;
return new PerfmonOptionsDefinition(mailHub, mailDestination, mailLanguageCode);
}
public static string GetMailDestination(IXenConnection connection)
{
var pool = Helpers.GetPoolOfOne(connection);
if (pool == null)
return null;
var otherConfig = Helpers.GetOtherConfig(pool);
if (otherConfig == null)
return null;
if (!otherConfig.ContainsKey(MAIL_DESTINATION_KEY_NAME))
return null;
var mailAddress = otherConfig[MAIL_DESTINATION_KEY_NAME]?.Trim();
return string.IsNullOrEmpty(mailAddress) ? null : mailAddress;
}
public static string GetSmtpMailHub(IXenConnection connection)
{
var pool = Helpers.GetPoolOfOne(connection);
if (pool == null)
return null;
var otherConfig = Helpers.GetOtherConfig(pool);
if (otherConfig == null)
return null;
if (!otherConfig.ContainsKey(SMTP_MAILHUB_KEY_NAME))
return null;
var mailHub = otherConfig[SMTP_MAILHUB_KEY_NAME]?.Trim();
return string.IsNullOrEmpty(mailHub) ? null : mailHub;
}
public static string GetMailLanguageCode(IXenConnection connection)
{
var pool = Helpers.GetPoolOfOne(connection);
if (pool == null)
return null;
var otherConfig = Helpers.GetOtherConfig(pool);
if (otherConfig == null)
return null;
if (!otherConfig.ContainsKey(MAIL_LANGUAGE_KEY_NAME))
return null;
var mailLanguageCode = otherConfig[MAIL_LANGUAGE_KEY_NAME]?.Trim();
return string.IsNullOrEmpty(mailLanguageCode) ? null : mailLanguageCode;
}
public static String MailLanguageNameFromCode(String code)
{
return ml_list.NameFromCode(code);
}
public static String MailLanguageCodeFromName(String name)
{
return ml_list.CodeFromName(name);
}
public static bool MailLanguageHasCode(String code)
{
return ml_list.HasCode(code);
}
public static object MailLanguageDataSource()
{
return PerfmonOptionsDefinition.ml_list.dataSource();
}
}
}

View File

@ -10702,15 +10702,6 @@ namespace XenAdmin {
} }
} }
/// <summary>
/// Looks up a localized string similar to Home Server:.
/// </summary>
public static string CPM_SUMMARY_KEY_HOME_SERVER {
get {
return ResourceManager.GetString("CPM_SUMMARY_KEY_HOME_SERVER", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Template:. /// Looks up a localized string similar to Template:.
/// </summary> /// </summary>
@ -10765,15 +10756,6 @@ namespace XenAdmin {
} }
} }
/// <summary>
/// Looks up a localized string similar to Unset.
/// </summary>
public static string CPM_SUMMARY_UNSET {
get {
return ResourceManager.GetString("CPM_SUMMARY_UNSET", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Pl&amp;ace all virtual disks on the same SR:. /// Looks up a localized string similar to Pl&amp;ace all virtual disks on the same SR:.
/// </summary> /// </summary>
@ -11203,24 +11185,6 @@ namespace XenAdmin {
} }
} }
/// <summary>
/// Looks up a localized string similar to CPU and Memory.
/// </summary>
public static string CPU_AND_MEMORY {
get {
return ResourceManager.GetString("CPU_AND_MEMORY", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} vCPU(s) &amp; {1} MB RAM.
/// </summary>
public static string CPU_AND_MEMORY_SUB {
get {
return ResourceManager.GetString("CPU_AND_MEMORY_SUB", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to {0} vCPU(s). /// Looks up a localized string similar to {0} vCPU(s).
/// </summary> /// </summary>
@ -17544,16 +17508,7 @@ namespace XenAdmin {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Target:. /// Looks up a localized string similar to Home server:.
/// </summary>
public static string FINISH_PAGE_TARGET {
get {
return ResourceManager.GetString("FINISH_PAGE_TARGET", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} target:.
/// </summary> /// </summary>
public static string FINISH_PAGE_TARGET_FOR_VM { public static string FINISH_PAGE_TARGET_FOR_VM {
get { get {
@ -20945,6 +20900,15 @@ namespace XenAdmin {
} }
} }
/// <summary>
/// Looks up a localized string similar to The appliance contains {0} VM(s) with more than {1} vCPUs. Where a VM may be running actively hostile privileged code {2} recommends that the vCPU limit is set to {1} to prevent impact on system availability..
/// </summary>
public static string IMPORT_VM_CPUS_COUNT_UNTRUSTED_WARNING {
get {
return ResourceManager.GetString("IMPORT_VM_CPUS_COUNT_UNTRUSTED_WARNING", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Import VM from.... /// Looks up a localized string similar to Import VM from....
/// </summary> /// </summary>
@ -21035,6 +20999,24 @@ namespace XenAdmin {
} }
} }
/// <summary>
/// Looks up a localized string similar to The imported appliance requires a minimum of {0} vCPUs, while the number of physical CPUs in the selected server is {1}. You will not be able to start the appliance on the selected server..
/// </summary>
public static string IMPORT_WIZARD_CPUS_COUNT_MISMATCH_HOST {
get {
return ResourceManager.GetString("IMPORT_WIZARD_CPUS_COUNT_MISMATCH_HOST", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The imported appliance requires a minimum of {0} vCPUs, while the maximum number of physical CPUs in the pool is {1}. You will not be able to start the appliance on the selected pool..
/// </summary>
public static string IMPORT_WIZARD_CPUS_COUNT_MISMATCH_POOL {
get {
return ResourceManager.GetString("IMPORT_WIZARD_CPUS_COUNT_MISMATCH_POOL", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to &amp;Import to:. /// Looks up a localized string similar to &amp;Import to:.
/// </summary> /// </summary>
@ -21089,6 +21071,24 @@ namespace XenAdmin {
} }
} }
/// <summary>
/// Looks up a localized string similar to The imported appliance requires a minimum of {0} of memory, while the available memory on the server is {1}. You will not be able to start the VM on the selected server..
/// </summary>
public static string IMPORT_WIZARD_INSUFFICIENT_MEMORY_HOST {
get {
return ResourceManager.GetString("IMPORT_WIZARD_INSUFFICIENT_MEMORY_HOST", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The imported appliance requires a minimum of {0} of memory, while the maximum available memory on the pool is {1}. You will not be able to start the VM on the selected pool..
/// </summary>
public static string IMPORT_WIZARD_INSUFFICIENT_MEMORY_POOL {
get {
return ResourceManager.GetString("IMPORT_WIZARD_INSUFFICIENT_MEMORY_POOL", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Map the virtual network interfaces in the VMs you are importing to networks in the destination pool or standalone server.. /// Looks up a localized string similar to Map the virtual network interfaces in the VMs you are importing to networks in the destination pool or standalone server..
/// </summary> /// </summary>
@ -26994,28 +26994,20 @@ namespace XenAdmin {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to The amount of memory allocated to the new VM is greater than the amount of physical memory on any server in the pool. /// Looks up a localized string similar to The amount of memory allocated to the new VM is greater than the amount of physical memory available on any server in the pool ({0})..
///
///Server &apos;{0}&apos; has {1} of physical memory in total.
///
///You will not be able to start this VM without increasing the amount of physical memory on one of the servers in the pool..
/// </summary> /// </summary>
public static string NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN1 { public static string NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN_FREE {
get { get {
return ResourceManager.GetString("NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN1", resourceCulture); return ResourceManager.GetString("NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN_FREE", resourceCulture);
} }
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to The amount of memory allocated to the new VM is greater than the amount of physical memory available on any server in the pool. /// Looks up a localized string similar to The amount of memory allocated to the new VM is greater than the amount of physical memory on any server in the pool ({0})..
///
///Server &apos;{0}&apos; has {1} of physical memory available.
///
///You will not be able to start this VM without freeing some space on one of the servers..
/// </summary> /// </summary>
public static string NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN2 { public static string NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN_TOTAL {
get { get {
return ResourceManager.GetString("NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN2", resourceCulture); return ResourceManager.GetString("NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN_TOTAL", resourceCulture);
} }
} }
@ -27029,7 +27021,7 @@ namespace XenAdmin {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Specify the number of virtual CPUs, their topology, and the amount of memory that will be allocated to the new virtual machine. . /// Looks up a localized string similar to Specify the number of vCPUs, their topology, and the amount of memory that will be allocated to the new virtual machine. .
/// </summary> /// </summary>
public static string NEWVMWIZARD_CPUMEMPAGE_RUBRIC { public static string NEWVMWIZARD_CPUMEMPAGE_RUBRIC {
get { get {
@ -27065,26 +27057,20 @@ namespace XenAdmin {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to The number of vCPUs given to the new VM is greater than the number of physical CPUs on any server in the pool. /// Looks up a localized string similar to You have specified {0} vCPUs, but none of the pool servers have more than {1} physical CPUs. You will not be able to start the VM..
///
///Server &apos;{0}&apos; has {1} physical CPUs.
///
///Performance of this VM will be greatly reduced if it is started with this many vCPUs..
/// </summary> /// </summary>
public static string NEWVMWIZARD_CPUMEMPAGE_VCPUSWARN { public static string NEWVMWIZARD_CPUMEMPAGE_VCPUSWARN_POOL {
get { get {
return ResourceManager.GetString("NEWVMWIZARD_CPUMEMPAGE_VCPUSWARN", resourceCulture); return ResourceManager.GetString("NEWVMWIZARD_CPUMEMPAGE_VCPUSWARN_POOL", resourceCulture);
} }
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to All the necessary information has been collected and the wizard is ready to provision the new virtual machine using the settings shown below. /// Looks up a localized string similar to You have specified {0} vCPUs, but the server has only {1} physical CPUs. You will not be able to start the VM..
///
///Review these settings, then click Previous if you need to change anything. Otherwise, click Create Now to create the new VM. It may take several minutes to create the new VM..
/// </summary> /// </summary>
public static string NEWVMWIZARD_FINISHPAGE { public static string NEWVMWIZARD_CPUMEMPAGE_VCPUSWARN_STANDALONE_HOST {
get { get {
return ResourceManager.GetString("NEWVMWIZARD_FINISHPAGE", resourceCulture); return ResourceManager.GetString("NEWVMWIZARD_CPUMEMPAGE_VCPUSWARN_STANDALONE_HOST", resourceCulture);
} }
} }
@ -38762,13 +38748,11 @@ namespace XenAdmin {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to The number of VCPUs is greater than the number of physical CPUs on the host server. This will significantly reduce VM performance. /// Looks up a localized string similar to You have selected more than {0} vCPUs for the new VM. Where a VM may be running actively hostile privileged code {1} recommends that the vCPU limit is set to {0} to prevent impact on system availability..
///
///To optimize VM performance, you should reduce the number of VCPUs to less than or equal to the number of physical CPUs..
/// </summary> /// </summary>
public static string VCPUS_MORE_THAN_PCPUS { public static string VCPUS_UNTRUSTED_VM_WARNING {
get { get {
return ResourceManager.GetString("VCPUS_MORE_THAN_PCPUS", resourceCulture); return ResourceManager.GetString("VCPUS_UNTRUSTED_VM_WARNING", resourceCulture);
} }
} }
@ -39420,6 +39404,24 @@ namespace XenAdmin {
} }
} }
/// <summary>
/// Looks up a localized string similar to The amount of physical memory allocated to this VM is greater than the total memory of its home server..
/// </summary>
public static string VM_CPUMEMPAGE_INSUFFICIENT_MEMORY_HOST {
get {
return ResourceManager.GetString("VM_CPUMEMPAGE_INSUFFICIENT_MEMORY_HOST", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The amount of physical memory allocated to this VM is greater than the total memory of any server in the pool..
/// </summary>
public static string VM_CPUMEMPAGE_INSUFFICIENT_MEMORY_POOL {
get {
return ResourceManager.GetString("VM_CPUMEMPAGE_INSUFFICIENT_MEMORY_POOL", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Maximum number of &amp;vCPUs:. /// Looks up a localized string similar to Maximum number of &amp;vCPUs:.
/// </summary> /// </summary>
@ -39457,7 +39459,16 @@ namespace XenAdmin {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to It is recommended to allocate at least {0} vCPUs for this VM. /// Looks up a localized string similar to The VM&apos;s home server does not have enough physical CPUs to start the VM. The VM will start on another server..
/// </summary>
public static string VM_CPUMEMPAGE_VCPU_HOME_HOST_WARNING {
get {
return ResourceManager.GetString("VM_CPUMEMPAGE_VCPU_HOME_HOST_WARNING", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to It is recommended to allocate at least {0} vCPUs for this VM..
/// </summary> /// </summary>
public static string VM_CPUMEMPAGE_VCPU_MIN_WARNING { public static string VM_CPUMEMPAGE_VCPU_MIN_WARNING {
get { get {
@ -39466,7 +39477,7 @@ namespace XenAdmin {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to More vCPUs than physical CPUs may lead to reduced VM performance. /// Looks up a localized string similar to There are no servers with enough physical CPUs to start the VM..
/// </summary> /// </summary>
public static string VM_CPUMEMPAGE_VCPU_WARNING { public static string VM_CPUMEMPAGE_VCPU_WARNING {
get { get {

View File

@ -3835,9 +3835,6 @@ This action cannot be undone. Are you sure you want to continue?</value>
<data name="CPM_SUMMARY_KEY_DESTINATION" xml:space="preserve"> <data name="CPM_SUMMARY_KEY_DESTINATION" xml:space="preserve">
<value>Destination:</value> <value>Destination:</value>
</data> </data>
<data name="CPM_SUMMARY_KEY_HOME_SERVER" xml:space="preserve">
<value>Home Server:</value>
</data>
<data name="CPM_SUMMARY_KEY_MIGRATE_TEMPLATE" xml:space="preserve"> <data name="CPM_SUMMARY_KEY_MIGRATE_TEMPLATE" xml:space="preserve">
<value>Template:</value> <value>Template:</value>
</data> </data>
@ -3856,9 +3853,6 @@ This action cannot be undone. Are you sure you want to continue?</value>
<data name="CPM_SUMMARY_NETWORK_NOT_FOUND" xml:space="preserve"> <data name="CPM_SUMMARY_NETWORK_NOT_FOUND" xml:space="preserve">
<value>Network not found</value> <value>Network not found</value>
</data> </data>
<data name="CPM_SUMMARY_UNSET" xml:space="preserve">
<value>Unset</value>
</data>
<data name="CPM_WIZARD_ALL_ON_SAME_SR_RADIO" xml:space="preserve"> <data name="CPM_WIZARD_ALL_ON_SAME_SR_RADIO" xml:space="preserve">
<value>Pl&amp;ace all virtual disks on the same SR:</value> <value>Pl&amp;ace all virtual disks on the same SR:</value>
</data> </data>
@ -4006,12 +4000,6 @@ For optimal performance and reliability during VM migration, ensure that the net
<data name="CPU" xml:space="preserve"> <data name="CPU" xml:space="preserve">
<value>CPU</value> <value>CPU</value>
</data> </data>
<data name="CPU_AND_MEMORY" xml:space="preserve">
<value>CPU and Memory</value>
</data>
<data name="CPU_AND_MEMORY_SUB" xml:space="preserve">
<value>{0} vCPU(s) &amp; {1} MB RAM</value>
</data>
<data name="CPU_SUB" xml:space="preserve"> <data name="CPU_SUB" xml:space="preserve">
<value>{0} vCPU(s)</value> <value>{0} vCPU(s)</value>
</data> </data>
@ -6140,11 +6128,8 @@ Would you like to eject these ISOs before continuing?</value>
<data name="FINISH_PAGE_STORAGE_FOR_VM" xml:space="preserve"> <data name="FINISH_PAGE_STORAGE_FOR_VM" xml:space="preserve">
<value>{0} storage:</value> <value>{0} storage:</value>
</data> </data>
<data name="FINISH_PAGE_TARGET" xml:space="preserve">
<value>Target:</value>
</data>
<data name="FINISH_PAGE_TARGET_FOR_VM" xml:space="preserve"> <data name="FINISH_PAGE_TARGET_FOR_VM" xml:space="preserve">
<value>{0} target:</value> <value>Home server:</value>
</data> </data>
<data name="FINISH_PAGE_TEXT" xml:space="preserve"> <data name="FINISH_PAGE_TEXT" xml:space="preserve">
<value>Finish</value> <value>Finish</value>
@ -7305,6 +7290,9 @@ This might result in failure to migrate VMs to this server during the RPU or to
<data name="IMPORT_VM_CONFIGURE_STORAGE" xml:space="preserve"> <data name="IMPORT_VM_CONFIGURE_STORAGE" xml:space="preserve">
<value>Configure storage for the new VM</value> <value>Configure storage for the new VM</value>
</data> </data>
<data name="IMPORT_VM_CPUS_COUNT_UNTRUSTED_WARNING" xml:space="preserve">
<value>The appliance contains {0} VM(s) with more than {1} vCPUs. Where a VM may be running actively hostile privileged code {2} recommends that the vCPU limit is set to {1} to prevent impact on system availability.</value>
</data>
<data name="IMPORT_VM_FROM" xml:space="preserve"> <data name="IMPORT_VM_FROM" xml:space="preserve">
<value>Import VM from...</value> <value>Import VM from...</value>
</data> </data>
@ -7335,6 +7323,12 @@ This might result in failure to migrate VMs to this server during the RPU or to
<data name="IMPORT_WIZARD_ALL_ON_SAME_SR_RADIO" xml:space="preserve"> <data name="IMPORT_WIZARD_ALL_ON_SAME_SR_RADIO" xml:space="preserve">
<value>Place &amp;all imported virtual disks on this target SR:</value> <value>Place &amp;all imported virtual disks on this target SR:</value>
</data> </data>
<data name="IMPORT_WIZARD_CPUS_COUNT_MISMATCH_HOST" xml:space="preserve">
<value>The imported appliance requires a minimum of {0} vCPUs, while the number of physical CPUs in the selected server is {1}. You will not be able to start the appliance on the selected server.</value>
</data>
<data name="IMPORT_WIZARD_CPUS_COUNT_MISMATCH_POOL" xml:space="preserve">
<value>The imported appliance requires a minimum of {0} vCPUs, while the maximum number of physical CPUs in the pool is {1}. You will not be able to start the appliance on the selected pool.</value>
</data>
<data name="IMPORT_WIZARD_DESTINATION_DESTINATION" xml:space="preserve"> <data name="IMPORT_WIZARD_DESTINATION_DESTINATION" xml:space="preserve">
<value>&amp;Import to:</value> <value>&amp;Import to:</value>
</data> </data>
@ -7353,6 +7347,12 @@ This might result in failure to migrate VMs to this server during the RPU or to
<data name="IMPORT_WIZARD_FAILED_UNCOMPRESS" xml:space="preserve"> <data name="IMPORT_WIZARD_FAILED_UNCOMPRESS" xml:space="preserve">
<value>Failed to uncompress file {0}. Please see the logs for more information.</value> <value>Failed to uncompress file {0}. Please see the logs for more information.</value>
</data> </data>
<data name="IMPORT_WIZARD_INSUFFICIENT_MEMORY_HOST" xml:space="preserve">
<value>The imported appliance requires a minimum of {0} of memory, while the available memory on the server is {1}. You will not be able to start the VM on the selected server.</value>
</data>
<data name="IMPORT_WIZARD_INSUFFICIENT_MEMORY_POOL" xml:space="preserve">
<value>The imported appliance requires a minimum of {0} of memory, while the maximum available memory on the pool is {1}. You will not be able to start the VM on the selected pool.</value>
</data>
<data name="IMPORT_WIZARD_NETWORKING_INTRO" xml:space="preserve"> <data name="IMPORT_WIZARD_NETWORKING_INTRO" xml:space="preserve">
<value>Map the virtual network interfaces in the VMs you are importing to networks in the destination pool or standalone server.</value> <value>Map the virtual network interfaces in the VMs you are importing to networks in the destination pool or standalone server.</value>
</data> </data>
@ -9399,25 +9399,17 @@ When you configure an NFS storage repository, you simply provide the host name o
<data name="NEWVMWIZARD_CPUMEMPAGE_MEMORYINFO" xml:space="preserve"> <data name="NEWVMWIZARD_CPUMEMPAGE_MEMORYINFO" xml:space="preserve">
<value>(min = {0}, max = {1})</value> <value>(min = {0}, max = {1})</value>
</data> </data>
<data name="NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN1" xml:space="preserve"> <data name="NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN_FREE" xml:space="preserve">
<value>The amount of memory allocated to the new VM is greater than the amount of physical memory on any server in the pool. <value>The amount of memory allocated to the new VM is greater than the amount of physical memory available on any server in the pool ({0}).</value>
Server '{0}' has {1} of physical memory in total.
You will not be able to start this VM without increasing the amount of physical memory on one of the servers in the pool.</value>
</data> </data>
<data name="NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN2" xml:space="preserve"> <data name="NEWVMWIZARD_CPUMEMPAGE_MEMORYWARN_TOTAL" xml:space="preserve">
<value>The amount of memory allocated to the new VM is greater than the amount of physical memory available on any server in the pool. <value>The amount of memory allocated to the new VM is greater than the amount of physical memory on any server in the pool ({0}).</value>
Server '{0}' has {1} of physical memory available.
You will not be able to start this VM without freeing some space on one of the servers.</value>
</data> </data>
<data name="NEWVMWIZARD_CPUMEMPAGE_NAME" xml:space="preserve"> <data name="NEWVMWIZARD_CPUMEMPAGE_NAME" xml:space="preserve">
<value>CPU &amp;&amp; Memory</value> <value>CPU &amp;&amp; Memory</value>
</data> </data>
<data name="NEWVMWIZARD_CPUMEMPAGE_RUBRIC" xml:space="preserve"> <data name="NEWVMWIZARD_CPUMEMPAGE_RUBRIC" xml:space="preserve">
<value>Specify the number of virtual CPUs, their topology, and the amount of memory that will be allocated to the new virtual machine. </value> <value>Specify the number of vCPUs, their topology, and the amount of memory that will be allocated to the new virtual machine. </value>
</data> </data>
<data name="NEWVMWIZARD_CPUMEMPAGE_TITLE" xml:space="preserve"> <data name="NEWVMWIZARD_CPUMEMPAGE_TITLE" xml:space="preserve">
<value>Allocate processor and memory resources</value> <value>Allocate processor and memory resources</value>
@ -9428,17 +9420,11 @@ You will not be able to start this VM without freeing some space on one of the s
<data name="NEWVMWIZARD_CPUMEMPAGE_VCPUS" xml:space="preserve"> <data name="NEWVMWIZARD_CPUMEMPAGE_VCPUS" xml:space="preserve">
<value>vCPUs</value> <value>vCPUs</value>
</data> </data>
<data name="NEWVMWIZARD_CPUMEMPAGE_VCPUSWARN" xml:space="preserve"> <data name="NEWVMWIZARD_CPUMEMPAGE_VCPUSWARN_POOL" xml:space="preserve">
<value>The number of vCPUs given to the new VM is greater than the number of physical CPUs on any server in the pool. <value>You have specified {0} vCPUs, but none of the pool servers have more than {1} physical CPUs. You will not be able to start the VM.</value>
Server '{0}' has {1} physical CPUs.
Performance of this VM will be greatly reduced if it is started with this many vCPUs.</value>
</data> </data>
<data name="NEWVMWIZARD_FINISHPAGE" xml:space="preserve"> <data name="NEWVMWIZARD_CPUMEMPAGE_VCPUSWARN_STANDALONE_HOST" xml:space="preserve">
<value>All the necessary information has been collected and the wizard is ready to provision the new virtual machine using the settings shown below. <value>You have specified {0} vCPUs, but the server has only {1} physical CPUs. You will not be able to start the VM.</value>
Review these settings, then click Previous if you need to change anything. Otherwise, click Create Now to create the new VM. It may take several minutes to create the new VM.</value>
</data> </data>
<data name="NEWVMWIZARD_FINISHPAGE_CREATE" xml:space="preserve"> <data name="NEWVMWIZARD_FINISHPAGE_CREATE" xml:space="preserve">
<value>&amp;Create Now</value> <value>&amp;Create Now</value>
@ -13393,10 +13379,8 @@ To start a {0} trial, click the button below.</value>
<data name="VCPU_ONLY_WHEN_HALTED" xml:space="preserve"> <data name="VCPU_ONLY_WHEN_HALTED" xml:space="preserve">
<value>The vCPUs can only be changed when the VM is shut down.</value> <value>The vCPUs can only be changed when the VM is shut down.</value>
</data> </data>
<data name="VCPUS_MORE_THAN_PCPUS" xml:space="preserve"> <data name="VCPUS_UNTRUSTED_VM_WARNING" xml:space="preserve">
<value>The number of VCPUs is greater than the number of physical CPUs on the host server. This will significantly reduce VM performance. <value>You have selected more than {0} vCPUs for the new VM. Where a VM may be running actively hostile privileged code {1} recommends that the vCPU limit is set to {0} to prevent impact on system availability.</value>
To optimize VM performance, you should reduce the number of VCPUs to less than or equal to the number of physical CPUs.</value>
</data> </data>
<data name="VDI" xml:space="preserve"> <data name="VDI" xml:space="preserve">
<value>VDI</value> <value>VDI</value>
@ -13614,6 +13598,12 @@ To optimize VM performance, you should reduce the number of VCPUs to less than o
<data name="VM_CPUMEMPAGE_INITIAL_VCPUS_LABEL" xml:space="preserve"> <data name="VM_CPUMEMPAGE_INITIAL_VCPUS_LABEL" xml:space="preserve">
<value>Initial number of v&amp;CPUs:</value> <value>Initial number of v&amp;CPUs:</value>
</data> </data>
<data name="VM_CPUMEMPAGE_INSUFFICIENT_MEMORY_HOST" xml:space="preserve">
<value>The amount of physical memory allocated to this VM is greater than the total memory of its home server.</value>
</data>
<data name="VM_CPUMEMPAGE_INSUFFICIENT_MEMORY_POOL" xml:space="preserve">
<value>The amount of physical memory allocated to this VM is greater than the total memory of any server in the pool.</value>
</data>
<data name="VM_CPUMEMPAGE_MAX_VCPUS_LABEL" xml:space="preserve"> <data name="VM_CPUMEMPAGE_MAX_VCPUS_LABEL" xml:space="preserve">
<value>Maximum number of &amp;vCPUs:</value> <value>Maximum number of &amp;vCPUs:</value>
</data> </data>
@ -13626,11 +13616,14 @@ To optimize VM performance, you should reduce the number of VCPUs to less than o
<data name="VM_CPUMEMPAGE_RUBRIC_HOTPLUG" xml:space="preserve"> <data name="VM_CPUMEMPAGE_RUBRIC_HOTPLUG" xml:space="preserve">
<value>If the initial number of vCPUs is set lower than the maximum number, more vCPUs can be added to the virtual machine while it is running. </value> <value>If the initial number of vCPUs is set lower than the maximum number, more vCPUs can be added to the virtual machine while it is running. </value>
</data> </data>
<data name="VM_CPUMEMPAGE_VCPU_HOME_HOST_WARNING" xml:space="preserve">
<value>The VM's home server does not have enough physical CPUs to start the VM. The VM will start on another server.</value>
</data>
<data name="VM_CPUMEMPAGE_VCPU_MIN_WARNING" xml:space="preserve"> <data name="VM_CPUMEMPAGE_VCPU_MIN_WARNING" xml:space="preserve">
<value>It is recommended to allocate at least {0} vCPUs for this VM</value> <value>It is recommended to allocate at least {0} vCPUs for this VM.</value>
</data> </data>
<data name="VM_CPUMEMPAGE_VCPU_WARNING" xml:space="preserve"> <data name="VM_CPUMEMPAGE_VCPU_WARNING" xml:space="preserve">
<value>More vCPUs than physical CPUs may lead to reduced VM performance</value> <value>There are no servers with enough physical CPUs to start the VM.</value>
</data> </data>
<data name="VM_CPUMEMPAGE_VCPUS_LABEL" xml:space="preserve"> <data name="VM_CPUMEMPAGE_VCPUS_LABEL" xml:space="preserve">
<value>&amp;Number of vCPUs:</value> <value>&amp;Number of vCPUs:</value>

View File

@ -37,6 +37,16 @@ namespace XenAPI
{ {
public partial class Pool : IComparable<Pool>, IEquatable<Pool> public partial class Pool : IComparable<Pool>, IEquatable<Pool>
{ {
private const string ROLLING_UPGRADE_IN_PROGRESS = "rolling_upgrade_in_progress";
private const string FORBID_RPU_FOR_HCI = "hci-forbid-rpu";
private const string FAULT_TOLERANCE_LIMIT_FOR_HCI = "hci-limit-fault-tolerance";
private const string FORBID_UPDATE_AUTO_RESTARTS = "hci-forbid-update-auto-restart";
public const string HEALTH_CHECK_ENROLLMENT = "Enrollment";
public const string MAIL_DESTINATION_KEY_NAME = "mail-destination";
public const string SMTP_MAILHUB_KEY_NAME = "ssmtp-mailhub";
public const string MAIL_LANGUAGE_KEY_NAME = "mail-language";
public override string ToString() public override string ToString()
{ {
return Name(); return Name();
@ -106,12 +116,6 @@ namespace XenAPI
return Connection != null && (name_label != "" || Connection.Cache.HostCount > 1); return Connection != null && (name_label != "" || Connection.Cache.HostCount > 1);
} }
private const string ROLLING_UPGRADE_IN_PROGRESS = "rolling_upgrade_in_progress";
private const string FORBID_RPU_FOR_HCI = "hci-forbid-rpu";
private const string FAULT_TOLERANCE_LIMIT_FOR_HCI = "hci-limit-fault-tolerance";
private const string FORBID_UPDATE_AUTO_RESTARTS = "hci-forbid-update-auto-restart";
public const string HEALTH_CHECK_ENROLLMENT = "Enrollment";
public bool RollingUpgrade() public bool RollingUpgrade()
{ {
return other_config != null && other_config.ContainsKey(ROLLING_UPGRADE_IN_PROGRESS); return other_config != null && other_config.ContainsKey(ROLLING_UPGRADE_IN_PROGRESS);

View File

@ -59,6 +59,8 @@ namespace XenAPI
public const long DEFAULT_MEM_MIN_IMG_IMPORT = 256 * Util.BINARY_MEGA; public const long DEFAULT_MEM_MIN_IMG_IMPORT = 256 * Util.BINARY_MEGA;
public const int DEFAULT_CORES_PER_SOCKET = 1; public const int DEFAULT_CORES_PER_SOCKET = 1;
public const long MAX_SOCKETS = 16; // current hard limit in Xen: CA-198276 public const long MAX_SOCKETS = 16; // current hard limit in Xen: CA-198276
// CP-41825: > 32 vCPUs is only supported for trusted VMs
public const long MAX_VCPUS_FOR_NON_TRUSTED_VMS = 32;
private XmlDocument xdRecommendations = null; private XmlDocument xdRecommendations = null;
public const int MAX_ALLOWED_VTPMS = 1; public const int MAX_ALLOWED_VTPMS = 1;
@ -477,16 +479,6 @@ namespace XenAPI
other_config = SetDictionaryKey(other_config, "auto_poweron", value.ToString().ToLower()); other_config = SetDictionaryKey(other_config, "auto_poweron", value.ToString().ToLower());
} }
public bool GetIgnoreExcessiveVcpus()
{
return BoolKey(other_config, "ignore_excessive_vcpus");
}
public void SetIgnoreExcessiveVcpus(bool value)
{
other_config = SetDictionaryKey(other_config, "ignore_excessive_vcpus", value.ToString().ToLower());
}
public string IsOnSharedStorage() public string IsOnSharedStorage()
{ {
foreach (XenRef<VBD> vbdRef in VBDs) foreach (XenRef<VBD> vbdRef in VBDs)

View File

@ -139,7 +139,7 @@
<Compile Include="Actions\USB\DeleteVUSBAction.cs" /> <Compile Include="Actions\USB\DeleteVUSBAction.cs" />
<Compile Include="Actions\USB\SetUsbPassthroughAction.cs" /> <Compile Include="Actions\USB\SetUsbPassthroughAction.cs" />
<Compile Include="Actions\VBD\VbdEditAction.cs" /> <Compile Include="Actions\VBD\VbdEditAction.cs" />
<Compile Include="Actions\VBD\VbdSaveAndPlugAction.cs" /> <Compile Include="Actions\VBD\VbdCreateAndPlugAction.cs" />
<Compile Include="Actions\DR\VdiOpenDatabaseAction.cs" /> <Compile Include="Actions\DR\VdiOpenDatabaseAction.cs" />
<Compile Include="Actions\VDI\CreateDiskAction.cs" /> <Compile Include="Actions\VDI\CreateDiskAction.cs" />
<Compile Include="Actions\VDI\MigrateVirtualDiskAction.cs" /> <Compile Include="Actions\VDI\MigrateVirtualDiskAction.cs" />
@ -171,6 +171,11 @@
<Compile Include="Actions\StatusReport\ZipStatusReportAction.cs" /> <Compile Include="Actions\StatusReport\ZipStatusReportAction.cs" />
<Compile Include="Alerts\Types\Alert.cs" /> <Compile Include="Alerts\Types\Alert.cs" />
<Compile Include="BrandManager.cs" /> <Compile Include="BrandManager.cs" />
<Compile Include="Messages.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Messages.resx</DependentUpon>
</Compile>
<Compile Include="SshConsole.cs" /> <Compile Include="SshConsole.cs" />
<Compile Include="FriendlyNames.Designer.cs"> <Compile Include="FriendlyNames.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
@ -203,11 +208,6 @@
<Compile Include="FriendlyNameManager.cs" /> <Compile Include="FriendlyNameManager.cs" />
<Compile Include="InvokeHelper.cs" /> <Compile Include="InvokeHelper.cs" />
<Compile Include="Mappings\VmMapping.cs" /> <Compile Include="Mappings\VmMapping.cs" />
<Compile Include="Messages.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Messages.resx</DependentUpon>
</Compile>
<Compile Include="Network\Cache.cs" /> <Compile Include="Network\Cache.cs" />
<Compile Include="Network\ConnectTask.cs" /> <Compile Include="Network\ConnectTask.cs" />
<Compile Include="Network\Heartbeat.cs" /> <Compile Include="Network\Heartbeat.cs" />
@ -305,7 +305,6 @@
<Compile Include="Actions\WLB\SendWlbConfigurationAction.cs" /> <Compile Include="Actions\WLB\SendWlbConfigurationAction.cs" />
<Compile Include="Actions\WLB\WlbRetrieveRecommendationsAction.cs" /> <Compile Include="Actions\WLB\WlbRetrieveRecommendationsAction.cs" />
<Compile Include="Alerts\PerfmonDefinition.cs" /> <Compile Include="Alerts\PerfmonDefinition.cs" />
<Compile Include="Alerts\PerfmonOptionsDefinition.cs" />
<Compile Include="InvisibleMessages.Designer.cs"> <Compile Include="InvisibleMessages.Designer.cs">
<DependentUpon>InvisibleMessages.resx</DependentUpon> <DependentUpon>InvisibleMessages.resx</DependentUpon>
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>

View File

@ -49,7 +49,7 @@ rebranding_global()
-e "s#\[XenCenter_No_Space\]#${BRANDING_BRAND_CONSOLE_NO_SPACE}#g" \ -e "s#\[XenCenter_No_Space\]#${BRANDING_BRAND_CONSOLE_NO_SPACE}#g" \
-e "s#xencenter\/current-release\/#${BRANDING_HELP_PATH}#g" \ -e "s#xencenter\/current-release\/#${BRANDING_HELP_PATH}#g" \
-e "s#\[Xc updates url\]#${XC_UPDATES_URL}#g" \ -e "s#\[Xc updates url\]#${XC_UPDATES_URL}#g" \
-e "s#\[Cfu url\]#${CFU_URL}#g" \ -e "s#\[Cfu url\]#${CFU_URL}#g" \
$1 $1
} }