From b4529d302431c84cb2ab202790163f191e42b2a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantino=20V=C3=A1zquez=20Blanco?= Date: Fri, 10 Jul 2009 14:19:17 +0000 Subject: [PATCH] Added dynamic virtualswitch selection in VMWare drivers git-svn-id: http://svn.opennebula.org/one/trunk@671 3034c82b-c49b-4eb3-8279-a7acafdc01c0 --- src/im_mad/vmware/OneImVmware.java | 4 +- src/vmm_mad/vmware/DeployVM.java | 284 +++++++++++------------ src/vmm_mad/vmware/OperationsOverVM.java | 4 +- src/vmm_mad/vmware/ParseXML.java | 22 +- 4 files changed, 151 insertions(+), 163 deletions(-) diff --git a/src/im_mad/vmware/OneImVmware.java b/src/im_mad/vmware/OneImVmware.java index e6da8778d9..c4a17fcbd4 100644 --- a/src/im_mad/vmware/OneImVmware.java +++ b/src/im_mad/vmware/OneImVmware.java @@ -125,9 +125,9 @@ class OneImVmware extends Thread } argsWithHost[arguments.length] = "--url"; -// argsWithHost[arguments.length + 1 ] = "https://" + hostToMonitor + ":443/sdk"; + argsWithHost[arguments.length + 1 ] = "https://" + hostToMonitor + ":443/sdk"; - argsWithHost[arguments.length + 1 ] = "https://localhost:8008/sdk"; +// argsWithHost[arguments.length + 1 ] = "https://localhost:8008/sdk"; gP = new GetProperty(argsWithHost, "HostSystem", hostToMonitor); // Now it's time to build the response gathering the properties needed diff --git a/src/vmm_mad/vmware/DeployVM.java b/src/vmm_mad/vmware/DeployVM.java index 4c8f72ff0b..bcc342e095 100644 --- a/src/vmm_mad/vmware/DeployVM.java +++ b/src/vmm_mad/vmware/DeployVM.java @@ -217,8 +217,8 @@ public class DeployVM vmConfigSpec.setCpuAllocation(raInfo); // DISKs - - addDisks(); + // TODO finish disk support + // addDisks(); // Network @@ -253,6 +253,137 @@ public class DeployVM } + + void configureNetwork() + { + String[][] nics = pXML.getNet(); + + if(nics.length==1 && nics[0].equals("")) + { + return; + } + + // First, let's find out the number of NICs to be removed + // VirtualDevice [] test = vmConfigInfo.getHardware().getDevice(); + + + + // Lenth of array is #nicsToBeRemoved-#nicsToBeAdded + + //test.length+ + VirtualDeviceConfigSpec [] nicSpecArray = new VirtualDeviceConfigSpec[ + nics.length]; + + // Let's remove existing NICs + + /* for(int i=0;i size) { - dsName = ds.getName(); - i = datastores.length + 1; - } - } - return dsName; - } - */ - - DeployVM(String[] args, String hostName, String vid, ParseXML _pXML, String _datastore, String _datacenter) throws Exception - { - - String[] argsWithHost = new String[args.length+2]; - - for(int i=0;i