Skip to content

Commit 8aabab8

Browse files
Likitha Shettyyadvr
authored andcommitted
CLOUDSTACK-8119. [VMware] Cannot attach more than 8 volumes to a VM.
(cherry picked from commit b1bca2a) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 4708a0b commit 8aabab8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2377,7 +2377,7 @@ public int getNextDeviceNumber(int controllerKey) throws Exception {
23772377

23782378
List<Integer> existingUnitNumbers = new ArrayList<Integer>();
23792379
int deviceNumber = 0;
2380-
int ideControllerKey = getIDEDeviceControllerKey();
2380+
int scsiControllerKey = getScsiDeviceControllerKeyNoException();
23812381
if (devices != null && devices.size() > 0) {
23822382
for (VirtualDevice device : devices) {
23832383
if (device.getControllerKey() != null && device.getControllerKey().intValue() == controllerKey) {
@@ -2388,7 +2388,7 @@ public int getNextDeviceNumber(int controllerKey) throws Exception {
23882388
while (true) {
23892389
// Next device number should be the lowest device number on the key that is not in use and is not reserved.
23902390
if (!existingUnitNumbers.contains(Integer.valueOf(deviceNumber))) {
2391-
if (controllerKey != ideControllerKey && !VmwareHelper.isReservedScsiDeviceNumber(deviceNumber))
2391+
if (controllerKey != scsiControllerKey || !VmwareHelper.isReservedScsiDeviceNumber(deviceNumber))
23922392
break;
23932393
}
23942394
++deviceNumber;

0 commit comments

Comments
 (0)