From 8c8299fc3c352ec5f1bab62b176d3744fb521acd Mon Sep 17 00:00:00 2001 From: Alejandro Huertas Herrero Date: Wed, 23 Feb 2022 12:04:52 +0100 Subject: [PATCH] B #5689: fix minor issue with vCenter monitor (#1806) (cherry picked from commit 472893e254b718e86ac361478116dc914f1887e1) --- src/im_mad/remotes/lib/vcenter_cluster.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/im_mad/remotes/lib/vcenter_cluster.rb b/src/im_mad/remotes/lib/vcenter_cluster.rb index 9c39a5c0e4..176b23dbd6 100644 --- a/src/im_mad/remotes/lib/vcenter_cluster.rb +++ b/src/im_mad/remotes/lib/vcenter_cluster.rb @@ -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']