1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

B #5689: fix minor issue with vCenter monitor (#1806)

(cherry picked from commit 472893e254b718e86ac361478116dc914f1887e1)
This commit is contained in:
Alejandro Huertas Herrero 2022-02-23 12:04:52 +01:00 committed by Tino Vazquez
parent 4a6fbadf69
commit 8c8299fc3c
No known key found for this signature in database
GPG Key ID: 14201E424D02047E

View File

@ -259,7 +259,13 @@ class Cluster
vms = {}
vms_hash.each do |vm_ref, info|
one_id = -1
ids = vmpool.retrieve_xmlelements("/VM_POOL/VM[DEPLOY_ID = '#{vm_ref}']")
# Add OR to retrieve VMs that are using old deploy ID
ids = vmpool.retrieve_xmlelements(
"/VM_POOL/VM[(DEPLOY_ID = '#{vm_ref}')" \
' or ' \
"(DEPLOY_ID = '#{vm_ref.split('_')[0]}')]"
)
ids.select do |vm|
hid = vm['HISTORY_RECORDS/HISTORY/HID']