[ https://issues.apache.org/jira/browse/CLOUDSTACK-10013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16296565#comment-16296565 ]
ASF GitHub Bot commented on CLOUDSTACK-10013: --------------------------------------------- rafaelweingartner commented on a change in pull request #2211: CLOUDSTACK-10013: Migrate systemvmtemplate to Debian9 URL: https://github.com/apache/cloudstack/pull/2211#discussion_r157705667 ########## 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; + final VirtualDisk disk = vdisk.first(); + if (reqSize > disk.getCapacityInKB()) { + final VirtualMachineDiskInfo diskInfo = getMatchingExistingDisk(vmMo.getDiskInfoBuilder(), rootDiskTO, hyperHost, context); assert (diskInfo != null); - String[] diskChain = diskInfo.getDiskChain(); + final String[] diskChain = diskInfo.getDiskChain(); - if (diskChain != null && diskChain.length>1) - { - s_logger.error("Unsupported Disk chain length "+ diskChain.length); - throw new Exception("Unsupported Disk chain length "+ diskChain.length); + if (diskChain != null && diskChain.length > 1) { + s_logger.warn("Disk chain length for the VM is greater than one, skipping resizing of root disk."); + return; } - if (diskInfo.getDiskDeviceBusName() == null || !diskInfo.getDiskDeviceBusName().toLowerCase().startsWith("scsi")) - { - s_logger.error("Unsupported root disk device bus "+ diskInfo.getDiskDeviceBusName() ); - throw new Exception("Unsupported root disk device bus "+ diskInfo.getDiskDeviceBusName()); + if (diskInfo.getDiskDeviceBusName() == null || !diskInfo.getDiskDeviceBusName().toLowerCase().startsWith("scsi")) { Review comment: What about using `org.apache.commons.lang3.StringUtils.equalsIgnoreCase(CharSequence, CharSequence)` 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: us...@infra.apache.org > Migrate to Debian9 systemvmtemplate > ----------------------------------- > > Key: CLOUDSTACK-10013 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10013 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Reporter: Rohit Yadav > Assignee: Rohit Yadav > Fix For: Future, 4.11.0.0 > > > Migrate to debian9 based systemvmtemplate -- This message was sent by Atlassian JIRA (v6.4.14#64029)