Reset the instance keypair while rebuilding

Registered by LIU Yulong

Description
========
If the user lost the original private key, and without a password, the VM will not be able to login.
Because nova now has no way to reset the instance keypair, even during the rebuild procedure.
So at least `nova rebulid` will be a good approach to reset the instance key pair.
And in the foreseeable future, maybe the dynamic changing will be possible.

APIImpact
=======
Will add a key_name param to rebuild API request body.

Test
====
Both functional and unit test are needed.

A former registered bug:
https://bugs.launchpad.net/nova/+bug/1617903

Blueprint information

Status:
Complete
Approver:
Matt Riedemann
Priority:
Low
Drafter:
LIU Yulong
Direction:
Approved
Assignee:
LIU Yulong
Definition:
Approved
Series goal:
Accepted for queens
Implementation:
Implemented
Milestone target:
milestone icon queens-2
Started by
Matt Riedemann
Completed by
Matt Riedemann

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/rebuild-keypair-reset,n,z

Addressed by: https://review.openstack.org/375221 -- Merged
    Reset the instance keypair while rebuilding (spec)

Addressed by: https://review.openstack.org/379128 -- Merged
    Enable reset keypair while rebuilding instance

Approved for the Queens release. Please update the proposed change based on the final revision of the design spec. -- mriedem 20171013

The Nova API change is approved. Please remember to make the related changes for the new microversion in python-novaclient. -- mriedem 20171113

This is not considered complete until the corresponding python-novaclient change is made to the 'nova rebuild' CLI and related python API bindings. -- mriedem 20171115

The python-novaclient change is here: https://review.openstack.org/#/c/519572/ -- mriedem 20171115

[liuyulong - 2017/11/17] I think we have one more work to do is to add tempest cases for new microversion. https://review.openstack.org/#/c/375221/12/specs/queens/approved/rebuild-keypair-reset.rst@161

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.