Bug 1720203

Summary: 'nova list' Power State field doesn't reflect actual power state (OSP-14)
Product: Red Hat OpenStack Reporter: Tzach Shefi <tshefi>
Component: openstack-novaAssignee: OSP DFG:Compute <osp-dfg-compute>
Status: CLOSED DEFERRED QA Contact: OSP DFG:Compute <osp-dfg-compute>
Severity: medium Docs Contact:
Priority: medium    
Version: 14.0 (Rocky)CC: bfournie, bkopilov, dasmith, eglynn, jhakimra, kchamart, mbooth, mschuppe, nova-maint, rhos-maint, sbauza, sgordon, tshefi, vromanso
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1714023 Environment:
Last Closed: 2019-09-09 00:21:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1714023    
Bug Blocks:    
Attachments:
Description Flags
Nova and Ironic logs none

Comment 1 Tzach Shefi 2019-06-13 12:02:39 UTC
We cloned the bug as we hit exact same issue on osp14
versions:
python2-novaclient-11.0.0-0.20180809174649.f1005ce.el7ost.noarch
puppet-nova-13.3.2-0.20190426043939.d968cc2.el7ost.noarch
python2-ironicclient-2.5.1-0.20190204170349.931089d.el7ost.noarch
python2-ironic-inspector-client-3.3.0-0.20180810080932.53bf4e8.el7ost.noarch
puppet-ironic-13.3.2-0.20190420083535.5847f5b.el7ost.noarch




On the undercloud we had stopped the controller
(undercloud) [stack@undercloud-0 ~]$ nova stop ec89e8ed-ea29-4203-a438-dc4e2fa1fe1e
Request to stop server ec89e8ed-ea29-4203-a438-dc4e2fa1fe1e has been accepted.
(undercloud) [stack@undercloud-0 ~]$ nova list
---------------+--------------+--------+--------------+-------------+------------------------+
| ID                                   | Name         | Status | Task State   | Power State | Networks               |
+--------------------------------------+--------------+--------+--------------+-------------+------------------------+
| 14147070-f9f9-41bb-bdfc-16fa85debc36 | compute-0    | ACTIVE | -            | Running     | ctlplane=192.168.24.8  |
| ec89e8ed-ea29-4203-a438-dc4e2fa1fe1e | controller-0 | ACTIVE | powering-off | Running     | ctlplane=192.168.24.12 |
+--------------------------------------+--------------+--------+--------------+-------------+------------------------+ 

(undercloud) [stack@undercloud-0 ~]$ nova list
+--------------------------------------+--------------+---------+------------+-------------+------------------------+
| ID                                   | Name         | Status  | Task State | Power State | Networks               |
+--------------------------------------+--------------+---------+------------+-------------+------------------------+
| 14147070-f9f9-41bb-bdfc-16fa85debc36 | compute-0    | ACTIVE  | -          | Running     | ctlplane=192.168.24.8  |
| ec89e8ed-ea29-4203-a438-dc4e2fa1fe1e | controller-0 | SHUTOFF | -          | Running     | ctlplane=192.168.24.12 |
+--------------------------------------+--------------+---------+------------+-------------+------------------------+


(undercloud) [stack@undercloud-0 ~]$ openstack baremetal node list
+--------------------------------------+--------------+--------------------------------------+-------------+--------------------+-------------+
| UUID                                 | Name         | Instance UUID                        | Power State | Provisioning State | Maintenance |
+--------------------------------------+--------------+--------------------------------------+-------------+--------------------+-------------+
| 8e40ad85-7edc-4ea0-9d86-08ef6ff7f89e | compute-0    | 14147070-f9f9-41bb-bdfc-16fa85debc36 | power on    | active             | False       |
| 04d4cff7-d06f-4352-b3a1-73f65d012a4d | controller-0 | ec89e8ed-ea29-4203-a438-dc4e2fa1fe1e | power off   | active             | False       |
+--------------------------------------+--------------+--------------------------------------+-------------+--------------------+-------------+

We see both Nova and ironic show same status controller is shutdown, expected and Okay. 


However when we start that controller up (see bellow)
using virsh we see VM is up and reports status as active, yet power state wrongfully remains shutdown. 


(undercloud) [stack@undercloud-0 ~]$ nova start ec89e8ed-ea29-4203-a438-dc4e2fa1fe1e
Request to start server ec89e8ed-ea29-4203-a438-dc4e2fa1fe1e has been accepted.

(undercloud) [stack@undercloud-0 ~]$ openstack baremetal node list
+--------------------------------------+--------------+--------------------------------------+-------------+--------------------+-------------+
| UUID                                 | Name         | Instance UUID                        | Power State | Provisioning State | Maintenance |
+--------------------------------------+--------------+--------------------------------------+-------------+--------------------+-------------+
| 8e40ad85-7edc-4ea0-9d86-08ef6ff7f89e | compute-0    | 14147070-f9f9-41bb-bdfc-16fa85debc36 | power on    | active             | False       |
| 04d4cff7-d06f-4352-b3a1-73f65d012a4d | controller-0 | ec89e8ed-ea29-4203-a438-dc4e2fa1fe1e | power off   | active             | False       |
+--------------------------------------+--------------+--------------------------------------+-------------+--------------------+-------------+

(undercloud) [stack@undercloud-0 ~]$ openstack baremetal node list
+--------------------------------------+--------------+--------------------------------------+-------------+--------------------+-------------+
| UUID                                 | Name         | Instance UUID                        | Power State | Provisioning State | Maintenance |
+--------------------------------------+--------------+--------------------------------------+-------------+--------------------+-------------+
| 8e40ad85-7edc-4ea0-9d86-08ef6ff7f89e | compute-0    | 14147070-f9f9-41bb-bdfc-16fa85debc36 | power on    | active             | False       |
| 04d4cff7-d06f-4352-b3a1-73f65d012a4d | controller-0 | ec89e8ed-ea29-4203-a438-dc4e2fa1fe1e | power on    | active             | False       |
+--------------------------------------+--------------+--------------------------------------+-------------+--------------------+-------------+


(undercloud) [stack@undercloud-0 ~]$ nova list
+--------------------------------------+--------------+--------+------------+-------------+------------------------+
| ID                                   | Name         | Status | Task State | Power State | Networks               |
+--------------------------------------+--------------+--------+------------+-------------+------------------------+
| 14147070-f9f9-41bb-bdfc-16fa85debc36 | compute-0    | ACTIVE | -          | Running     | ctlplane=192.168.24.8  |
| ec89e8ed-ea29-4203-a438-dc4e2fa1fe1e | controller-0 | ACTIVE | -          | Shutdown    | ctlplane=192.168.24.12 |   -> power state should have switched to running, as on virsh console I see prompt/VM is up. 
+--------------------------------------+--------------+--------+------------+-------------+------------------------+

Comment 2 Tzach Shefi 2019-06-13 12:06:47 UTC
Created attachment 1580262 [details]
Nova and Ironic logs

Comment 4 Bob Fournier 2019-09-09 00:21:13 UTC
Note that https://bugzilla.redhat.com/show_bug.cgi?id=1714023 has been changed to an RFE and targeted for OSP-16.  Closing this one.  If the decision is made to backport RFEs to OSP-14 (not likely) then a new RFE should be cloned from Bug 1714023.