In drivers that use a cache to store the node info (presently only
ironic since [1]), the "_get_power_state" function called during
instance actions like start or stop grabs the information from the node
cache and saves it in the nova database instead of getting fresh
information from the driver. This leads to inconsistency between
the vm_state and power_state for an instance in the nova database
(which remains until a power_sync happens between nova and ironic).
This can be confusing for a user when doing "nova list" where the
power_state might still be shutdown when the vm_state has already
become active. On a default environment this inconsistency lasts
for about ten minutes which is the default value for the
sync_power_state_interval interval.
This patch changes the "use_cache" to False in the compute manager
when triggering an action on an instance like start/stop/reboot.
Reviewed: https:/ /review. opendev. org/665975 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=5b1c9dd05cc c0488e4d47bfc24 42e46adb82b765
Committed: https:/
Submitter: Zuul
Branch: master
commit 5b1c9dd05ccc048 8e4d47bfc2442e4 6adb82b765
Author: Surya Seetharaman <email address hidden>
Date: Tue Jun 18 13:59:47 2019 +0200
Grab fresh power state info from the driver
In drivers that use a cache to store the node info (presently only power_state_ interval interval.
ironic since [1]), the "_get_power_state" function called during
instance actions like start or stop grabs the information from the node
cache and saves it in the nova database instead of getting fresh
information from the driver. This leads to inconsistency between
the vm_state and power_state for an instance in the nova database
(which remains until a power_sync happens between nova and ironic).
This can be confusing for a user when doing "nova list" where the
power_state might still be shutdown when the vm_state has already
become active. On a default environment this inconsistency lasts
for about ten minutes which is the default value for the
sync_
This patch changes the "use_cache" to False in the compute manager
when triggering an action on an instance like start/stop/reboot.
[1] I907b69eb689cf6 c169a4869cfc788 9308ca419d5
Change-Id: I8bca5d84c37d02 331d2f9968a674f 3398c1a8f5b
Closes-Bug: #1832720