As discussed at our nova meetings, reorganize the juno specs into three directories: - proposed: things proposed which weren't approved - approved: things we approved but didn't implement - implemented: things approved and implemented The first I suspect is the most controversial. I've done this because I worry about the case where a future developer wants to pick up something dropped by a previous developer, but has trouble finding previous proposed specifications on the topic. Note that the actual proposed specs for Juno are adding in a later commit. Change-Id: Idcf55ca37a83d7098dcb7c2971240c4e8fd23dc8
4.5 KiB
API: Evacuate instance to a scheduled host
https://blueprints.launchpad.net/nova/+spec/find-host-and-evacuate-instance
The aim of this feature is to let operators evacuate instances without selecting a target host manually. The scheduler will select the best target instead.
Problem description
In the event of a unrecoverable hardware failure (compute-node down), Operators need to evacuate the instances by selecting a target compute host.
This may work for temporary pre-selected failover-hosts, but if they just want to evacuate/rebuild the instance without taking further action, Operators must check each instance/flavor metadata and select target hosts that match the specs individually for each evacuation.
In case of using external tools to trigger the evacuation, logic about the compute-hosts has to be there to appropriately call the API.
It also make it consistent with migrate and live-migrate operations.
Proposed change
Modify the current rebuild_instance flow to let the scheduler pick up the best target host for the instance being evacuate.
Alternatives
Something external to pick up the proper host when nova can already do it.
Data model impact
None
REST API impact
The current evacuate API v2/v3 will be modified to accept body data without target host field and this change will be advertised through a new extension ExtendedEvacuateFindHost in case of v2. If the field is present but empty old behavior will be applied to be able to determine if it's an missing due to input error or not.
- Evacuate an instance to another compute-host.
-
POST
Normal Response Code: 200
- Expected error http response code(s)
-
- 404: Compute host (if provided)/instance not found
- 400: Compute service in use
- 409: Invalid instance state
v2|v3/servers/id/action
Schema definition for V3:
evacuate = { 'type': 'object', 'properties': { 'evacuate': { 'type': 'object', 'properties': { 'on_shared_storage': parameter_types.boolean, 'admin_password': parameter_types.admin_password, }, 'required': ['on_shared_storage'] 'additionalProperties': False, }, }, 'required': ['evacuate'], 'additionalProperties': False, }Sample request:
{ "evacuate": { "adminPass": "%(adminPass)s", "onSharedStorage": "%(onSharedStorage)s" }}Sample Response:
{ "adminPass": "%(password)s" }}
Security impact
None
Notifications impact
None
Other end user impact
python-novaclient will be modified to have target_host argument as optional.
The user can trigger this feature by: nova evacuate my_server
Performance Impact
None
Other deployer impact
None
Developer impact
None
Implementation
Assignee(s)
- Primary assignee:
-
leandro-i-constantino
- Other contributors:
-
juan-m-olle
Work Items
- Move rebuild instance to conductor task to unify rebuild/evacuate logic
- Add logic to select target host
- Add APIv2/v3
- Set target-host optional on nova-client
- Allow evacuating instances in an 'affinity' group, allowing the scheduler to pick the destination
Dependencies
For a complete use-case the following bp will be required https://blueprints.launchpad.net/nova/+spec/validate-targethost-live-migration, since we can retrieve the original scheduler hints from that a particular instance and let the scheduler select the best host based on that. Until then, instances launched without any scheduler hint could still be selected by the scheduler by using flavor specs.
Testing
Tempest do not currently support multi-node tests, so it will be added after CI can run those kind of tests.
Documentation Impact
- Api Docs to reflect that host field is now optional. If not present in the body the new feature will be triggered.
- Client docs ( due to optional arg)
- Admin User Guide on evacuation topic.
References
None