Set encrypted PowerFlex disk format correctly (#7735)

Co-authored-by: Marcus Sorensen <mls@apple.com>
This commit is contained in:
Marcus Sorensen 2023-07-24 01:43:46 -06:00 committed by GitHub
parent 90baae3dcd
commit 63216425d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -1609,6 +1609,9 @@ public class KVMStorageProcessor implements StorageProcessor {
if (vol.getQemuEncryptFormat() != null) {
newVol.setEncryptFormat(vol.getQemuEncryptFormat().toString());
}
if (vol.getFormat() != null) {
format = vol.getFormat();
}
}
newVol.setSize(volume.getSize());
newVol.setFormat(ImageFormat.valueOf(format.toString().toUpperCase()));

View File

@ -504,11 +504,7 @@ public class ScaleIOPrimaryDataStoreDriver implements PrimaryDataStoreDriver {
volume.setFolder(scaleIOVolume.getVtreeId());
volume.setSize(scaleIOVolume.getSizeInKb() * 1024);
volume.setPoolType(Storage.StoragePoolType.PowerFlex);
if (volumeInfo.getVolumeType().equals(Volume.Type.ROOT)) {
volume.setFormat(volumeInfo.getFormat());
} else {
volume.setFormat(Storage.ImageFormat.RAW);
}
volume.setFormat(volumeInfo.getFormat());
volume.setPoolId(storagePoolId);
VolumeObject createdObject = VolumeObject.getVolumeObject(volumeInfo.getDataStore(), volume);
createdObject.update();
@ -1202,7 +1198,7 @@ public class ScaleIOPrimaryDataStoreDriver implements PrimaryDataStoreDriver {
if (payload.instanceName != null) {
VMInstanceVO instance = vmInstanceDao.findVMByInstanceName(payload.instanceName);
if (instance.getState().equals(VirtualMachine.State.Running)) {
if (instance != null && instance.getState().equals(VirtualMachine.State.Running)) {
hostId = instance.getHostId();
attachedRunning = true;
}