DaanHoogland commented on code in PR #8485:
URL: https://github.com/apache/cloudstack/pull/8485#discussion_r1446989929
##########
server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java:
##########
@@ -1111,7 +1111,7 @@ private UserVm importVirtualMachineInternal(final
UnmanagedInstanceTO unmanagedI
}
}
allDetails.put(VmDetailConstants.ROOT_DISK_CONTROLLER,
rootDisk.getController());
- if (cluster.getHypervisorType() != Hypervisor.HypervisorType.VMware) {
+ if (cluster.getHypervisorType() == Hypervisor.HypervisorType.KVM &&
isImportUnmanagedFromSameHypervisor) {
allDetails.put(VmDetailConstants.ROOT_DISK_SIZE,
String.valueOf(rootDisk.getCapacity() / Resource.ResourceType.bytesToGiB));
Review Comment:
@nvazquez I think we need to here make sure the minimum is 1. i.e.
```suggestion
long size = rootDisk.getCapacity() /
Resource.ResourceType.bytesToGiB;
if (size <= 0) {
size = 1;
}
allDetails.put(VmDetailConstants.ROOT_DISK_SIZE,
String.valueOf(size));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]