harikrishna-patnala commented on a change in pull request #4581:
URL: https://github.com/apache/cloudstack/pull/4581#discussion_r563524961



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -3844,7 +3848,10 @@ private UserVm createVirtualMachine(DataCenter zone, 
ServiceOffering serviceOffe
             // Check is hostName is RFC compliant
             checkNameForRFCCompliance(hostName);
         }
-        instanceName = VirtualMachineName.getVmName(id, owner.getId(), 
_instance);
+        instanceName = VirtualMachineName.getVmName(id, owner.getId(), 
instanceSuffix);

Review comment:
       here `instanceName` variable is used to set name on hypervisor but the 
same variable is used later for internal name.
   `instanceSuffix` is assigned based on displayName (not considering 
instanceNameFlag), does this effect the case where flag is false and 
displayName is provided ? 
   In that case internal-name should be `i - <user_id> - <vm_id> 
-<instance.name>` but here we are assigning `i - <user_id> - <vm_id> 
-<hostName>`. 

##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -3844,7 +3848,10 @@ private UserVm createVirtualMachine(DataCenter zone, 
ServiceOffering serviceOffe
             // Check is hostName is RFC compliant
             checkNameForRFCCompliance(hostName);
         }
-        instanceName = VirtualMachineName.getVmName(id, owner.getId(), 
_instance);
+        instanceName = VirtualMachineName.getVmName(id, owner.getId(), 
instanceSuffix);

Review comment:
       Thanks @shwstppr I missed the check at 3823




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to