You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by hu...@apache.org on 2013/07/15 10:18:21 UTC

git commit: updated refs/heads/master to 1f004f6

Updated Branches:
  refs/heads/master 388e95714 -> 1f004f60e


CLOUDSTACK-3425 Ignore network interfaces without a uuid when passing
them on as extra configs to ESX for nicira NVP controller.



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

Branch: refs/heads/master
Commit: 1f004f60e8542b7e6f75a780b59ad738161f7346
Parents: 388e957
Author: Vijayendra Bhamidipati <vi...@citrix.com>
Authored: Mon Jul 15 10:17:36 2013 +0200
Committer: Hugo Trippaers <ht...@schubergphilis.com>
Committed: Mon Jul 15 10:17:36 2013 +0200

----------------------------------------------------------------------
 .../vmware/resource/VmwareResource.java         | 22 ++++++++++++--------
 1 file changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1f004f60/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index b107df9..9049f4c 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -2826,10 +2826,12 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
              */
             int nicNum = 0;
             for (NicTO nicTo : sortNicsByDeviceId(nics)) {
-                newVal = new OptionValue();
-                newVal.setKey("nvp.iface-id." + nicNum);
-                newVal.setValue(nicTo.getUuid());
-                extraOptions.add(newVal);
+                if (nicTo.getUuid() != null) {
+                    newVal = new OptionValue();
+                    newVal.setKey("nvp.iface-id." + nicNum);
+                    newVal.setValue(nicTo.getUuid());
+                    extraOptions.add(newVal);
+                }
                 nicNum++;
             }
 
@@ -4063,15 +4065,16 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         }
     }
 
+    @Override
     public ManagedObjectReference handleDatastoreAndVmdkAttach(Command cmd, String iqn, String storageHost, int storagePort,
             String initiatorUsername, String initiatorPassword, String targetUsername, String targetPassword) throws Exception {
         VmwareContext context = getServiceContext();
         VmwareHypervisorHost hyperHost = getHyperHost(context);
 
         ManagedObjectReference morDs = createVmfsDatastore(hyperHost, iqn,
-                    storageHost, storagePort, iqn,
-                    initiatorUsername, initiatorPassword,
-                    targetUsername, targetPassword);
+                storageHost, storagePort, iqn,
+                initiatorUsername, initiatorPassword,
+                targetUsername, targetPassword);
 
         DatastoreMO dsMo = new DatastoreMO(context, morDs);
 
@@ -4094,6 +4097,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
         return morDs;
     }
 
+    @Override
     public void handleDatastoreAndVmdkDetach(String iqn, String storageHost, int storagePort) throws Exception {
         VmwareContext context = getServiceContext();
         VmwareHypervisorHost hyperHost = getHyperHost(context);
@@ -4124,8 +4128,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
 
             if (cmd.getAttach() && cmd.isManaged()) {
                 morDs = handleDatastoreAndVmdkAttach(cmd, cmd.get_iScsiName(), cmd.getStorageHost(), cmd.getStoragePort(),
-                            cmd.getChapInitiatorUsername(), cmd.getChapInitiatorPassword(),
-                            cmd.getChapTargetUsername(), cmd.getChapTargetPassword());
+                        cmd.getChapInitiatorUsername(), cmd.getChapInitiatorPassword(),
+                        cmd.getChapTargetUsername(), cmd.getChapTargetPassword());
             }
             else {
                 morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, cmd.getPoolUuid());