Revision e70caf37 src/vmm_mad/remotes/vcenter/attach_nic

View differences:

src/vmm_mad/remotes/vcenter/attach_nic
33 33
mac              = ARGV[1]
34 34
bridge           = ARGV[2]
35 35
model            = ARGV[3]
36
xml_data         = ARGV[4]
37 36
vc_cluster_name  = ARGV[-1]
38 37

  
39 38
drv_action = OpenNebula::XMLElement.new
40
drv_action.initialize_xml(xml_data, 'VM')
39
drv_action.initialize_xml(Base64.decode64(STDIN.read), 'VMM_DRIVER_ACTION_DATA')
40

  
41
vm_xml = drv_action.retrieve_xmlelements("VM").first
41 42

  
42 43
host = VCenterDriver::VIHelper.find_by_name(OpenNebula::HostPool, vc_cluster_name)
43 44
host_id = host['ID']
......
47 48

  
48 49
    vm = VCenterDriver::VirtualMachine.new_from_ref(vm_ref, vi_client)
49 50

  
50
    # Setting one_item with info with xml_data including NIC to be added
51
    vm.one_item = drv_action
51
    # Setting one_item with info with the vm_xml including NIC to be added
52
    vm.one_item = vm_xml
52 53

  
53 54
    nic = {
54
        "MAC" => mac,
55
        "MAC"    => mac,
55 56
        "BRIDGE" => bridge,
56
        "MODEL" => model
57
        "MODEL"  => model
57 58
    }
58 59

  
59 60
    vm.attach_nic(nic)

Also available in: Unified diff