CP-28282: Correction to the required disk space calculation

- also renamed a variable and updated the problem description to include the server name

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
Mihaela Stoica 2018-06-15 14:24:29 +01:00
parent e8ab24820d
commit 121bce92af
3 changed files with 6 additions and 6 deletions

View File

@ -65,13 +65,13 @@ namespace XenAdmin.Diagnostics.Checks
var elyOrGreater = Helpers.ElyOrGreater(Host.Connection);
// check the disk space on host
var size = elyOrGreater
var requiredDiskSpace = elyOrGreater
? updateSequence[Host].Sum(p => p.InstallationSize) // all updates on this host (for installation)
: Host.IsMaster()
? updateSequence[Host].Sum(p => p.InstallationSize) + updateSequence.Values.SelectMany(a => a).Sum(p => p.InstallationSize) // master: all updates on master (for installation) + all updates in pool (for upload)
? updateSequence[Host].Sum(p => p.InstallationSize) + updateSequence.Values.SelectMany(p => p).Distinct().Sum(p => p.InstallationSize) // master: all updates on master (for installation) + all updates in pool (for upload)
: updateSequence[Host].Sum(p => p.InstallationSize) * 2; // non-master: all updates on this host x 2 (for installation + upload)
var action = new GetDiskSpaceRequirementsAction(Host, size, true, DiskSpaceRequirements.OperationTypes.automatedUpdates);
var action = new GetDiskSpaceRequirementsAction(Host, requiredDiskSpace, true, DiskSpaceRequirements.OperationTypes.automatedUpdates);
try
{
@ -82,7 +82,7 @@ namespace XenAdmin.Diagnostics.Checks
log.WarnFormat("Could not get disk space requirements");
}
if (action.Succeeded && action.DiskSpaceRequirements.AvailableDiskSpace < size)
if (action.Succeeded && action.DiskSpaceRequirements.AvailableDiskSpace < requiredDiskSpace)
return new HostOutOfSpaceProblem(this, Host, action.DiskSpaceRequirements);
// check the disk space for uploading the update files to the pool's SRs (only needs to be done once, so only run this on master)

View File

@ -26218,7 +26218,7 @@ namespace XenAdmin {
}
/// <summary>
/// Looks up a localized string similar to There is not enough space to upload the required updates..
/// Looks up a localized string similar to There is not enough space to upload the required updates to &apos;{0}&apos;..
/// </summary>
public static string NOT_ENOUGH_SPACE_MESSAGE_AUTO_UPDATE_UPLOAD {
get {

View File

@ -9104,7 +9104,7 @@ It is strongly recommended that you Cancel and apply the latest version of the p
<value>There is not enough space to update '{0}' with automated updates.</value>
</data>
<data name="NOT_ENOUGH_SPACE_MESSAGE_AUTO_UPDATE_UPLOAD" xml:space="preserve">
<value>There is not enough space to upload the required updates.</value>
<value>There is not enough space to upload the required updates to '{0}'.</value>
</data>
<data name="NOT_ENOUGH_SPACE_MESSAGE_AUTO_UPDATE_UPLOAD_ALL" xml:space="preserve">
<value>There is not enough space on your SRs to upload all the update files required by the automated updates.</value>