summaryrefslogtreecommitdiff
path: root/nova/objects
diff options
context:
space:
mode:
authorRajat Dhasmana <rajatdhasmana@gmail.com>2021-12-03 05:20:26 -0500
committerwhoami-rajat <rajatdhasmana@gmail.com>2022-08-31 16:38:37 +0530
commit30aab9c234035b49c7e2cdc940f624a63eeffc1b (patch)
treedd61d77fa9db023c8c3dad63c045119a0dd7ea70 /nova/objects
parent0bab2e5a882235bfd41d2bce86db9885fd0b81b2 (diff)
downloadnova-30aab9c234035b49c7e2cdc940f624a63eeffc1b.tar.gz
Add support for volume backed server rebuild
This patch adds the plumbing for rebuilding a volume backed instance in compute code. This functionality will be enabled in a subsequent patch which adds a new microversion and the external support for requesting it. The flow of the operation is as follows: 1) Create an empty attachment 2) Detach the volume 3) Request cinder to reimage the volume 4) Wait for cinder to notify success to nova (via external events) 5) Update and complete the attachment Related blueprint volume-backed-server-rebuild Change-Id: I0d889691de1af6875603a9f0f174590229e7be18
Diffstat (limited to 'nova/objects')
-rw-r--r--nova/objects/external_event.py6
-rw-r--r--nova/objects/service.py5
2 files changed, 9 insertions, 2 deletions
diff --git a/nova/objects/external_event.py b/nova/objects/external_event.py
index b1acfc4aa0..e17008dade 100644
--- a/nova/objects/external_event.py
+++ b/nova/objects/external_event.py
@@ -33,6 +33,9 @@ EVENT_NAMES = [
# Accelerator Request got bound, tag is ARQ uuid.
# Sent when an ARQ for an instance has been bound or failed to bind.
'accelerator-request-bound',
+
+ # re-image operation has completed from cinder side
+ 'volume-reimaged',
]
EVENT_STATUSES = ['failed', 'completed', 'in-progress']
@@ -50,7 +53,8 @@ class InstanceExternalEvent(obj_base.NovaObject):
# Version 1.2: adds volume-extended event
# Version 1.3: adds power-update event
# Version 1.4: adds accelerator-request-bound event
- VERSION = '1.4'
+ # Version 1.5: adds volume-reimaged event
+ VERSION = '1.5'
fields = {
'instance_uuid': fields.UUIDField(),
diff --git a/nova/objects/service.py b/nova/objects/service.py
index 8885120ddd..05aeb1b538 100644
--- a/nova/objects/service.py
+++ b/nova/objects/service.py
@@ -31,7 +31,7 @@ LOG = logging.getLogger(__name__)
# NOTE(danms): This is the global service version counter
-SERVICE_VERSION = 63
+SERVICE_VERSION = 64
# NOTE(danms): This is our SERVICE_VERSION history. The idea is that any
@@ -222,6 +222,9 @@ SERVICE_VERSION_HISTORY = (
# Version 63: Compute RPC v6.0:
# Add support for VDPA hotplug live migration and suspend/resume
{'compute_rpc': '6.0'},
+ # Version 64: Compute RPC v6.1:
+ # Add reimage_boot_volume parameter to rebuild_instance()
+ {'compute_rpc': '6.1'},
)
# This is used to raise an error at service startup if older than N-1 computes