Module: HostExt::Proxmox::Associator::Overrides

Defined in:
app/models/concerns/host_ext/proxmox/associator.rb

Instance Method Summary collapse

Instance Method Details

#associate!(cr, vm) ⇒ Object



28
29
30
31
32
# File 'app/models/concerns/host_ext/proxmox/associator.rb', line 28

def associate!(cr, vm)
  self.uuid = proxmox_vm_id(cr, vm)
  self.compute_resource_id = cr.id
  save!(:validate => false) # don't want to trigger callbacks
end

#proxmox_vm_id(compute_resource, vm) ⇒ Object



34
35
36
37
38
# File 'app/models/concerns/host_ext/proxmox/associator.rb', line 34

def proxmox_vm_id(compute_resource, vm)
  id = vm.identity
  id = vm.unique_cluster_identity(compute_resource) if compute_resource.instance_of?(ForemanFogProxmox::Proxmox)
  id
end