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

(cherry picked from commit b1bca2a2c0)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Likitha Shetty 2014-12-03 19:28:41 +05:30 committed by Rohit Yadav
parent 4708a0b40d
commit 8aabab8a56
1 changed files with 2 additions and 2 deletions

View File

@ -2377,7 +2377,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) {
@ -2388,7 +2388,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;