mirror of https://github.com/apache/cloudstack.git
Fixed root disk resize on deploy for RBD.
Signed-off-by: Wido den Hollander <wido@widodh.nl>
(cherry picked from commit 3a52a83fae)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Conflicts:
plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
This commit is contained in:
parent
bf9e1ae7e8
commit
3a36681b6e
|
|
@ -1080,6 +1080,13 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
|
|||
|
||||
rbd.clone(template.getName(), this.rbdTemplateSnapName, io, disk.getName(), this.rbdFeatures, this.rbdOrder);
|
||||
s_logger.debug("Succesfully cloned " + template.getName() + "@" + this.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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue