Skip to content

Commit 6321642

Browse files
Marcus SorensenMarcus Sorensen
andauthored
Set encrypted PowerFlex disk format correctly (#7735)
Co-authored-by: Marcus Sorensen <mls@apple.com>
1 parent 90baae3 commit 6321642

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,9 @@ public Answer createVolume(final CreateObjectCommand cmd) {
16091609
if (vol.getQemuEncryptFormat() != null) {
16101610
newVol.setEncryptFormat(vol.getQemuEncryptFormat().toString());
16111611
}
1612+
if (vol.getFormat() != null) {
1613+
format = vol.getFormat();
1614+
}
16121615
}
16131616
newVol.setSize(volume.getSize());
16141617
newVol.setFormat(ImageFormat.valueOf(format.toString().toUpperCase()));

plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/driver/ScaleIOPrimaryDataStoreDriver.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,7 @@ public CreateObjectAnswer createVolume(VolumeInfo volumeInfo, long storagePoolId
504504
volume.setFolder(scaleIOVolume.getVtreeId());
505505
volume.setSize(scaleIOVolume.getSizeInKb() * 1024);
506506
volume.setPoolType(Storage.StoragePoolType.PowerFlex);
507-
if (volumeInfo.getVolumeType().equals(Volume.Type.ROOT)) {
508-
volume.setFormat(volumeInfo.getFormat());
509-
} else {
510-
volume.setFormat(Storage.ImageFormat.RAW);
511-
}
507+
volume.setFormat(volumeInfo.getFormat());
512508
volume.setPoolId(storagePoolId);
513509
VolumeObject createdObject = VolumeObject.getVolumeObject(volumeInfo.getDataStore(), volume);
514510
createdObject.update();
@@ -1202,7 +1198,7 @@ private void resizeVolume(VolumeInfo volumeInfo) {
12021198

12031199
if (payload.instanceName != null) {
12041200
VMInstanceVO instance = vmInstanceDao.findVMByInstanceName(payload.instanceName);
1205-
if (instance.getState().equals(VirtualMachine.State.Running)) {
1201+
if (instance != null && instance.getState().equals(VirtualMachine.State.Running)) {
12061202
hostId = instance.getHostId();
12071203
attachedRunning = true;
12081204
}

0 commit comments

Comments
 (0)