Display overcommitted percentage for thinly provisioned SRs

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
Mihaela Stoica 2015-09-18 16:57:31 +01:00
parent 7df999c532
commit 13d933ec22
4 changed files with 23 additions and 1 deletions

View File

@ -1238,7 +1238,9 @@ namespace XenAdmin.TabPages
{ {
menuItems = new[] { new CommandToolStripMenuItem(new ConvertToThinSRCommand(Program.MainWindow, new List<SelectedItem> () { new SelectedItem(xenObject)} ), true) }; menuItems = new[] { new CommandToolStripMenuItem(new ConvertToThinSRCommand(Program.MainWindow, new List<SelectedItem> () { new SelectedItem(xenObject)} ), true) };
}*/ }*/
s.AddEntry(FriendlyName("SR.provisioning"), sr.IsThinProvisioned ? Messages.SR_THIN_PROVISIONING : Messages.SR_THICK_PROVISIONING, menuItems); s.AddEntry(FriendlyName("SR.provisioning"), sr.IsThinProvisioned
? string.Format(Messages.SR_THIN_PROVISIONING_COMMITTED, sr.PercentageCommitted)
: Messages.SR_THICK_PROVISIONING, menuItems);
if(sr.IsThinProvisioned && sr.sm_config.ContainsKey("initial_allocation") && sr.sm_config.ContainsKey("allocation_quantum")) if(sr.IsThinProvisioned && sr.sm_config.ContainsKey("initial_allocation") && sr.sm_config.ContainsKey("allocation_quantum"))
{ {

View File

@ -30355,6 +30355,15 @@ namespace XenAdmin {
} }
} }
/// <summary>
/// Looks up a localized string similar to Thinly provisioned ({0}% committed).
/// </summary>
public static string SR_THIN_PROVISIONING_COMMITTED {
get {
return ResourceManager.GetString("SR_THIN_PROVISIONING_COMMITTED", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Cannot reclaim freed space, because the SR is detached.. /// Looks up a localized string similar to Cannot reclaim freed space, because the SR is detached..
/// </summary> /// </summary>

View File

@ -10571,6 +10571,9 @@ The upper limit: SR size / {2}</value>
<data name="SR_THIN_PROVISIONING" xml:space="preserve"> <data name="SR_THIN_PROVISIONING" xml:space="preserve">
<value>Thinly provisioned</value> <value>Thinly provisioned</value>
</data> </data>
<data name="SR_THIN_PROVISIONING_COMMITTED" xml:space="preserve">
<value>Thinly provisioned ({0}% committed)</value>
</data>
<data name="SR_TRIM_NO_STORAGE_HOST_ERROR" xml:space="preserve"> <data name="SR_TRIM_NO_STORAGE_HOST_ERROR" xml:space="preserve">
<value>Cannot reclaim freed space, because the SR is detached.</value> <value>Cannot reclaim freed space, because the SR is detached.</value>
</data> </data>

View File

@ -1131,6 +1131,14 @@ namespace XenAPI
} }
} }
public long PercentageCommitted
{
get
{
return (long)Math.Round(virtual_allocation / (double)physical_size * 100.0);
}
}
#region IEquatable<SR> Members #region IEquatable<SR> Members
/// <summary> /// <summary>