From 19c689bc17f8ee6b050155f09e7f7cd4a9d57037 Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Wed, 16 Oct 2019 19:14:40 +0200 Subject: [PATCH] M #-: Prevent monitor flapping in vCenter It has been observed monitor state flapping for vCenter VMs. In order to avoid race conditions, the running flag is postponed, at the cost of an extra API call to vCenter. Also, unneded extraconfig was removed from the sync operation. --- .../remotes/lib/vcenter_driver/virtual_machine.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb b/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb index f79c8f8f4d..6e9448dc72 100644 --- a/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb +++ b/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb @@ -1129,15 +1129,9 @@ module VCenterDriver end end - # vnc configuration (for config_array hash) + # vnc configuration (for config_array hash) extraconfig += extraconfig_vnc - # vnc configuration (for config_array hash) - extraconfig += extraconfig_vnc - - # opennebula.running flag - extraconfig += set_running(true, false) - # device_change hash (nics) device_change += sync_nics(:all, false) @@ -2266,6 +2260,9 @@ module VCenterDriver error = e.message.split(':').first raise e.message if error != 'InvalidPowerState' end + # opennebula.running flag + extraconfig += set_running(true, true) + timeout = CONFIG[:vm_poweron_wait_default] wait_timeout(:is_powered_on?, timeout) end