diff --git a/src/vmm_mad/vmware/DeployVM.java b/src/vmm_mad/vmware/DeployVM.java index dda349eab2..7d97c8f4fb 100644 --- a/src/vmm_mad/vmware/DeployVM.java +++ b/src/vmm_mad/vmware/DeployVM.java @@ -392,7 +392,7 @@ public class DeployVM } */ - DeployVM(String[] args, String hostName, ParseXML _pXML) throws Exception + DeployVM(String[] args, String hostName, String vid, ParseXML _pXML) throws Exception { String[] argsWithHost = new String[args.length+2]; @@ -415,7 +415,8 @@ public class DeployVM datastoreName = "datastore1"; datacenterName = "ha-datacenter"; - vmName = _pXML.getName(); + vmName = _pXML.getName() + "-" + vid; + vmDiskName = _pXML.getName(); pXML = _pXML; // Get reference to host diff --git a/src/vmm_mad/vmware/OneVmmVmware.java b/src/vmm_mad/vmware/OneVmmVmware.java index c9df399d78..58ea6075f9 100644 --- a/src/vmm_mad/vmware/OneVmmVmware.java +++ b/src/vmm_mad/vmware/OneVmmVmware.java @@ -123,22 +123,22 @@ class OneVmmVmware extends Thread { // let's read the XML file and extract needed info ParseXML pXML = new ParseXML(fileName); - + // First, register the VM - DeployVM dVM = new DeployVM(arguments, hostName, pXML); - + DeployVM dVM = new DeployVM(arguments, hostName, vid_str, pXML); + if(!dVM.registerVirtualMachine()) { // We will skip this error, it may be pre-registered } - + // Now, proceed with the reconfiguration if(!dVM.shapeVM()) { throw new Exception("Error reconfiguring VM (" + pXML.getName() + ")."); } - + try { oVM = new OperationsOverVM(arguments,hostName); @@ -153,7 +153,7 @@ class OneVmmVmware extends Thread continue; } - if(!oVM.powerOn(pXML.getName())) + if(!oVM.powerOn(pXML.getName() + "-" + vid_str)) { throw new Exception("Error powering on VM(" + pXML.getName() + ")."); }