cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject git commit: updated refs/heads/master to 3a52a83
Date Fri, 31 Oct 2014 21:17:41 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master f28ade56f -> 3a52a83fa


Fixed root disk resize on deploy for RBD.

Signed-off-by: Wido den Hollander <wido@widodh.nl>


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

Branch: refs/heads/master
Commit: 3a52a83faeaa72a8488b2db1253fef6d3308d708
Parents: f28ade5
Author: Logan Barfield <lbarfield@tqhosting.com>
Authored: Thu Oct 30 16:18:52 2014 -0400
Committer: Wido den Hollander <wido@widodh.nl>
Committed: Fri Oct 31 22:17:27 2014 +0100

----------------------------------------------------------------------
 .../cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java  | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3a52a83f/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
index af7a0e0..c882a78 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
@@ -1083,6 +1083,14 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
 
                         rbd.clone(template.getName(), rbdTemplateSnapName, io, disk.getName(),
rbdFeatures, rbdOrder);
                         s_logger.debug("Succesfully cloned " + template.getName() + "@" +
rbdTemplateSnapName + " to " + disk.getName());
+                        /* We also need to resize the image if the VM was deployed with a
larger root disk size */
+                        if (disk.getVirtualSize() > template.getVirtualSize()) {
+                            RbdImage diskImage = rbd.open(disk.getName());
+                            diskImage.resize(disk.getVirtualSize());
+                            rbd.close(diskImage);
+                            s_logger.debug("Resized " + disk.getName() + " to " + disk.getVirtualSize());
+                        }
+
                     }
 
                     rbd.close(srcImage);


Mime
View raw message