CLOUDSTACK-8119. [VMware] Cannot attach more than 8 volumes to a VM.

This commit is contained in:
Likitha Shetty 2014-12-03 19:28:41 +05:30
parent 4d7ede535d
commit b1bca2a2c0
1 changed files with 2 additions and 2 deletions

View File

@ -2323,7 +2323,7 @@ public class VirtualMachineMO extends BaseMO {
List<Integer> existingUnitNumbers = new ArrayList<Integer>();
int deviceNumber = 0;
int ideControllerKey = getIDEDeviceControllerKey();
int scsiControllerKey = getScsiDeviceControllerKeyNoException();
if (devices != null && devices.size() > 0) {
for (VirtualDevice device : devices) {
if (device.getControllerKey() != null && device.getControllerKey().intValue() == controllerKey) {
@ -2334,7 +2334,7 @@ public class VirtualMachineMO extends BaseMO {
while (true) {
// Next device number should be the lowest device number on the key that is not in use and is not reserved.
if (!existingUnitNumbers.contains(Integer.valueOf(deviceNumber))) {
if (controllerKey != ideControllerKey && !VmwareHelper.isReservedScsiDeviceNumber(deviceNumber))
if (controllerKey != scsiControllerKey || !VmwareHelper.isReservedScsiDeviceNumber(deviceNumber))
break;
}
++deviceNumber;