diff options
author | Dan Smith <dansmith@redhat.com> | 2022-02-24 11:03:39 -0800 |
---|---|---|
committer | whoami-rajat <rajatdhasmana@gmail.com> | 2022-08-31 18:05:03 +0530 |
commit | 45c5b80fd076d0017f957a2150d7496f6d4a4fcf (patch) | |
tree | 31e23795b09c20bff4aff8a834d556fbde749244 /nova/api/openstack/compute | |
parent | 6919db561280874d18fdf61b6750e0c765e0f632 (diff) | |
download | nova-45c5b80fd076d0017f957a2150d7496f6d4a4fcf.tar.gz |
Add API support for rebuilding BFV instances
This adds a microversion and API support for triggering a rebuild
of volume-backed instances by leveraging cinder functionality to
do so.
Implements: blueprint volume-backed-server-rebuild
Closes-Bug: #1482040
Co-Authored-By: Rajat Dhasmana <rajatdhasmana@gmail.com>
Change-Id: I211ad6b8aa7856eb94bfd40e4fdb7376a7f5c358
Diffstat (limited to 'nova/api/openstack/compute')
4 files changed, 17 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/rest_api_version_history.rst b/nova/api/openstack/compute/rest_api_version_history.rst index b65e50c62f..8f96a34e7d 100644 --- a/nova/api/openstack/compute/rest_api_version_history.rst +++ b/nova/api/openstack/compute/rest_api_version_history.rst @@ -1219,3 +1219,11 @@ Add support to pin a server to an availability zone or unpin a server from any a The ``POST /os-keypairs`` API now forbids to generate a keypair and allows new safe characters, specifically '@' and '.' (dot character). + +2.93 +---- + +Add support for volume backed server rebuild. The end user will provide the +image with the rebuild command and it will rebuild the volume with the new +image similar to the result of rebuilding an ephemeral disk. + diff --git a/nova/api/openstack/compute/schemas/server_external_events.py b/nova/api/openstack/compute/schemas/server_external_events.py index b8a89e047d..6ac3f009ec 100644 --- a/nova/api/openstack/compute/schemas/server_external_events.py +++ b/nova/api/openstack/compute/schemas/server_external_events.py @@ -63,3 +63,7 @@ name['enum'].append('power-update') create_v282 = copy.deepcopy(create_v276) name = create_v282['properties']['events']['items']['properties']['name'] name['enum'].append('accelerator-request-bound') + +create_v293 = copy.deepcopy(create_v282) +name = create_v293['properties']['events']['items']['properties']['name'] +name['enum'].append('volume-reimaged') diff --git a/nova/api/openstack/compute/server_external_events.py b/nova/api/openstack/compute/server_external_events.py index 55f17e3541..23813d5790 100644 --- a/nova/api/openstack/compute/server_external_events.py +++ b/nova/api/openstack/compute/server_external_events.py @@ -69,7 +69,8 @@ class ServerExternalEventsController(wsgi.Controller): @validation.schema(server_external_events.create, '2.0', '2.50') @validation.schema(server_external_events.create_v251, '2.51', '2.75') @validation.schema(server_external_events.create_v276, '2.76', '2.81') - @validation.schema(server_external_events.create_v282, '2.82') + @validation.schema(server_external_events.create_v282, '2.82', '2.92') + @validation.schema(server_external_events.create_v293, '2.93') def create(self, req, body): """Creates a new instance event.""" context = req.environ['nova.context'] diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index 88f5fd4f8e..6a9bf1fa92 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -1205,6 +1205,9 @@ class ServersController(wsgi.Controller): ): kwargs['hostname'] = rebuild_dict['hostname'] + if api_version_request.is_supported(req, min_version='2.93'): + kwargs['reimage_boot_volume'] = True + for request_attribute, instance_attribute in attr_map.items(): try: if request_attribute == 'name': |