nova evacuation does not work in api_version > 2.14

Bug #1581336 reported by SamP
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
High
SamP

Bug Description

In current python-novaclient,
nova evacuate give the following error and does not call the evacuate api.
This bug effect on nova api_version > 2.14

+--------------------------------------+-------------------+----------------------------------------------------------------------------------------------------+
| Server UUID | Evacuate Accepted | Error Message |
+--------------------------------------+-------------------+----------------------------------------------------------------------------------------------------+
| 7101641f-7b87-4d2b-8894-3cb78b28d2dc | False | Error while evacuating instance: evacuate() got an unexpected keyword argument 'on_shared_storage' |
+--------------------------------------+-------------------+----------------------------------------------------------------------------------------------------+

How to reproduce:
 Setup 2 computer nodes and 1 controller node.
 Create a VM and shutdown the compute node with the VM.
 execute the "nova host-evacuate" via CLI
Ex:
$nova host-evacuate --target_host compute2 compute1
(with or without--on-shared-storage flag)
This will produce above error.

Note:
In nova,
patch I4217bd00d8c253db522241885dba2847a26af6df
made the on_shared_storage flag optional and,
patch I54bfa1275e188573c1b95d770d89160a86cdf52c
removes the onSharedStorage flag from the REST API.
From API micro version 2.14, no need to set onSharedStorage flag.

Changed in python-novaclient:
assignee: nobody → SamP (sampath-priyankara)
Changed in python-novaclient:
status: New → Confirmed
Revision history for this message
Rock_Zhao (36514239-3) wrote :

Hi team,
I faced the same problem.
How to get the fixed version or patch?

Thanks

Revision history for this message
melanie witt (melwitt) wrote :

Okay, so it looks like there are two evacuate commands: 'nova evacuate' and 'nova host-evacuate'. There was a patch [1] to novaclient to add support for 2.14 but it added support only to 'nova evacuate' and missed 'nova host-evacuate'. The 'nova evacuate' command evacuates a specific server, the 'nova host-evacuate' command gets a list of servers on a host and evacuates each one.

To fix it, a patch similar to [1] is needed for 'nova host-evacuate'.

To workaround, you could 'nova hypervisor-servers <host>' and then loop over each one doing 'nova evacuate <server>' until it's fixed. With the Python API [2] it would be something like client.hypervisors.search(...) and then client.servers.evacuate(...).

[1] https://review.openstack.org/#/c/261951
[2] http://docs.openstack.org/developer/python-novaclient/ref/v2/hypervisors.html

Changed in python-novaclient:
importance: Undecided → High
status: Confirmed → Triaged
Revision history for this message
SamP (sampath-priyankara) wrote :

Thank for the info and I was looked at [1] which melanie mentions above.
And thanks for the work around.
Hopefully I will be able to push the patch late today.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/320231

Changed in python-novaclient:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/320231
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=fc90f825f478ac20762c30ec2c84d538acb3ea84
Submitter: Jenkins
Branch: master

commit fc90f825f478ac20762c30ec2c84d538acb3ea84
Author: sampathP <email address hidden>
Date: Tue May 24 15:04:52 2016 +0900

    Fix nova host-evacuate for v2.14

    From API micro version 2.14, evacuate does not need onSharedStorage
    flag. This patch check the API micro version and set/ignore the
    onSharedStorage flag before call evacuate for each instance.

    Closes-Bug: #1581336
    Change-Id: I825653d66f94d36a945b8240ec52285827423375

Changed in python-novaclient:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/python-novaclient 4.1.0

This issue was fixed in the openstack/python-novaclient 4.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/332038

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (stable/mitaka)

Reviewed: https://review.openstack.org/332038
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=019d1380fa3f70b0a810bd2586be8551a837a7d6
Submitter: Jenkins
Branch: stable/mitaka

commit 019d1380fa3f70b0a810bd2586be8551a837a7d6
Author: sampathP <email address hidden>
Date: Tue May 24 15:04:52 2016 +0900

    Fix nova host-evacuate for v2.14

    From API micro version 2.14, evacuate does not need onSharedStorage
    flag. This patch check the API micro version and set/ignore the
    onSharedStorage flag before call evacuate for each instance.

    Closes-Bug: #1581336
    Change-Id: I825653d66f94d36a945b8240ec52285827423375
    (cherry picked from commit fc90f825f478ac20762c30ec2c84d538acb3ea84)

tags: added: in-stable-mitaka
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-novaclient 3.3.2

This issue was fixed in the openstack/python-novaclient 3.3.2 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.