Move task status from volume_status to a dedicated field

Registered by Niklas Schwarz

Currently the single status field of a volume holds the basic states, such as ‘available’ or ‘in-use’, but is also used by different tasks that run for the volume (‘backing-up’) - see https://opendev.org/openstack/cinder/src/commit/3e048975d0f75b983c69974945f8e5a9792c488a/cinder/objects/fields.py#L168. While this works, the ever growing list of states and reported status by the various tasks, create a huge state-machine. While this certainly defines safe state transitions, it also causes certain actions (e.g. the re-attachment during a live-migration while also allowing a concurrent backup) to block all other tasks, also those which could run simultaneously rendering all actions on a volume to be serialized.

Reducing the volume status field to hold only a reduced set of states and moving tasks and their status to a dedicated field would allow for two state machines: One for the state of the volume itself and another coordinating the tasks.

One use case can be the mentioned live-migration of a server with an attached volume. While the volume is in the potentially longer lasting state of 'backing-up', the server cannot also be migrated to a different host (see https://opendev.org/openstack/cinder/src/commit/3e048975d0f75b983c69974945f8e5a9792c488a/cinder/volume/api.py#L2112). But actually the migration/creation of a new attachment is decoupled from the backup process. First by the cinder component, but more importantly by the technical implementation of backups: a snapshot with an independent lifecycle being copied to a remote storage, with no effect or relation on the actively used volume.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Niklas Schwarz
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.