weizhouapache commented on code in PR #10720: URL: https://github.com/apache/cloudstack/pull/10720#discussion_r2048480670
########## server/src/main/java/com/cloud/vm/UserVmManagerImpl.java: ########## @@ -3805,11 +3805,18 @@ public UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serv @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying Vm") public UserVm finalizeCreateVirtualMachine(long vmId) { s_logger.info("Loading UserVm " + vmId + " from DB"); - UserVm userVm = getUserVm(vmId); + UserVmVO userVm = _vmDao.findById(vmId); if (userVm == null) { s_logger.info("Loaded UserVm " + vmId + " (" + userVm.getUuid() + ") from DB"); } else { s_logger.warn("UserVm " + vmId + " does not exist in DB"); Review Comment: logs in line 3810 and line 3812 seem wrong . they have been fixed in 4.20 ########## server/src/main/java/com/cloud/vm/UserVmManagerImpl.java: ########## @@ -3805,11 +3805,18 @@ public UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serv @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying Vm") public UserVm finalizeCreateVirtualMachine(long vmId) { s_logger.info("Loading UserVm " + vmId + " from DB"); - UserVm userVm = getUserVm(vmId); + UserVmVO userVm = _vmDao.findById(vmId); if (userVm == null) { s_logger.info("Loaded UserVm " + vmId + " (" + userVm.getUuid() + ") from DB"); } else { s_logger.warn("UserVm " + vmId + " does not exist in DB"); + VMTemplateVO template = _templateDao.findById(userVm.getTemplateId()); + if (template != null && template.isEnablePassword()) { + String password = _mgr.generateRandomPassword(); Review Comment: maybe better add a line of log before generating password ? ########## server/src/main/java/com/cloud/vm/UserVmManagerImpl.java: ########## @@ -3805,11 +3805,18 @@ public UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serv @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying Vm") public UserVm finalizeCreateVirtualMachine(long vmId) { s_logger.info("Loading UserVm " + vmId + " from DB"); - UserVm userVm = getUserVm(vmId); + UserVmVO userVm = _vmDao.findById(vmId); Review Comment: can we change the return type of `getUserVm` from `UserVm` to `UserVmVO` ? -- 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: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org