shwstppr commented on code in PR #9216:
URL: https://github.com/apache/cloudstack/pull/9216#discussion_r1636002052


##########
plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java:
##########
@@ -2697,9 +2702,20 @@ public VDI getIsoVDIByURL(final Connection conn, final 
String vmName, final Stri
         } catch (final URISyntaxException e) {
             throw new CloudRuntimeException("isoURL is wrong: " + isoURL);
         }
-        isoSR = getISOSRbyVmName(conn, vmName);
+        isoSR = getISOSRbyVmName(conn, vmName, false);
         if (isoSR == null) {
             isoSR = createIsoSRbyURI(conn, uri, vmName, false);
+        } else {
+            try {
+                String description = isoSR.getNameDescription(conn);
+                if (description.endsWith(ConfigDrive.CONFIGDRIVEDIR)) {
+                    throw new CloudRuntimeException(String.format("VM %s 
already has %s ISO attached. Please " +
+                            "stop-start VM for allowing attaching both ISOs", 
vmName, ConfigDrive.CONFIGDRIVEDIR));

Review Comment:
   ```suggestion
                               "stop-start VM to allow attaching-detaching both 
ISOs", vmName, ConfigDrive.CONFIGDRIVEDIR));
   ```



-- 
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: [email protected]

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

Reply via email to