Merge pull request #1645 from myENA/feature/convert_rbd_to_qcow

On snapshot backup, this converts the rbd raw format on disk to qcow2 for compression.

* pr/1645:
  CLOUDSTACK-9461

Signed-off-by: Rajani Karuturi <rajani.karuturi@accelerite.com>
This commit is contained in:
Rajani Karuturi 2016-09-16 15:08:12 +05:30
commit 3f6faeb4c3

View File

@ -737,10 +737,10 @@ public class KVMStorageProcessor implements StorageProcessor {
final QemuImgFile srcFile = final QemuImgFile srcFile =
new QemuImgFile(KVMPhysicalDisk.RBDStringBuilder(primaryPool.getSourceHost(), primaryPool.getSourcePort(), primaryPool.getAuthUserName(), new QemuImgFile(KVMPhysicalDisk.RBDStringBuilder(primaryPool.getSourceHost(), primaryPool.getSourcePort(), primaryPool.getAuthUserName(),
primaryPool.getAuthSecret(), rbdSnapshot)); primaryPool.getAuthSecret(), rbdSnapshot));
srcFile.setFormat(PhysicalDiskFormat.RAW); srcFile.setFormat(snapshotDisk.getFormat());
final QemuImgFile destFile = new QemuImgFile(snapshotFile); final QemuImgFile destFile = new QemuImgFile(snapshotFile);
destFile.setFormat(snapshotDisk.getFormat()); destFile.setFormat(PhysicalDiskFormat.QCOW2);
s_logger.debug("Backing up RBD snapshot " + rbdSnapshot + " to " + snapshotFile); s_logger.debug("Backing up RBD snapshot " + rbdSnapshot + " to " + snapshotFile);
final QemuImg q = new QemuImg(cmd.getWaitInMillSeconds()); final QemuImg q = new QemuImg(cmd.getWaitInMillSeconds());