rafaelweingartner commented on a change in pull request #2211:
CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9
URL: https://github.com/apache/cloudstack/pull/2211#discussion_r157704898
##########
File path:
plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -2165,28 +2165,24 @@ private String appendFileType(String path, String
fileType) {
return path + fileType;
}
- private void resizeRootDisk(VirtualMachineMO vmMo, DiskTO rootDiskTO,
VmwareHypervisorHost hyperHost, VmwareContext context) throws Exception
- {
- Pair<VirtualDisk, String> vdisk = getVirtualDiskInfo(vmMo,
appendFileType(rootDiskTO.getPath(), ".vmdk"));
+ private void resizeRootDiskOnVMStart(VirtualMachineMO vmMo, DiskTO
rootDiskTO, VmwareHypervisorHost hyperHost, VmwareContext context) throws
Exception {
+ final Pair<VirtualDisk, String> vdisk = getVirtualDiskInfo(vmMo,
appendFileType(rootDiskTO.getPath(), ".vmdk"));
assert(vdisk != null);
- Long reqSize=((VolumeObjectTO)rootDiskTO.getData()).getSize()/1024;
- VirtualDisk disk = vdisk.first();
- if (reqSize > disk.getCapacityInKB())
- {
- VirtualMachineDiskInfo diskInfo =
getMatchingExistingDisk(vmMo.getDiskInfoBuilder(), rootDiskTO, hyperHost,
context);
+ final Long reqSize = ((VolumeObjectTO)rootDiskTO.getData()).getSize()
/ 1024;
Review comment:
can `getSize` return `Null`? If not, it is ok; otherwise, a NPE can happen
here
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services