You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2017/08/02 22:45:49 UTC
[cloudstack] branch master updated: CLOUDSTACK-9697: Added better
error message user if tries to shrink (#2145)
This is an automated email from the ASF dual-hosted git repository.
bhaisaab pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/master by this push:
new e43a4b9 CLOUDSTACK-9697: Added better error message user if tries to shrink (#2145)
e43a4b9 is described below
commit e43a4b9a09eb330ab148a4913c36e1ca2738adc3
Author: Rashmi D <ra...@persistent.co.in>
AuthorDate: Thu Aug 3 04:15:45 2017 +0530
CLOUDSTACK-9697: Added better error message user if tries to shrink (#2145)
the VM ROOT volume size
Skip the API call altogether if the UI detects this and throw a more user friendly message
---
ui/l10n/en.js | 1 +
ui/scripts/storage.js | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/ui/l10n/en.js b/ui/l10n/en.js
index a579784..3503296 100644
--- a/ui/l10n/en.js
+++ b/ui/l10n/en.js
@@ -2276,6 +2276,7 @@ var dictionary = {"ICMP.code":"ICMP Code",
"message.vnmc.available.list":"VNMC is not available from provider list.",
"message.vnmc.not.available.list":"VNMC is not available from provider list.",
"message.volume.create.template.confirm":"Please confirm that you wish to create a template for this disk volume. Creation of the template can range from several minutes to longer depending on the size of the volume.",
+"message.volume.root.shrink.disk.size" :"Shrink operation on ROOT volume not supported",
"message.waiting.for.builtin.templates.to.load":"Waiting for builtin templates to load...",
"message.you.must.have.at.least.one.physical.network":"You must have at least one physical network",
"message.your.cloudstack.is.ready":"Your CloudStack is ready!",
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 9638f1e..b71dbe2 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -1706,6 +1706,11 @@
array1.push("&maxiops=" + todb(maxIops));
}
}
+ //if original disk size > new disk size
+ if ((args.context.volumes[0].type == "ROOT")
+ && (args.context.volumes[0].size > (newSize * (1024 * 1024 * 1024)))) {
+ return args.response.error('message.volume.root.shrink.disk.size');
+ }
$.ajax({
--
To stop receiving notification emails like this one, please contact
['"commits@cloudstack.apache.org" <co...@cloudstack.apache.org>'].