You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2015/12/06 19:44:44 UTC

[1/4] git commit: updated refs/heads/4.6 to 998b1ba

Repository: cloudstack
Updated Branches:
  refs/heads/4.6 4f6ff6ca0 -> 998b1ba62


CLOUDSTACK-9101: update volume size after resizevolume


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/119b27b2
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/119b27b2
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/119b27b2

Branch: refs/heads/4.6
Commit: 119b27b2c6c366949b574fbca1574f15d67a3af3
Parents: 5b7d935
Author: Wei Zhou <w....@tech.leaseweb.com>
Authored: Thu Dec 3 11:54:20 2015 +0100
Committer: Wei Zhou <w....@tech.leaseweb.com>
Committed: Thu Dec 3 14:54:45 2015 +0100

----------------------------------------------------------------------
 server/src/com/cloud/storage/VolumeApiServiceImpl.java | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/119b27b2/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index 6fe0a14..4313bfc 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -1158,6 +1158,9 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
             if (newDiskOfferingId != null) {
                 volume.setDiskOfferingId(newDiskOfferingId);
             }
+            if (currentSize != newSize) {
+                volume.setSize(newSize);
+            }
 
             _volsDao.update(volume.getId(), volume);
 


[4/4] git commit: updated refs/heads/4.6 to 998b1ba

Posted by da...@apache.org.
Merge pull request #1161 from ustcweizhou/resize-volume-issues

CLOUDSTACK-9101: fix some issues in resize volume(1) fix issue: volume size is not updated even if the operation succeed
(2) Add ui support for root volume resize
(3) resize on qcow2 type ROOT volume of stopped vm does not really work
see https://issues.apache.org/jira/browse/CLOUDSTACK-9101

* pr/1161:
  CLOUDSTACK-9101: resize root volume of stopped vm on KVM
  CLOUDSTACK-9101: add UI support for root volume resize
  CLOUDSTACK-9101: update volume size after resizevolume

Signed-off-by: Daan Hoogland <da...@onecht.net>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/998b1ba6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/998b1ba6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/998b1ba6

Branch: refs/heads/4.6
Commit: 998b1ba629bfdf3ea26fd515ad62f26260dee060
Parents: 4f6ff6c 9221cb3
Author: Daan Hoogland <da...@onecht.net>
Authored: Sun Dec 6 19:44:16 2015 +0100
Committer: Daan Hoogland <da...@onecht.net>
Committed: Sun Dec 6 19:44:16 2015 +0100

----------------------------------------------------------------------
 scripts/storage/qcow2/resizevolume.sh           | 22 +++++++++++----
 .../com/cloud/storage/VolumeApiServiceImpl.java |  3 ++
 ui/scripts/storage.js                           | 29 +++++++++++++++-----
 3 files changed, 42 insertions(+), 12 deletions(-)
----------------------------------------------------------------------



[2/4] git commit: updated refs/heads/4.6 to 998b1ba

Posted by da...@apache.org.
CLOUDSTACK-9101: add UI support for root volume resize


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d6e21f74
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d6e21f74
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d6e21f74

Branch: refs/heads/4.6
Commit: d6e21f74163212b198731ddf23dd48bc4c787b84
Parents: 119b27b
Author: Wei Zhou <w....@tech.leaseweb.com>
Authored: Thu Dec 3 11:53:42 2015 +0100
Committer: Wei Zhou <w....@tech.leaseweb.com>
Committed: Thu Dec 3 14:54:47 2015 +0100

----------------------------------------------------------------------
 ui/scripts/storage.js | 29 ++++++++++++++++++++++-------
 1 file changed, 22 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d6e21f74/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 77bd002..599802a 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -1536,14 +1536,27 @@
                                 },
                                 createForm: {
                                     title: 'label.action.resize.volume',
+                                    preFilter: function(args) {
+                                        if (args.context.volumes != null && args.context.volumes[0].type == 'ROOT') {
+                                            args.$form.find('.form-item[rel=newdiskoffering]').hide();
+                                        } else {
+                                            args.$form.find('.form-item[rel=newsize]').hide();
+                                        }
+                                    },
                                     fields: {
                                         newdiskoffering: {
                                             label: 'label.resize.new.offering.id',
                                             select: function(args) {
+                                                if (args.context.volumes != null && args.context.volumes[0].type == 'ROOT') {
+                                                    args.response.success({
+                                                        data: []
+                                                    });
+                                                    return;
+                                                }
+
                                                 $.ajax({
                                                     url: createURL("listDiskOfferings"),
                                                     dataType: "json",
-                                                    async: false,
                                                     success: function(json) {
                                                         diskofferingObjs = json.listdiskofferingsresponse.diskoffering;
                                                         var items = [];
@@ -1605,8 +1618,7 @@
                                             validation: {
                                                 required: true,
                                                 number: true
-                                            },
-                                            isHidden: true
+                                            }
                                         },
                                         shrinkok: {
                                             label: 'label.resize.shrink.ok',
@@ -1640,7 +1652,7 @@
 
                                     var newDiskOffering = args.data.newdiskoffering;
                                     var newSize;
-                                    if (selectedDiskOfferingObj.iscustomized == true) {
+                                    if (selectedDiskOfferingObj == null || selectedDiskOfferingObj.iscustomized == true) {
                                         newSize = args.data.newsize;
                                     }
                                     if (newDiskOffering != null && newDiskOffering.length > 0) {
@@ -1651,9 +1663,9 @@
                                     }
 
                                     var minIops;
-                                    var maxIops
+                                    var maxIops;
 
-                                    if (selectedDiskOfferingObj.iscustomizediops == true) {
+                                    if (selectedDiskOfferingObj != null && selectedDiskOfferingObj.iscustomizediops == true) {
                                         minIops = args.data.minIops;
                                         maxIops = args.data.maxIops;
                                     }
@@ -2338,11 +2350,14 @@
                 allowedActions.push("takeSnapshot");
                 allowedActions.push("recurringSnapshot");
             }
+        }
 
-            if (jsonObj.type == "DATADISK") {
+        if (jsonObj.hypervisor == "KVM" || jsonObj.hypervisor == "XenServer" || jsonObj.hypervisor == "VMware") {
+            if (jsonObj.state == "Ready" || jsonObj.state == "Allocated") {
                 allowedActions.push("resize");
             }
         }
+
         if (jsonObj.state != "Allocated") {
             if ((jsonObj.vmstate == "Stopped" || jsonObj.virtualmachineid == null) && jsonObj.state == "Ready") {
                 allowedActions.push("downloadVolume");


[3/4] git commit: updated refs/heads/4.6 to 998b1ba

Posted by da...@apache.org.
CLOUDSTACK-9101: resize root volume of stopped vm on KVM


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9221cb3e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9221cb3e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9221cb3e

Branch: refs/heads/4.6
Commit: 9221cb3e0d0e5a0ea374f10e889f7e32c2a3eda1
Parents: d6e21f7
Author: Wei Zhou <w....@tech.leaseweb.com>
Authored: Thu Dec 3 14:31:55 2015 +0100
Committer: Wei Zhou <w....@tech.leaseweb.com>
Committed: Thu Dec 3 14:54:49 2015 +0100

----------------------------------------------------------------------
 scripts/storage/qcow2/resizevolume.sh | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9221cb3e/scripts/storage/qcow2/resizevolume.sh
----------------------------------------------------------------------
diff --git a/scripts/storage/qcow2/resizevolume.sh b/scripts/storage/qcow2/resizevolume.sh
index 1e6ffd6..da77cb1 100755
--- a/scripts/storage/qcow2/resizevolume.sh
+++ b/scripts/storage/qcow2/resizevolume.sh
@@ -187,6 +187,22 @@ resizeqcow2() {
   # if this is a shrink operation, fail if commands will shrink the volume and we haven't signed of on shrinking
   failshrink
 
+  #move this back into cloudstack libvirt calls once the libvirt java bindings support block resize
+  #we try to inform hypervisor of new size, but don't fail if we can't
+  if `virsh help 2>/dev/null | grep -q blockresize`
+  then
+    if `virsh domstate $vmname >/dev/null 2>&1`
+    then
+        log "vm $vmname is running, use 'virsh blockresize' to resize the volume"
+        notifyqemu
+        if [ $? -eq 0 ]
+        then
+            log "performed successful resize - currentsize:$currentsize newsize:$newsize path:$path type:$ptype vmname:$vmname live:$liveresize shrink:$shrink"
+            exit 0
+        fi
+    fi
+  fi
+
   output=`qemu-img resize $path $newsize 2>&1`
   retval=$?
 
@@ -196,10 +212,6 @@ resizeqcow2() {
     exit 1
   fi
 
-  #move this back into cloudstack libvirt calls once the libvirt java bindings support block resize
-  #we try to inform hypervisor of new size, but don't fail if we can't
-  notifyqemu
-
   log "performed successful resize - currentsize:$currentsize newsize:$newsize path:$path type:$ptype vmname:$vmname live:$liveresize shrink:$shrink"
 }
 
@@ -244,7 +256,7 @@ then
   resizelvm
 elif [ "$ptype" == "QCOW2" ]
 then
-  notifyqemu
+  resizeqcow2
 elif [ "$ptype" == "NOTIFYONLY" ]
 then
   notifyqemu