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.
This commit is contained in:
Tino Vazquez committed 2019-10-16 19:14:40 +02:00
1 parent 2121925066
commit 19c689bc17
1 file changed
+4 -7
@@ -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