Comment 3 for bug 1228804

Revision history for this message
ChangBo Guo(gcb) (glongwave) wrote : Re: Need add precheck compute service before stop/start instance

I think this bug does confusing user . If the compute service is unavailable , but user don't know about this . Because ,nova list
always return the old instance state , start/stop one instance without any exception ,just change the task_state .

@ Russel , Chris, GuoHui
I would like to get suggestion from you to move on :), and find a best fit soluton for the bug .
I just posted a patch , move the check logic into nova/compute/api.py , we can easily apply the check to other actions like pause,
This time is closer to compute driver rpc call than last patch ( in api), I tested it as follow,

[root@guochbo-10-7-0-151 /]# nova list
+--------------------------------------+-------+--------+------------+-------------+-------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+-------+--------+------------+-------------+-------------------+
| 6340fef6-5dfa-45c1-8aad-eed80d7c0217 | test1 | ACTIVE | None | Running | network1=10.0.1.3 |
| 0ff75f64-01d6-4b1f-bec8-0edfc3417b48 | test2 | ACTIVE | None | Running | network1=10.0.1.4 |
+--------------------------------------+-------+--------+------------+-------------+-------------------+
[root@guochbo-10-7-0-151 /]# service openstack-nova-compute stop
Stopping openstack-nova-compute: [ OK ]
[root@guochbo-10-7-0-151 /]# nova stop test1
ERROR: Compute service of guochbo-10-7-0-151.sce.cn.ibm.com is unavailable at this time. (HTTP 400) (Request-ID: req-a192800e-eaf6-470a-bd4a-5aacd8c5227f)

1) Is this way OK for you ? I still need more work to modify other unittest to fit the chanage , but I will hold on until I get the right direction .
2) Any suggestion about the bug ?
Thanks in advance.