Revision 6440754f

View differences:

src/vmm_mad/remotes/lib/vcenter_driver/host.rb
313 313
        Datacenter.new(item)
314 314
    end
315 315

  
316
    def self.to_one(name, host, user, pass, ref, vc_uuid)
316
    def self.to_one(name, host, user, pass, ref, vc_uuid, vc_version)
317 317

  
318 318
        one_host = VCenterDriver::VIHelper.new_one_item(OpenNebula::Host)
319 319

  
......
332 332
                   "VCENTER_PASSWORD=\"#{pass}\"\n"\
333 333
                   "VCENTER_USER=\"#{user}\"\n"\
334 334
                   "VCENTER_CCR_REF=\"#{ref}\"\n"\
335
                   "VCENTER_INSTANCE_ID=\"#{vc_uuid}\"\n"
335
                   "VCENTER_INSTANCE_ID=\"#{vc_uuid}\"\n"\
336
                   "VCENTER_VERSION=\"#{vc_version}\"\n"\
336 337

  
337 338
        rc = one_host.update(template, false)
338 339

  
src/vmm_mad/remotes/lib/vcenter_driver/importer.rb
15 15
        dc_folder = VCenterDriver::DatacenterFolder.new(vi_client)
16 16

  
17 17
        # Get vcenter intance uuid as moref is unique for each vcenter
18
        vc_uuid = dc_folder.get_vcenter_instance_uuid
18
        vc_uuid = vi_client.vim.serviceContent.about.instanceUuid
19

  
20
        # Get vcenter API version
21
        vc_version = vi_client.vim.serviceContent.about.apiVersion
19 22

  
20 23
        rs = dc_folder.get_unimported_hosts
21 24

  
......
42 45
                                                                        con_ops[:user],
43 46
                                                                        con_ops[:password],
44 47
                                                                        c['_ref'],
45
                                                                        vc_uuid)
48
                                                                        vc_uuid,
49
                                                                        vc_version)
46 50

  
47 51
                STDOUT.puts "    OpenNebula host #{imported_name} with "\
48 52
                            " id #{one_host.id} successfully created."

Also available in: Unified diff