You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
+14-10Lines changed: 14 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1507,13 +1507,13 @@ public void destroyPatchVbd(final Connection conn, final Set<VM> vms) throws Xml
1507
1507
finalVDIpatchVDI = findPatchIsoVDI(conn, sr);
1508
1508
for (finalVMvm : vms) {
1509
1509
finalStringvmName = vm.getNameLabel(conn);
1510
-
try {
1511
-
if (!vmName.startsWith("r-") && !vmName.startsWith("s-") && !vmName.startsWith("v-")) {
1512
-
return;
1513
-
}
1514
-
finalSet<VBD> vbds = vm.getVBDs(conn);
1515
-
for (finalVBDvbd : vbds) {
1516
-
if (Types.VbdType.CD.equals(vbd.getType(conn))) {
1510
+
if (!vmName.startsWith("r-") && !vmName.startsWith("s-") && !vmName.startsWith("v-")) {
1511
+
continue;
1512
+
}
1513
+
finalSet<VBD> vbds = vm.getVBDs(conn);
1514
+
for (finalVBDvbd : vbds) {
1515
+
if (Types.VbdType.CD.equals(vbd.getType(conn))) {
1516
+
try {
1517
1517
if (!vbd.getEmpty(conn)) {
1518
1518
vbd.eject(conn);
1519
1519
}
@@ -1522,12 +1522,16 @@ public void destroyPatchVbd(final Connection conn, final Set<VM> vms) throws Xml
1522
1522
vbd.insert(conn, patchVDI);
1523
1523
vbd.eject(conn);
1524
1524
}
1525
+
} catch (Exceptione) {
1526
+
s_logger.debug("Cannot eject CD-ROM device for VM " + vmName + " due to " + e.toString(), e);
1527
+
}
1528
+
try {
1525
1529
vbd.destroy(conn);
1526
-
break;
1530
+
} catch (Exceptione) {
1531
+
s_logger.debug("Cannot destroy CD-ROM device for VM " + vmName + " due to " + e.toString(), e);
1527
1532
}
1533
+
break;
1528
1534
}
1529
-
} catch (finalExceptione) {
1530
-
s_logger.debug("Cannot destroy CD-ROM device for VM " + vmName + " due to " + e.toString(), e);
if (!volume.getSize().equals(newSize) && volume.getVolumeType().equals(Volume.Type.ROOT) && !State.Stopped.equals(vmInstanceVO.getState())) {
1218
-
thrownewInvalidParameterValueException(String.format("Cannot resize ROOT volume [%s] when VM is not on Stopped State. VM %s is in state %.", volume.getName(), vmInstanceVO
1218
+
thrownewInvalidParameterValueException(String.format("Cannot resize ROOT volume [%s] when VM is not on Stopped State. VM %s is in state %s", volume.getName(), vmInstanceVO
if (!dsMo.folderExists(dsPath, VSPHERE_DATASTORE_BASE_FOLDER)) {
2250
2250
s_logger.info(String.format("vSphere datastore base folder: %s does not exist, now creating on datastore: %s", VSPHERE_DATASTORE_BASE_FOLDER, dsMo.getName()));
0 commit comments