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
This commit is contained in:
Rashmi D 2017-08-03 04:15:45 +05:30 committed by Rohit Yadav
parent b936feb108
commit e43a4b9a09
2 changed files with 6 additions and 0 deletions

View File

@ -2276,6 +2276,7 @@ var dictionary = {"ICMP.code":"ICMP Code",
"message.vnmc.available.list":"VNMC is not available from provider list.", "message.vnmc.available.list":"VNMC is not available from provider list.",
"message.vnmc.not.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.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.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.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!", "message.your.cloudstack.is.ready":"Your CloudStack is ready!",

View File

@ -1706,6 +1706,11 @@
array1.push("&maxiops=" + todb(maxIops)); 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({ $.ajax({