diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 557437fefb..af8e9360c3 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -896,7 +896,7 @@ class ExecDriver < VirtualMachineDriver { :driver => :vmm, :action => :attach_nic, - :parameters => [:deploy_id, mac, source, model, vn_mad, target, xml_data] + :parameters => [:deploy_id, mac, source, model, vn_mad, target] }, # Execute post-boot networking setup { diff --git a/src/vmm_mad/remotes/vcenter/attach_nic b/src/vmm_mad/remotes/vcenter/attach_nic index 75c8c162d6..29cd03ba24 100755 --- a/src/vmm_mad/remotes/vcenter/attach_nic +++ b/src/vmm_mad/remotes/vcenter/attach_nic @@ -33,11 +33,12 @@ vm_ref = ARGV[0] mac = ARGV[1] bridge = ARGV[2] model = ARGV[3] -xml_data = ARGV[4] vc_cluster_name = ARGV[-1] drv_action = OpenNebula::XMLElement.new -drv_action.initialize_xml(xml_data, 'VM') +drv_action.initialize_xml(Base64.decode64(STDIN.read), 'VMM_DRIVER_ACTION_DATA') + +vm_xml = drv_action.retrieve_xmlelements("VM").first host = VCenterDriver::VIHelper.find_by_name(OpenNebula::HostPool, vc_cluster_name) host_id = host['ID'] @@ -47,13 +48,13 @@ begin vm = VCenterDriver::VirtualMachine.new_from_ref(vm_ref, vi_client) - # Setting one_item with info with xml_data including NIC to be added - vm.one_item = drv_action + # Setting one_item with info with the vm_xml including NIC to be added + vm.one_item = vm_xml nic = { - "MAC" => mac, + "MAC" => mac, "BRIDGE" => bridge, - "MODEL" => model + "MODEL" => model } vm.attach_nic(nic)