CP-12641 and CP-12475: XenCenter work for thin provisioning

-Changed code, because API needs 0-100 percent values as 0..1
-Code for HBA SRs
-Changed free space check for new VDIs to condider initial disk size only
when the SR is thin provisioned

Signed-off-by: Gabor Apati-Nagy <gabor.apati-nagy@citrix.com>
This commit is contained in:
Gabor Apati-Nagy 2015-06-18 15:03:25 +01:00
parent 306a8b0acb
commit fc0542066e
9 changed files with 176 additions and 72 deletions

View File

@ -174,10 +174,11 @@ namespace XenAdmin.Dialogs
//
// panel2
//
resources.ApplyResources(this.panel2, "panel2");
this.tableLayoutPanel1.SetColumnSpan(this.panel2, 2);
this.panel2.Controls.Add(this.comboBoxUnits);
this.panel2.Controls.Add(this.labelError);
this.panel2.Controls.Add(this.pictureBoxError);
resources.ApplyResources(this.panel2, "panel2");
this.panel2.Name = "panel2";
//
// comboBoxUnits
@ -229,6 +230,7 @@ namespace XenAdmin.Dialogs
0,
0,
0});
this.initialAllocationNumericUpDown.ValueChanged += new System.EventHandler(this.initialAllocationNumericUpDown_ValueChanged);
//
// allocationQuantumNumericUpDown
//

View File

@ -194,24 +194,29 @@ namespace XenAdmin.Dialogs
{
updateErrorsAndButtons();
var thinProvisioningEnabled = false;
if (SrListBox.SR != null)
{
thinProvisioningEnabled = SrListBox.SR.sm_config.Keys.Contains("allocation") && SrListBox.SR.sm_config["allocation"] == "dynamic";
}
initialAllocationNumericUpDown.Enabled =
labelInitialAllocation.Enabled =
allocationQuantumNumericUpDown.Enabled =
labelAllocationQuantum.Enabled = thinProvisioningEnabled;
labelAllocationQuantum.Enabled = IsSelectedSRThinProvisioned;
if (thinProvisioningEnabled)
if (IsSelectedSRThinProvisioned)
DefaultToSRsConfig();
}
private bool IsSelectedSRThinProvisioned
{
get
{
if (SrListBox.SR == null)
return false;
return SrListBox.SR.sm_config.Keys.Contains("allocation") && SrListBox.SR.sm_config["allocation"] == "dynamic";
}
}
private void OkButton_Click(object sender, EventArgs e)
{
@ -318,8 +323,8 @@ namespace XenAdmin.Dialogs
if (allocationQuantumNumericUpDown.Enabled && initialAllocationNumericUpDown.Enabled)
{
smconfig["allocation"] = "dynamic";
smconfig["allocation-quantum"] = allocationQuantumNumericUpDown.Value.ToString(CultureInfo.InvariantCulture);
smconfig["initial-allocation"] = initialAllocationNumericUpDown.Value.ToString(CultureInfo.InvariantCulture);
smconfig["allocation_quantum"] = (allocationQuantumNumericUpDown.Value / 100).ToString(CultureInfo.InvariantCulture);
smconfig["initial_allocation"] = (initialAllocationNumericUpDown.Value / 100).ToString(CultureInfo.InvariantCulture);
}
return smconfig;
@ -333,11 +338,11 @@ namespace XenAdmin.Dialogs
if (smConfig.ContainsKey("allocation") && smConfig["allocation"] == "dynamic")
{
if (smConfig.ContainsKey("initial-allocation") && decimal.TryParse(smConfig["initial-allocation"], out temp))
initialAllocationNumericUpDown.Value = temp;
if (smConfig.ContainsKey("initial_allocation") && decimal.TryParse(smConfig["initial_allocation"], out temp))
initialAllocationNumericUpDown.Value = temp * 100;
if (smConfig.ContainsKey("allocation-quantum") && decimal.TryParse(smConfig["allocation-quantum"], out temp))
allocationQuantumNumericUpDown.Value = temp;
if (smConfig.ContainsKey("allocation_quantum") && decimal.TryParse(smConfig["allocation_quantum"], out temp))
allocationQuantumNumericUpDown.Value = temp * 100;
}
}
@ -405,6 +410,9 @@ namespace XenAdmin.Dialogs
{
// Ordering is important here, we want to show the most relevant message
if (comboBoxUnits.SelectedItem == null)
return;
if (!SrListBox.ValidSelectionExists)
{
OkButton.Enabled = false;
@ -518,6 +526,12 @@ namespace XenAdmin.Dialogs
UpdateDiskSize();
}
private void initialAllocationNumericUpDown_ValueChanged(object sender, EventArgs e)
{
UpdateDiskSize();
}
private void UpdateDiskSize()
{
// Don't use DiskSizeNumericUpDown.Value here, as it will fire the NumericUpDown built-in validation. Use Text property instead. (CA-46028)
@ -526,7 +540,17 @@ namespace XenAdmin.Dialogs
{
try
{
SrListBox.DiskSize = (long)(Math.Round(newValue * GetUnits()));
if (!IsSelectedSRThinProvisioned)
{
SrListBox.DiskSize = (long)(Math.Round(newValue * GetUnits()));
}
else
{
//Only the initial allocation is considered for thin provisioning.
var initialSizeRatio = initialAllocationNumericUpDown.Value / 100;
SrListBox.DiskSize = (long)(Math.Round(newValue * initialSizeRatio * GetUnits()));
}
}
catch (OverflowException)
{
@ -607,5 +631,6 @@ namespace XenAdmin.Dialogs
}
});
}
}
}

View File

@ -122,7 +122,7 @@
<value>Segoe UI, 9pt</value>
</data>
<data name="DiskSizeNumericUpDown.Location" type="System.Drawing.Point, System.Drawing">
<value>201, 147</value>
<value>174, 147</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="DiskSizeNumericUpDown.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
@ -175,7 +175,7 @@
<value>0, 0, 3, 0</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>198, 29</value>
<value>171, 29</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -217,7 +217,7 @@
<value>0, 3, 0, 0</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>198, 32</value>
<value>171, 32</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
@ -244,13 +244,13 @@
<value>Segoe UI, 9pt</value>
</data>
<data name="NameTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>201, 42</value>
<value>174, 42</value>
</data>
<data name="NameTextBox.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 70, 6</value>
</data>
<data name="NameTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 23</value>
<value>413, 23</value>
</data>
<data name="NameTextBox.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
@ -274,7 +274,7 @@
<value>Segoe UI, 9pt</value>
</data>
<data name="DescriptionTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>201, 71</value>
<value>174, 71</value>
</data>
<data name="DescriptionTextBox.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 70, 18</value>
@ -283,7 +283,7 @@
<value>True</value>
</data>
<data name="DescriptionTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 58</value>
<value>413, 58</value>
</data>
<data name="DescriptionTextBox.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
@ -316,7 +316,7 @@
<value>0, 0, 3, 0</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>198, 76</value>
<value>171, 76</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
@ -346,7 +346,7 @@
<value>Segoe UI, 9pt</value>
</data>
<data name="CloseButton.Location" type="System.Drawing.Point, System.Drawing">
<value>372, 3</value>
<value>399, 3</value>
</data>
<data name="CloseButton.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
@ -376,7 +376,7 @@
<value>Segoe UI, 9pt</value>
</data>
<data name="OkButton.Location" type="System.Drawing.Point, System.Drawing">
<value>291, 3</value>
<value>318, 3</value>
</data>
<data name="OkButton.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
@ -409,10 +409,10 @@
<value>Segoe UI, 9pt</value>
</data>
<data name="panel1.Location" type="System.Drawing.Point, System.Drawing">
<value>204, 341</value>
<value>177, 341</value>
</data>
<data name="panel1.Size" type="System.Drawing.Size, System.Drawing">
<value>450, 29</value>
<value>477, 29</value>
</data>
<data name="panel1.TabIndex" type="System.Int32, mscorlib">
<value>9</value>
@ -445,7 +445,7 @@
<value>0, 0, 0, 0</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>201, 92</value>
<value>174, 92</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
@ -465,6 +465,9 @@
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="panel2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="comboBoxUnits.Font" type="System.Drawing.Font, System.Drawing">
<value>Segoe UI, 9pt</value>
</data>
@ -565,13 +568,13 @@
<value>Segoe UI, 9pt</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>309, 147</value>
<value>282, 147</value>
</data>
<data name="panel2.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 0</value>
</data>
<data name="panel2.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 23</value>
<value>356, 26</value>
</data>
<data name="panel2.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
@ -643,13 +646,13 @@
<value>3, 307</value>
</data>
<data name="labelAllocationQuantum.Size" type="System.Drawing.Size, System.Drawing">
<value>172, 15</value>
<value>168, 15</value>
</data>
<data name="labelAllocationQuantum.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
</data>
<data name="labelAllocationQuantum.Text" xml:space="preserve">
<value>Default subsequent allocations:</value>
<value>Virtual subsequent allocations:</value>
</data>
<data name="&gt;&gt;labelAllocationQuantum.Name" xml:space="preserve">
<value>labelAllocationQuantum</value>
@ -679,13 +682,13 @@
<value>3, 278</value>
</data>
<data name="labelInitialAllocation.Size" type="System.Drawing.Size, System.Drawing">
<value>195, 15</value>
<value>155, 15</value>
</data>
<data name="labelInitialAllocation.TabIndex" type="System.Int32, mscorlib">
<value>13</value>
</data>
<data name="labelInitialAllocation.Text" xml:space="preserve">
<value>Default virtual disk initial allocation:</value>
<value>Virtual disk initial allocation:</value>
</data>
<data name="&gt;&gt;labelInitialAllocation.Name" xml:space="preserve">
<value>labelInitialAllocation</value>
@ -706,7 +709,7 @@
<value>Segoe UI, 9pt</value>
</data>
<data name="initialAllocationNumericUpDown.Location" type="System.Drawing.Point, System.Drawing">
<value>201, 274</value>
<value>174, 274</value>
</data>
<data name="initialAllocationNumericUpDown.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 3, 3, 3</value>
@ -739,7 +742,7 @@
<value>Segoe UI, 9pt</value>
</data>
<data name="allocationQuantumNumericUpDown.Location" type="System.Drawing.Point, System.Drawing">
<value>201, 303</value>
<value>174, 303</value>
</data>
<data name="allocationQuantumNumericUpDown.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 3, 3, 3</value>
@ -775,7 +778,7 @@
<value>Segoe UI, 9pt</value>
</data>
<data name="label5.Location" type="System.Drawing.Point, System.Drawing">
<value>312, 278</value>
<value>285, 278</value>
</data>
<data name="label5.Size" type="System.Drawing.Size, System.Drawing">
<value>17, 15</value>
@ -808,7 +811,7 @@
<value>Segoe UI, 9pt</value>
</data>
<data name="label7.Location" type="System.Drawing.Point, System.Drawing">
<value>312, 307</value>
<value>285, 307</value>
</data>
<data name="label7.Size" type="System.Drawing.Size, System.Drawing">
<value>17, 15</value>
@ -862,7 +865,7 @@
<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="label2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="label1" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="NameTextBox" Row="2" RowSpan="1" Column="1" ColumnSpan="3" /&gt;&lt;Control Name="DescriptionTextBox" Row="3" RowSpan="1" Column="1" ColumnSpan="3" /&gt;&lt;Control Name="SrListBox" Row="5" RowSpan="1" Column="1" ColumnSpan="3" /&gt;&lt;Control Name="label3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="DiskSizeNumericUpDown" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="panel1" Row="9" RowSpan="1" Column="1" ColumnSpan="3" /&gt;&lt;Control Name="label4" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="panel2" Row="4" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="label6" Row="1" RowSpan="1" Column="0" ColumnSpan="4" /&gt;&lt;Control Name="labelAllocationQuantum" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="labelInitialAllocation" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="initialAllocationNumericUpDown" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="allocationQuantumNumericUpDown" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="label5" Row="6" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="label7" Row="7" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="AutoSize,0,AutoSize,0,Percent,33.33333,Percent,66.66666" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /&gt;&lt;/TableLayoutSettings&gt;</value>
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="label2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="label1" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="NameTextBox" Row="2" RowSpan="1" Column="1" ColumnSpan="3" /&gt;&lt;Control Name="DescriptionTextBox" Row="3" RowSpan="1" Column="1" ColumnSpan="3" /&gt;&lt;Control Name="SrListBox" Row="5" RowSpan="1" Column="1" ColumnSpan="3" /&gt;&lt;Control Name="label3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="DiskSizeNumericUpDown" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="panel1" Row="9" RowSpan="1" Column="1" ColumnSpan="3" /&gt;&lt;Control Name="label4" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="panel2" Row="4" RowSpan="1" Column="2" ColumnSpan="2" /&gt;&lt;Control Name="label6" Row="1" RowSpan="1" Column="0" ColumnSpan="4" /&gt;&lt;Control Name="labelAllocationQuantum" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="labelInitialAllocation" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="initialAllocationNumericUpDown" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="allocationQuantumNumericUpDown" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="label5" Row="6" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="label7" Row="7" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="AutoSize,0,AutoSize,0,Percent,33.33333,Percent,66.66666" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data>
<data name="SrListBox.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
@ -871,13 +874,13 @@
<value>Segoe UI, 9pt</value>
</data>
<data name="SrListBox.Location" type="System.Drawing.Point, System.Drawing">
<value>201, 179</value>
<value>174, 179</value>
</data>
<data name="SrListBox.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 70, 6</value>
</data>
<data name="SrListBox.Size" type="System.Drawing.Size, System.Drawing">
<value>386, 86</value>
<value>413, 86</value>
</data>
<data name="SrListBox.TabIndex" type="System.Int32, mscorlib">
<value>8</value>

View File

@ -257,12 +257,23 @@ namespace XenAdmin.Wizards
return xenTabPageCslg.PerformStorageSystemScan();
}
}
if (senderPage == xenTabPageLvmoHba)
{
return CanShowLVMoHBASummaryPage();
}
if (m_srWizardType is SrWizardType_LvmoHba)
{
if (!Helpers.DundeeOrGreater(xenConnection)
|| senderPage == xenTabPageStorageProvisioningMethod
|| senderPage == xenTabPageLvmoHba && !xenTabPageLvmoHba.SrDescriptors.Any(srDescriptor => string.IsNullOrEmpty(srDescriptor.UUID)))
{
if (xenTabPageStorageProvisioningMethod.SMConfig.Count > 0)
{
xenTabPageLvmoHba.SrDescriptors
.Where(desc => string.IsNullOrEmpty(desc.UUID)).ToList()
.ForEach(desc => desc.SMConfig = xenTabPageStorageProvisioningMethod.SMConfig);
}
return CanShowLVMoHBASummaryPage();
}
}
return base.RunNextPagePrecheck(senderPage);
}
@ -288,7 +299,7 @@ namespace XenAdmin.Wizards
else if (m_srWizardType is SrWizardType_LvmoHba)
{
AddPage(xenTabPageLvmoHba);
if (Helpers.DundeeOrGreater(xenConnection))
AddPage(xenTabPageStorageProvisioningMethod);
@ -371,7 +382,14 @@ namespace XenAdmin.Wizards
SetCustomDescription(m_srWizardType, xenTabPageLvmoIscsi.SrDescription);
if (m_srWizardType.UUID != null) //already existing SR
xenTabPageStorageProvisioningMethod.DisableAllControls();
{
xenTabPageStorageProvisioningMethod.SetControlsUsingExistingSMConfig(m_srWizardType.SMConfig);
xenTabPageStorageProvisioningMethod.DisableControls();
}
else
{
xenTabPageStorageProvisioningMethod.ResetControls();
}
}
else if (senderPagetype == typeof(NFS_ISO))
{
@ -486,6 +504,15 @@ namespace XenAdmin.Wizards
m_srWizardType.DeviceConfig[entry.Key] = entry.Value;
SetCustomDescription(m_srWizardType, xentabPageEqualLogic.SrDescription);
}
else if (senderPagetype == typeof(LVMoHBA))
{
bool creatingNew = m_srWizardType.SrDescriptors.Any(srDescriptor => string.IsNullOrEmpty(srDescriptor.UUID));
if (!creatingNew)
{
DisablePage(xenTabPageStorageProvisioningMethod, true);
xenTabPageStorageProvisioningMethod.ResetControls();
}
}
else if (senderPagetype == typeof(StorageProvisioning))
{
m_srWizardType.SMConfig = xenTabPageStorageProvisioningMethod.SMConfig;

View File

@ -63,7 +63,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
// radioButtonThinProvisioning
//
resources.ApplyResources(this.radioButtonThinProvisioning, "radioButtonThinProvisioning");
this.tableLayoutPanel1.SetColumnSpan(this.radioButtonThinProvisioning, 2);
this.tableLayoutPanel1.SetColumnSpan(this.radioButtonThinProvisioning, 4);
this.radioButtonThinProvisioning.Name = "radioButtonThinProvisioning";
this.radioButtonThinProvisioning.UseVisualStyleBackColor = true;
this.radioButtonThinProvisioning.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged);
@ -72,7 +72,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
//
resources.ApplyResources(this.radioButtonThickProvisioning, "radioButtonThickProvisioning");
this.radioButtonThickProvisioning.Checked = true;
this.tableLayoutPanel1.SetColumnSpan(this.radioButtonThickProvisioning, 2);
this.tableLayoutPanel1.SetColumnSpan(this.radioButtonThickProvisioning, 4);
this.radioButtonThickProvisioning.Name = "radioButtonThickProvisioning";
this.radioButtonThickProvisioning.TabStop = true;
this.radioButtonThickProvisioning.UseVisualStyleBackColor = true;

View File

@ -51,6 +51,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
#region Accessors
public Dictionary<string, string> SMConfig
{
get
@ -60,8 +61,8 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
if (radioButtonThinProvisioning.Checked)
{
smconfig["allocation"] = "dynamic";
smconfig["allocation-quantum"] = allocationQuantumNumericUpDown.Value.ToString(CultureInfo.InvariantCulture);
smconfig["initial-allocation"] = initialAllocationNumericUpDown.Value.ToString(CultureInfo.InvariantCulture);
smconfig["allocation_quantum"] = (allocationQuantumNumericUpDown.Value / 100).ToString(CultureInfo.InvariantCulture);
smconfig["initial_allocation"] = (initialAllocationNumericUpDown.Value / 100).ToString(CultureInfo.InvariantCulture);
}
return smconfig;
@ -84,7 +85,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
public override string PageTitle { get { return Messages.STORAGE_PROVISIONING_METHOD_TITLE; } }
public override string Text { get { return Messages.SETTINGS; } }
public override string Text { get { return Messages.STORAGE_PROVISIONING_SETTINGS; } }
public override string HelpID { get { return "helpid "; } }
@ -101,16 +102,50 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends
}
public void DisableAllControls()
public void DisableControls()
{
foreach (Control c in Controls)
c.Enabled = false;
}
public void ResetControls()
{
foreach (Control c in Controls)
c.Enabled = true;
UpdateControls();
}
public void SetControlsUsingExistingSMConfig(Dictionary<string, string> smConfig)
{
decimal temp = 0;
if (smConfig.ContainsKey("allocation") && smConfig["allocation"] == "dynamic")
{
radioButtonThickProvisioning.Checked = false;
radioButtonThinProvisioning.Checked = true;
if (smConfig.ContainsKey("initial_allocation") && decimal.TryParse(smConfig["initial_allocation"], out temp))
initialAllocationNumericUpDown.Value = temp * 100;
if (smConfig.ContainsKey("allocation_quantum") && decimal.TryParse(smConfig["allocation_quantum"], out temp))
allocationQuantumNumericUpDown.Value = temp * 100;
}
else
{
radioButtonThickProvisioning.Checked = true;
radioButtonThinProvisioning.Checked = false;
initialAllocationNumericUpDown.ResetText();
allocationQuantumNumericUpDown.ResetText();
}
}
private void UpdateControls()
{
labelAllocationQuantum.Enabled =
labelInitialAllocation.Enabled =
labelPercent1.Enabled =
labelPercent2.Enabled =
allocationQuantumNumericUpDown.Enabled =
initialAllocationNumericUpDown.Enabled = radioButtonThinProvisioning.Checked;
}

View File

@ -123,7 +123,7 @@
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="initialAllocationNumericUpDown.Location" type="System.Drawing.Point, System.Drawing">
<value>210, 108</value>
<value>174, 108</value>
</data>
<data name="initialAllocationNumericUpDown.Size" type="System.Drawing.Size, System.Drawing">
<value>50, 20</value>
@ -157,13 +157,13 @@
<value>33, 111</value>
</data>
<data name="labelInitialAllocation.Size" type="System.Drawing.Size, System.Drawing">
<value>171, 13</value>
<value>135, 13</value>
</data>
<data name="labelInitialAllocation.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="labelInitialAllocation.Text" xml:space="preserve">
<value>Default virtual disk initial allocation:</value>
<value>Virtual disk initial allocation:</value>
</data>
<data name="&gt;&gt;labelInitialAllocation.Name" xml:space="preserve">
<value>labelInitialAllocation</value>
@ -232,13 +232,13 @@
<value>3, 62</value>
</data>
<data name="radioButtonThickProvisioning.Size" type="System.Drawing.Size, System.Drawing">
<value>111, 17</value>
<value>376, 17</value>
</data>
<data name="radioButtonThickProvisioning.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="radioButtonThickProvisioning.Text" xml:space="preserve">
<value>Thick provisioning</value>
<value>Thick provisioning: reserve the full size of the virtual disk when it is created</value>
</data>
<data name="&gt;&gt;radioButtonThickProvisioning.Name" xml:space="preserve">
<value>radioButtonThickProvisioning</value>
@ -265,13 +265,13 @@
<value>33, 137</value>
</data>
<data name="labelAllocationQuantum.Size" type="System.Drawing.Size, System.Drawing">
<value>155, 13</value>
<value>120, 13</value>
</data>
<data name="labelAllocationQuantum.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="labelAllocationQuantum.Text" xml:space="preserve">
<value>Default subsequent allocations:</value>
<value>Subsequent allocations:</value>
</data>
<data name="&gt;&gt;labelAllocationQuantum.Name" xml:space="preserve">
<value>labelAllocationQuantum</value>
@ -289,7 +289,7 @@
<value>Left</value>
</data>
<data name="allocationQuantumNumericUpDown.Location" type="System.Drawing.Point, System.Drawing">
<value>210, 134</value>
<value>174, 134</value>
</data>
<data name="allocationQuantumNumericUpDown.Size" type="System.Drawing.Size, System.Drawing">
<value>50, 20</value>
@ -322,16 +322,16 @@
<value>NoControl</value>
</data>
<data name="labelPercent1.Location" type="System.Drawing.Point, System.Drawing">
<value>266, 111</value>
<value>230, 111</value>
</data>
<data name="labelPercent1.Size" type="System.Drawing.Size, System.Drawing">
<value>15, 13</value>
<value>119, 13</value>
</data>
<data name="labelPercent1.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="labelPercent1.Text" xml:space="preserve">
<value>%</value>
<value>% of the virtual disk size</value>
</data>
<data name="&gt;&gt;labelPercent1.Name" xml:space="preserve">
<value>labelPercent1</value>
@ -355,16 +355,16 @@
<value>NoControl</value>
</data>
<data name="labelPercent2.Location" type="System.Drawing.Point, System.Drawing">
<value>266, 137</value>
<value>230, 137</value>
</data>
<data name="labelPercent2.Size" type="System.Drawing.Size, System.Drawing">
<value>15, 13</value>
<value>119, 13</value>
</data>
<data name="labelPercent2.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="labelPercent2.Text" xml:space="preserve">
<value>%</value>
<value>% of the virtual disk size</value>
</data>
<data name="&gt;&gt;labelPercent2.Name" xml:space="preserve">
<value>labelPercent2</value>
@ -406,7 +406,7 @@
<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="4" /&gt;&lt;Control Name="initialAllocationNumericUpDown" Row="4" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="radioButtonThickProvisioning" Row="2" RowSpan="1" Column="0" ColumnSpan="2" /&gt;&lt;Control Name="labelInitialAllocation" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="radioButtonThinProvisioning" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /&gt;&lt;Control Name="labelAllocationQuantum" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="allocationQuantumNumericUpDown" Row="5" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="labelPercent1" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;Control Name="labelPercent2" Row="5" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="Absolute,30,AutoSize,0,AutoSize,0,Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /&gt;&lt;/TableLayoutSettings&gt;</value>
<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="4" /&gt;&lt;Control Name="initialAllocationNumericUpDown" Row="4" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="radioButtonThickProvisioning" Row="2" RowSpan="1" Column="0" ColumnSpan="4" /&gt;&lt;Control Name="labelInitialAllocation" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="radioButtonThinProvisioning" Row="3" RowSpan="1" Column="0" ColumnSpan="4" /&gt;&lt;Control Name="labelAllocationQuantum" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="allocationQuantumNumericUpDown" Row="5" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="labelPercent1" Row="4" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;Control Name="labelPercent2" Row="5" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="Absolute,30,AutoSize,0,AutoSize,0,Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data>
<data name="radioButtonThinProvisioning.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -415,13 +415,13 @@
<value>3, 85</value>
</data>
<data name="radioButtonThinProvisioning.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 17</value>
<value>388, 17</value>
</data>
<data name="radioButtonThinProvisioning.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="radioButtonThinProvisioning.Text" xml:space="preserve">
<value>&amp;Thin provisioning</value>
<value>&amp;Thin provisioning: reserve a small space initially and allocate more as required</value>
</data>
<data name="&gt;&gt;radioButtonThinProvisioning.Name" xml:space="preserve">
<value>radioButtonThinProvisioning</value>

View File

@ -30443,6 +30443,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Storage Provisioning Settings.
/// </summary>
public static string STORAGE_PROVISIONING_SETTINGS {
get {
return ResourceManager.GetString("STORAGE_PROVISIONING_SETTINGS", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Read Only.
/// </summary>

View File

@ -10680,6 +10680,9 @@ Do you want to connect to the pool master '{1}'?</value>
<data name="STORAGE_PROVISIONING_METHOD_TITLE" xml:space="preserve">
<value>Choose storage provisioning method</value>
</data>
<data name="STORAGE_PROVISIONING_SETTINGS" xml:space="preserve">
<value>Storage Provisioning Settings</value>
</data>
<data name="STORAGE_READ_ONLY" xml:space="preserve">
<value>Read Only</value>
</data>