Spaceman1984 commented on a change in pull request #4640:
URL: https://github.com/apache/cloudstack/pull/4640#discussion_r571966539



##########
File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/storage/resource/VmwareStorageProcessor.java
##########
@@ -929,21 +929,21 @@ private String cloneVMforVvols(VmwareContext context, 
VmwareHypervisorHost hyper
         return vmdkFileBaseName;
     }
 
-    private String createVMFolderWithVMName(VmwareContext context, 
VmwareHypervisorHost hyperHost, TemplateObjectTO template,
-                                            VirtualMachineMO vmTemplate, 
VolumeObjectTO volume, DatacenterMO dcMo, DatastoreMO dsMo,
-                                            String searchExcludedFolders) 
throws Exception {
+    private String createVMAndFolderWithVMName(VmwareContext context, 
VmwareHypervisorHost hyperHost, TemplateObjectTO template,
+                                               VirtualMachineMO vmTemplate, 
VolumeObjectTO volume, DatacenterMO dcMo, DatastoreMO dsMo,
+                                               String searchExcludedFolders) 
throws Exception {
         String vmdkName = volume.getName();
         try {
             ManagedObjectReference morDatastore = dsMo.getMor();
             ManagedObjectReference morPool = 
hyperHost.getHyperHostOwnerResourcePool();
             ManagedObjectReference morCluster = 
hyperHost.getHyperHostCluster();
-            if (template.getSize() != null){
+            if (template.getSize() != null) {
                 _fullCloneFlag = volume.getSize() > template.getSize() ? true 
: _fullCloneFlag;
             }
             if (!_fullCloneFlag) {
                 createVMLinkedClone(vmTemplate, dcMo, vmdkName, morDatastore, 
morPool);

Review comment:
       I have added checks

##########
File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/storage/resource/VmwareStorageProcessor.java
##########
@@ -3950,7 +3950,7 @@ public VirtualMachineMO 
cloneVMFromTemplate(VmwareHypervisorHost hyperHost, Stri
             if (!_fullCloneFlag) {
                 createVMLinkedClone(templateMo, dcMo, cloneName, morDatastore, 
morPool);

Review comment:
       I have added checks




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to