mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-23 12:30:50 +01:00
add information on general page of pool and vm; repair autoboot setting after merge from upstream
This commit is contained in:
parent
b4bba6b679
commit
aa51937727
@ -91,7 +91,7 @@ namespace XenAdmin.SettingsPanels
|
||||
this.m_tlpAutoBoot.Controls.Add(this.m_picInfoAutoBoot, 0, 0);
|
||||
this.m_tlpAutoBoot.Controls.Add(this.m_autoHeightLabelAutoBoot, 1, 0);
|
||||
this.m_tlpAutoBoot.Controls.Add(this.m_autoHeightLabelAutoBootHAWarning, 1, 0);
|
||||
this.m_tlpAutoBoot.Controls.Add(this.m_checkBoxAutoBoot, 0, 1);
|
||||
this.m_tlpAutoBoot.Controls.Add(this.m_checkBoxAutoBoot, 0, 2);
|
||||
this.m_tlpAutoBoot.Name = "m_tlpAutoBoot";
|
||||
//
|
||||
// m_picInfoAutoBoot
|
||||
|
@ -92,10 +92,12 @@ namespace XenAdmin.SettingsPanels
|
||||
|
||||
vm.SetAutoPowerOn(m_checkBoxAutoBoot.Checked);
|
||||
|
||||
vm.PV_args = m_textBoxOsParams.Text;
|
||||
|
||||
return new DelegatedAsyncAction(vm.Connection, "Change VBDs bootable", "Change VBDs bootable", null,
|
||||
delegate(Session session)
|
||||
{
|
||||
if (bootFromCD)
|
||||
if (bootFromCD)
|
||||
{
|
||||
foreach (var vbd in vm.Connection.ResolveAll(vm.VBDs))
|
||||
VBD.set_bootable(session, vbd.opaque_ref, vbd.IsCDROM());
|
||||
@ -187,7 +189,8 @@ namespace XenAdmin.SettingsPanels
|
||||
m_picInfoAutoBoot.Visible = false;
|
||||
m_autoHeightLabelAutoBoot.Visible = false;
|
||||
m_autoHeightLabelAutoBootHAWarning.Visible = false;
|
||||
m_checkBoxAutoBoot.Visible = false;
|
||||
|
||||
m_checkBoxAutoBoot.Checked = vm.GetAutoPowerOn();
|
||||
|
||||
BootDeviceAndOrderEnabled(vm.IsHVM());
|
||||
|
||||
@ -351,8 +354,8 @@ namespace XenAdmin.SettingsPanels
|
||||
Convert(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -214,7 +214,7 @@
|
||||
<value>m_autoHeightLabelHvm</value>
|
||||
</data>
|
||||
<data name=">>m_autoHeightLabelHvm.Type" xml:space="preserve">
|
||||
<value>XenAdmin.Controls.Common.AutoHeightLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>XenAdmin.Controls.Common.AutoHeightLabel, XCP-ng Center, Version=99.99.99.29, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>m_autoHeightLabelHvm.Parent" xml:space="preserve">
|
||||
<value>tableLayoutPanel1</value>
|
||||
@ -247,7 +247,7 @@
|
||||
<value>m_autoHeightLabelNonHvm</value>
|
||||
</data>
|
||||
<data name=">>m_autoHeightLabelNonHvm.Type" xml:space="preserve">
|
||||
<value>XenAdmin.Controls.Common.AutoHeightLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>XenAdmin.Controls.Common.AutoHeightLabel, XCP-ng Center, Version=99.99.99.29, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>m_autoHeightLabelNonHvm.Parent" xml:space="preserve">
|
||||
<value>tableLayoutPanel1</value>
|
||||
@ -316,7 +316,7 @@
|
||||
<value>m_autoHeightLabelAutoBoot</value>
|
||||
</data>
|
||||
<data name=">>m_autoHeightLabelAutoBoot.Type" xml:space="preserve">
|
||||
<value>XenAdmin.Controls.Common.AutoHeightLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>XenAdmin.Controls.Common.AutoHeightLabel, XCP-ng Center, Version=99.99.99.29, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>m_autoHeightLabelAutoBoot.Parent" xml:space="preserve">
|
||||
<value>m_tlpAutoBoot</value>
|
||||
@ -349,7 +349,7 @@
|
||||
<value>m_autoHeightLabelAutoBootHAWarning</value>
|
||||
</data>
|
||||
<data name=">>m_autoHeightLabelAutoBootHAWarning.Type" xml:space="preserve">
|
||||
<value>XenAdmin.Controls.Common.AutoHeightLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>XenAdmin.Controls.Common.AutoHeightLabel, XCP-ng Center, Version=99.99.99.29, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>m_autoHeightLabelAutoBootHAWarning.Parent" xml:space="preserve">
|
||||
<value>m_tlpAutoBoot</value>
|
||||
@ -397,10 +397,10 @@
|
||||
<value>3, 16</value>
|
||||
</data>
|
||||
<data name="m_tlpAutoBoot.RowCount" type="System.Int32, mscorlib">
|
||||
<value>2</value>
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="m_tlpAutoBoot.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>438, 55</value>
|
||||
<value>438, 75</value>
|
||||
</data>
|
||||
<data name="m_tlpAutoBoot.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>7</value>
|
||||
@ -418,7 +418,7 @@
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="m_tlpAutoBoot.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
|
||||
<value><?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="m_picInfoAutoBoot" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="m_autoHeightLabelAutoBoot" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="m_autoHeightLabelAutoBootHAWarning" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="m_checkBoxAutoBoot" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,Absolute,20" /></TableLayoutSettings></value>
|
||||
<value><?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="m_picInfoAutoBoot" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="m_autoHeightLabelAutoBoot" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="m_autoHeightLabelAutoBootHAWarning" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="m_checkBoxAutoBoot" Row="2" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,Absolute,20,Absolute,20" /></TableLayoutSettings></value>
|
||||
</data>
|
||||
<data name="m_groupBoxAutoBoot.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
@ -427,7 +427,7 @@
|
||||
<value>3, 101</value>
|
||||
</data>
|
||||
<data name="m_groupBoxAutoBoot.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>444, 74</value>
|
||||
<value>444, 94</value>
|
||||
</data>
|
||||
<data name="m_groupBoxAutoBoot.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>8</value>
|
||||
@ -598,7 +598,7 @@
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="m_tlpHvm.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>3, 181</value>
|
||||
<value>3, 201</value>
|
||||
</data>
|
||||
<data name="m_tlpHvm.RowCount" type="System.Int32, mscorlib">
|
||||
<value>5</value>
|
||||
@ -724,7 +724,7 @@
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="m_tlpNonHvm.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>3, 344</value>
|
||||
<value>3, 364</value>
|
||||
</data>
|
||||
<data name="m_tlpNonHvm.RowCount" type="System.Int32, mscorlib">
|
||||
<value>5</value>
|
||||
|
@ -742,6 +742,9 @@ namespace XenAdmin.TabPages
|
||||
|
||||
PDSection s = pdSectionBootOptions;
|
||||
|
||||
s.AddEntry(FriendlyName("VM.auto_boot"), Helpers.BoolToString(vm.GetAutoPowerOn()),
|
||||
new PropertiesToolStripMenuItem(new VmEditStartupOptionsCommand(Program.MainWindow, vm)));
|
||||
|
||||
if (vm.IsHVM())
|
||||
{
|
||||
s.AddEntry(FriendlyName("VM.BootOrder"), HVMBootOrder(vm),
|
||||
@ -974,6 +977,8 @@ namespace XenAdmin.TabPages
|
||||
s.AddEntry(FriendlyName("host.enabled"), Messages.YES, item);
|
||||
}
|
||||
|
||||
s.AddEntry("Autoboot of VMs enabled", Helpers.BoolToString(host.GetVmAutostartEnabled()));
|
||||
|
||||
if (Helpers.CloudOrGreater(host) && Helpers.XapiEqualOrGreater_1_290_0(host))
|
||||
{
|
||||
var pool = Helpers.GetPoolOfOne(xenObject.Connection);
|
||||
@ -1115,6 +1120,8 @@ namespace XenAdmin.TabPages
|
||||
{
|
||||
s.AddEntry(Messages.NUMBER_OF_SOCKETS, p.CpuSockets().ToString());
|
||||
|
||||
s.AddEntry("Autoboot of VMs enabled", Helpers.BoolToString(p.GetVmAutostartEnabled()));
|
||||
|
||||
if (Helpers.CloudOrGreater(p.Connection) && Helpers.XapiEqualOrGreater_1_290_0(p.Connection))
|
||||
{
|
||||
if (p.tls_verification_enabled)
|
||||
|
@ -147,6 +147,16 @@ namespace XenAPI
|
||||
}
|
||||
}
|
||||
|
||||
public bool GetVmAutostartEnabled()
|
||||
{
|
||||
Pool p = Helpers.GetPoolOfOne(Connection);
|
||||
|
||||
if (p != null)
|
||||
return p.GetVmAutostartEnabled();
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public string GetIscsiIqn()
|
||||
{
|
||||
if (Helpers.KolkataOrGreater(this))
|
||||
@ -181,7 +191,7 @@ namespace XenAPI
|
||||
software_version.ContainsKey("product_brand")
|
||||
? software_version["product_brand"]
|
||||
: BrandManager.ProductBrand);
|
||||
|
||||
|
||||
return name_description ?? "";
|
||||
}
|
||||
|
||||
@ -204,8 +214,8 @@ namespace XenAPI
|
||||
/// </summary>
|
||||
public virtual DateTime? LicenseCssExpiry()
|
||||
{
|
||||
if(license_params != null &&
|
||||
license_params.TryGetValue("css_expiry", out var cssExpiryValue) &&
|
||||
if (license_params != null &&
|
||||
license_params.TryGetValue("css_expiry", out var cssExpiryValue) &&
|
||||
!string.IsNullOrEmpty(cssExpiryValue) &&
|
||||
Util.TryParseNonIso8601DateTime(cssExpiryValue, out var result))
|
||||
{
|
||||
@ -268,9 +278,9 @@ namespace XenAPI
|
||||
|
||||
public static bool RestrictVSwitchController(Host h)
|
||||
{
|
||||
return BoolKeyPreferTrue(h.license_params, "restrict_vswitch_controller");
|
||||
return BoolKeyPreferTrue(h.license_params, "restrict_vswitch_controller");
|
||||
}
|
||||
|
||||
|
||||
public static bool RestrictSriovNetwork(Host h)
|
||||
{
|
||||
return BoolKeyPreferTrue(h.license_params, "restrict_network_sriov");
|
||||
@ -425,12 +435,12 @@ namespace XenAPI
|
||||
|
||||
public static bool RestrictExportResourceData(Host h)
|
||||
{
|
||||
return BoolKeyPreferTrue(h.license_params, "restrict_export_resource_data");
|
||||
}
|
||||
return BoolKeyPreferTrue(h.license_params, "restrict_export_resource_data");
|
||||
}
|
||||
|
||||
public static bool RestrictIntraPoolMigrate(Host h)
|
||||
{
|
||||
return BoolKey(h.license_params, "restrict_xen_motion");
|
||||
return BoolKey(h.license_params, "restrict_xen_motion");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -448,7 +458,7 @@ namespace XenAPI
|
||||
|
||||
public static bool RestrictHealthCheck(Host h)
|
||||
{
|
||||
return BoolKeyPreferTrue(h.license_params, "restrict_health_check");
|
||||
return BoolKeyPreferTrue(h.license_params, "restrict_health_check");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -456,7 +466,7 @@ namespace XenAPI
|
||||
/// </summary>
|
||||
public static bool RestrictVss(Host h)
|
||||
{
|
||||
return BoolKey(h.license_params, "restrict_vss");
|
||||
return BoolKey(h.license_params, "restrict_vss");
|
||||
}
|
||||
|
||||
public static bool RestrictPoolSize(Host h)
|
||||
@ -601,7 +611,7 @@ namespace XenAPI
|
||||
|
||||
public String MultipathHandle()
|
||||
{
|
||||
return Get(other_config, MULTIPATH_HANDLE);
|
||||
return Get(other_config, MULTIPATH_HANDLE);
|
||||
}
|
||||
|
||||
public override int CompareTo(Host other)
|
||||
@ -1436,7 +1446,7 @@ namespace XenAPI
|
||||
var sockets = CpuSockets();
|
||||
var cpuCount = CpuCount();
|
||||
if (sockets > 0 && cpuCount > 0)
|
||||
return (cpuCount/sockets);
|
||||
return (cpuCount / sockets);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1549,7 +1559,7 @@ namespace XenAPI
|
||||
description = value.Substring(0, x);
|
||||
string val = value.Substring(x + 10);
|
||||
|
||||
string[] delims = new string[] {", "};
|
||||
string[] delims = new string[] { ", " };
|
||||
string[] splitValue = val.Split(delims, StringSplitOptions.None);
|
||||
if (splitValue.Length == 0 || splitValue.Length > 3)
|
||||
return;
|
||||
@ -1618,7 +1628,7 @@ namespace XenAPI
|
||||
out string platformVersion, out string productVersion)
|
||||
{
|
||||
platformVersion = productVersion = null;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
var result = call_plugin(host.Connection.Session, host.opaque_ref,
|
||||
|
@ -287,6 +287,17 @@ namespace XenAPI
|
||||
return base.Equals(other);
|
||||
}
|
||||
|
||||
public bool GetVmAutostartEnabled()
|
||||
{
|
||||
string auto_poweron = Get(other_config, "auto_poweron");
|
||||
if (auto_poweron == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return auto_poweron == "true" ? true : false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -659,6 +659,14 @@ namespace XenAPI
|
||||
public void SetAutoPowerOn(bool value)
|
||||
{
|
||||
other_config = SetDictionaryKey(other_config, "auto_poweron", value.ToString().ToLower());
|
||||
|
||||
//// set auto_poweron on pool
|
||||
//Pool p = Helpers.GetPoolOfOne(Connection);
|
||||
//if (p != null)
|
||||
//{
|
||||
// p.other_config = Pool.SetDictionaryKey(p.other_config, "auto_poweron", "true");
|
||||
// p.SaveChanges(Connection.Session); // need to lock pool first, but how?!?
|
||||
//}
|
||||
}
|
||||
|
||||
public string IsOnSharedStorage()
|
||||
|
Loading…
Reference in New Issue
Block a user