cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From likit...@apache.org
Subject git commit: updated refs/heads/master to f420dd5
Date Wed, 24 Dec 2014 05:30:08 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master ddcae8a93 -> f420dd55f


CLOUDSTACK-8119. [VMware] Cannot attach more than 8 volumes to a VM.
While attaching a new disk to an instance, the unit number on the controller key should be
the lowest unit number
that is not in use. And in case the controller type is SCSI it shouln't be the reserved SCSI
unit number.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f420dd55
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f420dd55
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f420dd55

Branch: refs/heads/master
Commit: f420dd55fb5c4ec40aec0232618b2162c6d2f88c
Parents: ddcae8a
Author: Likitha Shetty <likitha.shetty@citrix.com>
Authored: Mon Dec 1 19:49:06 2014 +0530
Committer: Likitha Shetty <likitha.shetty@citrix.com>
Committed: Wed Dec 24 10:48:03 2014 +0530

----------------------------------------------------------------------
 .../com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java    | 9 ++++-----
 .../src/com/cloud/hypervisor/vmware/util/VmwareHelper.java  | 8 --------
 2 files changed, 4 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f420dd55/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
index be39bfb..8f05021 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
@@ -1018,8 +1018,6 @@ public class VirtualMachineMO extends BaseMO {
         }
 
         int deviceNumber = getNextDeviceNumber(controllerKey);
-        if (controllerKey != ideControllerKey && VmwareHelper.isReservedScsiDeviceNumber(deviceNumber))
-            deviceNumber++;
 
         newDisk.setControllerKey(controllerKey);
         newDisk.setKey(-deviceNumber);
@@ -1858,8 +1856,6 @@ public class VirtualMachineMO extends BaseMO {
     public int getNextScsiDiskDeviceNumber() throws Exception {
         int scsiControllerKey = getScsiDeviceControllerKey();
         int deviceNumber = getNextDeviceNumber(scsiControllerKey);
-        if (VmwareHelper.isReservedScsiDeviceNumber(deviceNumber))
-            deviceNumber++;
 
         return deviceNumber;
     }
@@ -2319,6 +2315,7 @@ public class VirtualMachineMO extends BaseMO {
 
         List<Integer> existingUnitNumbers = new ArrayList<Integer>();
         int deviceNumber = 0;
+        int ideControllerKey = getIDEDeviceControllerKey();
         if (devices != null && devices.size() > 0) {
             for (VirtualDevice device : devices) {
                 if (device.getControllerKey() != null && device.getControllerKey().intValue()
== controllerKey) {
@@ -2327,8 +2324,10 @@ 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))) {
-                break;
+                if (controllerKey != ideControllerKey && !VmwareHelper.isReservedScsiDeviceNumber(deviceNumber))
+                    break;
             }
             ++deviceNumber;
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f420dd55/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java
index f31ffc0..e38e7ee 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java
@@ -188,8 +188,6 @@ public class VmwareHelper {
             controllerKey = ideControllerKey;
         if (deviceNumber < 0) {
             deviceNumber = vmMo.getNextDeviceNumber(controllerKey);
-            if (controllerKey != ideControllerKey && isReservedScsiDeviceNumber(deviceNumber))
-                deviceNumber++;
         }
         disk.setControllerKey(controllerKey);
 
@@ -261,8 +259,6 @@ public class VmwareHelper {
         disk.setControllerKey(controllerKey);
         if (deviceNumber < 0) {
             deviceNumber = vmMo.getNextDeviceNumber(controllerKey);
-            if (controllerKey != ideControllerKey && isReservedScsiDeviceNumber(deviceNumber))
-                deviceNumber++;
         }
 
         disk.setKey(-contextNumber);
@@ -300,8 +296,6 @@ public class VmwareHelper {
                 controllerKey = ideControllerKey;
             if (deviceNumber < 0) {
                 deviceNumber = vmMo.getNextDeviceNumber(controllerKey);
-                if (controllerKey != ideControllerKey && isReservedScsiDeviceNumber(deviceNumber))
-                    deviceNumber++;
             }
 
             disk.setControllerKey(controllerKey);
@@ -354,8 +348,6 @@ public class VmwareHelper {
             controllerKey = ideControllerKey;
         if (deviceNumber < 0) {
             deviceNumber = vmMo.getNextDeviceNumber(controllerKey);
-            if (controllerKey != ideControllerKey && isReservedScsiDeviceNumber(deviceNumber))
-                deviceNumber++;
         }
 
         disk.setControllerKey(controllerKey);


Mime
View raw message