mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
listVirtualMachine api: return "Not created" as a root volume type when volume's storage pool id is NULL
This commit is contained in:
parent
c0e2986766
commit
e2aa4738ec
@ -429,8 +429,12 @@ public class ApiResponseHelper {
|
||||
VolumeVO rootVolume = ApiDBUtils.findRootVolume(userVm.getId());
|
||||
if (rootVolume != null) {
|
||||
userVmResponse.setRootDeviceId(rootVolume.getDeviceId());
|
||||
StoragePoolVO storagePool = ApiDBUtils.findStoragePoolById(rootVolume.getPoolId());
|
||||
userVmResponse.setRootDeviceType(storagePool.getPoolType().toString());
|
||||
String rootDeviceType = "Not created";
|
||||
if (rootVolume.getPoolId() != null){
|
||||
StoragePoolVO storagePool = ApiDBUtils.findStoragePoolById(rootVolume.getPoolId());
|
||||
rootDeviceType = storagePool.getPoolType().toString();
|
||||
}
|
||||
userVmResponse.setRootDeviceType(rootDeviceType);
|
||||
}
|
||||
|
||||
//stats calculation
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user