Revision 400f5126 src/vmm_mad/remotes/lib/vcenter_driver/host.rb

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, vc_version)
316
    def self.to_one(cluster, con_ops)
317 317

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

  
......
321 321
            raise "Could not create host: #{one_host.message}"
322 322
        end
323 323

  
324
        rc = one_host.allocate(name, 'vcenter', 'vcenter',
324
        rc = one_host.allocate(cluster[:cluster_name], 'vcenter', 'vcenter',
325 325
                ::OpenNebula::ClusterPool::NONE_CLUSTER_ID)
326 326

  
327 327
        if OpenNebula.is_error?(rc)
328 328
            raise "Could not allocate host: #{rc.message}"
329 329
        end
330 330

  
331
        template = "VCENTER_HOST=\"#{host}\"\n"\
332
                   "VCENTER_PASSWORD=\"#{pass}\"\n"\
333
                   "VCENTER_USER=\"#{user}\"\n"\
334
                   "VCENTER_CCR_REF=\"#{ref}\"\n"\
335
                   "VCENTER_INSTANCE_ID=\"#{vc_uuid}\"\n"\
336
                   "VCENTER_VERSION=\"#{vc_version}\"\n"\
331
        template = "VCENTER_HOST=\"#{con_ops[:host]}\"\n"\
332
                   "VCENTER_PASSWORD=\"#{con_ops[:password]}\"\n"\
333
                   "VCENTER_USER=\"#{con_ops[:user]}\"\n"\
334
                   "VCENTER_CCR_REF=\"#{cluster[:cluster_ref]}\"\n"\
335
                   "VCENTER_INSTANCE_ID=\"#{cluster[:vcenter_uuid]}\"\n"\
336
                   "VCENTER_VERSION=\"#{cluster[:vcenter_version]}\"\n"\
337 337

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

  

Also available in: Unified diff