You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/09/12 16:35:17 UTC

[GitHub] [cloudstack] mlsorensen commented on a diff in pull request #6710: Allow option of exposing VM domain info via instance metadata

mlsorensen commented on code in PR #6710:
URL: https://github.com/apache/cloudstack/pull/6710#discussion_r968633017


##########
server/src/main/java/com/cloud/network/NetworkModelImpl.java:
##########
@@ -2551,6 +2553,10 @@ public List<String[]> generateVmData(String userData, String serviceOffering, lo
         final String zoneName = dcVo.getName();
 
         IPAddressVO publicIp = _ipAddressDao.findByAssociatedVmId(vmId);
+        VirtualMachine vm = _vmDao.findById(vmId);
+        if (vm == null) {
+            throw new CloudRuntimeException("Cannot generate VM instance data, no VM exists by given ID");

Review Comment:
   Good idea. I think the cloudruntimeexception will be logged at some stage, committing Daan's suggestion.



-- 
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-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org