mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-23 17:33:56 +03:00
Bug #3622: Do not report one-* VMs for importing
This commit is contained in:
parent
6219b85c08
commit
96d54c3fab
@ -266,10 +266,10 @@ class VIClient
|
|||||||
datacenters = get_entities(@root, 'Datacenter')
|
datacenters = get_entities(@root, 'Datacenter')
|
||||||
|
|
||||||
datacenters.each { |dc|
|
datacenters.each { |dc|
|
||||||
vms = get_entities(dc.vmFolder, 'VirtualMachine')
|
vms = get_entities(dc.vmFolder, 'VirtualMachine')
|
||||||
ccrs = get_entities(dc.hostFolder, 'ClusterComputeResource')
|
ccrs = get_entities(dc.hostFolder, 'ClusterComputeResource')
|
||||||
|
|
||||||
tmp = vms.select { |v|
|
vm_list = vms.select { |v|
|
||||||
# Get rid of VM Templates and VMs not in running state
|
# Get rid of VM Templates and VMs not in running state
|
||||||
v.config &&
|
v.config &&
|
||||||
v.config.template != true &&
|
v.config.template != true &&
|
||||||
@ -278,9 +278,13 @@ class VIClient
|
|||||||
|
|
||||||
one_tmp = []
|
one_tmp = []
|
||||||
|
|
||||||
tmp.each { |v|
|
vm_list.each { |v|
|
||||||
vi_tmp = VCenterVm.new(self, v)
|
vi_tmp = VCenterVm.new(self, v)
|
||||||
|
|
||||||
|
# Do not reimport VMs deployed by OpenNebula
|
||||||
|
# since the core will get confused with the IDs
|
||||||
|
next if vi_tmp.vm.name.match(/one-\d/)
|
||||||
|
|
||||||
container_hostname = vi_tmp.vm.runtime.host.parent.name
|
container_hostname = vi_tmp.vm.runtime.host.parent.name
|
||||||
|
|
||||||
cluster_name = ccrs.collect { |c|
|
cluster_name = ccrs.collect { |c|
|
||||||
|
Loading…
Reference in New Issue
Block a user