Split off the finalization part of the volume manager's
extend_volume method and make it externally callable as the new
os-extend_volume_completion admin volume action.
This is the first part of a feature that will allow volume drivers
to rely on feedback from Nova when extending attached volumes,
allowing e.g. NFS-based drivers to support online extend.
See the linked blueprint for details.
Implements: bp extend-volume-completion-action
Change-Id: I4aaa5da1ad67a948102c498483de318bd245d86b
We decided that H301 makes no sense for the "typing"
module, just set that in tox.ini instead of every
time it is used.
Change-Id: Id983fb0a9feef2311bf4b2e6fd70386ab60e974a
This works in Python 3.7 or greater and is
cleaner looking.
See PEP-585 for more info.
https://peps.python.org/pep-0585/
Change-Id: I4c9da881cea1a3638da504c4b79ca8db13851b06
This patch adds volume re-image API to enable the ability to
re-image a specific volume.
Implements: blueprint add-volume-re-image-api
Co-Authored-by: Rajat Dhasmana <rajatdhasmana@gmail.com>
Change-Id: I031aae50ee82198648f46c503bba04c6e231bbe5
This patch updates the backup process to call the volume manager
asynchronously to get the backup device in which to do the backup on.
This fixes a major issue with certain cinder drivers that take a long
time to create a temporary clone of the volume being backed up.
Closes-Bug: #1916843
Change-Id: Ib861e1bc35247f932fbae3796ed9025a560461c4
Similar to the fix in I482c3d552, wait for remove_export_snapshot()
to complete before returning from _detach_volume().
Related-Bug: #1920237
Change-Id: Ibf81c839fc9015051edcdb625e1018b817a9c675
Call the volume's rpcapi remove_export method with
a "call" instead of a "cast" when detaching volumes
in the backup manager.
This prevents _detach_volume() from returning before
the remove_export() has completed, which helps prevent
problems where remove_export() races against a
subsequent operation.
Closes-Bug: #1920237
Change-Id: I482c3d5520a7bbb9971942cdb4c4208052106d70
Much of our code renames this at import already --
just name it "volume_utils" for consistency, and
to make code that imports other modules named "utils"
less confusing.
Change-Id: I3cdf445ac9ab89b3b4c221ed2723835e09d48a53
This feature changes Cinder to transfer
snapshots with volumes at the same time by default.
If user doesn't want to transfer snapshots, they could use
a new optional argument '--no-snapshots' after microversion 3.55.
And we also introduce the new V3 api 'v3/volume_transfers'
to move this API out of contrib into Cinder V3 API.
The cinderclient patch: https://review.openstack.org/#/c/577611/
Change-Id: If848d131e5edcdb77d0b3c2ca45a99c4d5e14d1e
Implements: blueprint transfer-snps-with-vols
We have upgrade OVO's 'host' attribute by 'service_topic_queue'
when sending rpc messages to support cluster deployment, there
are some left unchanged, fix it.
TrivialFix
Change-Id: I842a15290599181d8d20eb436764764fc9f10687
Since we have defined constants.VOLUME_BINARY, this patch
change some cinder volume binary strings to use constans.VOLUME_BINARY.
Change-Id: I91b1ed2331a3b197a2ba39fa5cfb02e9d161d709
This patch implements the spec of reverting volume to
latest snapshot.
Related tempest and client patches:
[1] https://review.openstack.org/#/c/463906/
[2] https://review.openstack.org/#/c/464903/
APIImpact
DocImpact
Partial-Implements: blueprint revert-volume-to-snapshot
Change-Id: Ib20d749c2118c350b5fa0361ed1811296d518a17
This patch adds support for replication group.
It is built upon the generic volume groups.
It supports enable replication, disable replication,
failover replication, and list replication targets.
Client side patch is here:
https://review.openstack.org/#/c/352229/
To test this server side patch using the client side patch:
export OS_VOLUME_API_VERSION=3.38
Make sure the group type has group_replication_enabled or
consistent_group_replication_enabled set in group specs,
and the volume types have replication_enabled set in extra specs
(to be compatible with Cheesecake).
cinder group-type-show my_group_type
+-------------+---------------------------------------+
| Property | Value |
+-------------+---------------------------------------+
| description | None |
| group_specs | group_replication_enabled : <is> True |
| id | 66462b5c-38e5-4a1a-88d6-7a7889ffec55 |
| is_public | True |
| name | my_group_type |
+-------------+---------------------------------------+
cinder type-show my_volume_type
+---------------------------------+--------------------------------------+
| Property | Value |
+---------------------------------+--------------------------------------+
| description | None |
| extra_specs | replication_enabled : <is> True |
| id | 09c1ce01-87d5-489e-82c6-9f084107dc5c |
| is_public | True |
| name | my_volume_type |
| os-volume-type-access:is_public | True |
| qos_specs_id | None |
+---------------------------------+--------------------------------------+
Create a group:
cinder group-create --name my_group my_group_type my_volume_type
cinder group-show my_group
Enable replication group on the primary storage:
cinder group-enable-replication my_group
Expected results: replication_status becomes “enabled”.
Failover replication group to the secondary storage.
If secondary-backend-id is not specified, it will go to the
secondary-backend-id configured in cinder.conf:
cinder group-failover-replication my_group
If secondary-backend-id is specified (not “default”), it will go to
the specified backend id:
cinder group-failover-replication my_group
--secondary-backend-id <backend_id>
Expected results: replication_status becomes “failed-over”.
Run failover replication group again to fail the group back to
the primary storage:
cinder group-failover-replication my_group
--secondary-backend-id default
Expected results: replication_status becomes “enabled”.
Disable replication group:
cinder group-disable-replication my_group
Expected results: replication_status becomes “disabled”.
APIImpact
DocImpact
Implements: blueprint replication-cg
Change-Id: I4d488252bd670b3ebabbcc9f5e29e0e4e913765a
The backup using temp snapshot code path was broken
in Mitaka. The following patches fixed it on the local
node so that the fix can be backported:
https://review.openstack.org/#/c/321943/https://review.openstack.org/#/c/331835/
Continuing with the effort, this patch tries to
address the problem on the remote node so that
backup using temp snapshot code path will work
when backup and volume service are running on
different nodes.
Co-Authored-By: Accela Zhao <accelazh@gmail.com>
Closes-Bug: #1596305
Change-Id: I361458adbc1851a99a9bcffe82a02ba96a9fd460
This patch adds 2 new APIs for microversion 3.32, one to dynamically
change the log level of cinder services, and the other that allows
querying their current log levels.
DocImpact
APIImpact
Implements: blueprint dynamic-log-levels
Change-Id: Ia5ef81135044733f1dd3970a116f97457b0371de
There are CG related code in api, scheduler, and manager that are
no longer invoked in Pike. This is because we will force users to
migrate all existing CGs and CGsnapshots to the new generic volume
groups tables when they upgrade to Pike. CG CLI and API are still
supported in Pike. They will be re-directed to create/modify
entries in generic volume groups tables instead.
Database and versioned object related code are still kept for now
because there are still drivers referencing them.
Change-Id: Ieba87c6725f07564fd5a69674602eb3ca6200db3
Currently, the results from ManageableVolumes & ManageableSnapshots list
are being returned as Dict. This needs to be modeled as OVO as this
is being returned via rpc from the driver to the api layer.
We also change all occurences of List Manageable Volumes & snapshots to ovo
Change-Id: Id63e4c35deec6dccc0ae6a82b004618cd214d96e
We have multiple places in RPC APIs where we're blocking sending RPC
calls if version cap is set to value lower than our minimal version.
This commit implements this consistently by adding a reusable decorator
that can be used with RPC API methods.
Change-Id: I11c0d79c45294bd412feffd4b301359254d2e143
Replaces the original patch:
https://review.openstack.org/#/c/387712/
Use the python-cinderclient WIP:
https://review.openstack.org/#/c/387716/
Here's what you can do currently:
`cinder attachment-create <volume-uuid>`
Currently only tested/implemented the reserve piece
Will create an attachment object, set volume to a
status of 'reserved'
`cinder attachment-list`
Simple list output of attachments
`cinder attachment-show <attachment-uuid>`
Detailed list of specified attachment
`cinder attachment-delete <attachment-uuid>`
Removes an attachment
Change-Id: Ie15233c99d91de67279b56d27a5508c5ea98d769
This patch adds new methods to our failover mechanism to allow failover
to work when a backend is clustered.
Adds REST API microversion 3.26 that adds a new `failover` method
equivalent to `failover_host` but accepting `cluster` field as well as
the `host` field.
Thaw and Freeze are updated to update cluster and all services within
the cluster.
Now cluster listings accepts new filtering fields `replication_status`,
`frozen`, and `active_backend_id`.
Summary listings return `replication_status` field and detailed listings
also return `frozen` and `active_backend_id`.
Specs: https://review.openstack.org/401392
APIImpact: New service failover action and new fields in cluster listings.
Implements: blueprint cinder-volume-active-active-support
Change-Id: Id3291b28242d5814c259283fa629b48f22e70260
Now that we support having multiple c-vol services using the same
storage backend under one cluster, they no longer clean all resources
from the backend with ongoing statuses in the DB, only those from their
own host because those are failed operations that were left "in the air"
when the service was stopped. So we need a way to trigger the cleanup
of resources that were being processed by another c-vol service that
failed in the same cluster.
This patch adds a new API endpoint (/workers/cleanup) that will trigger
cleanup for c-vol services as microversion 3.19.
The cleanup will be performed by other services that share the same
cluster, so at least one of them must be up to be able to do the
cleanup.
Cleanup cannot be triggered during a cloud upgrade, but a restarted
service will still cleanup it's own resources during an upgrade.
If no arguments are provided cleanup will try to issue a clean message
for all nodes that are down, but we can restrict which nodes we want to
be cleaned using parameters `service_id`, `cluster_name`, `host`,
`binary`, and `disabled`.
Cleaning specific resources is also possible using `resource_type` and
`resource_id` parameters.
We can even force cleanup on nodes that are up with `is_up`, but that's
not recommended and should only used if you know what you are doing.
For example if you know a specific cinder-volume is down even though
it's still not being reported as down when listing the services and you
know the cluster has at least another service to do the cleanup.
API will return a dictionary with 2 lists, one with services that have
been issued a cleanup request (`cleaning` key) and another list with
services that cannot be cleaned right now because there is no
alternative service to do the cleanup in that cluster (`unavailable`
key).
Data returned for each service element in these two lists consist of the
`id`, `host`, `binary`, and `cluster_name`. These are not the services
that will be performing the cleanup, but the services that will be
cleaned up or couldn't be cleaned up.
Specs: https://specs.openstack.org/openstack/cinder-specs/specs/newton/ha-aa-cleanup.html
APIImpact: New /workers/cleanup entry
Implements: blueprint cinder-volume-active-active-support
Change-Id: If336b6569b171846954ed6eb73f5a4314c6c7e2e
We've built our multibackend support by abusing oslo.messaging's
Target.server and appending '@backend-name' prefix to the hostname.
This made implementation easier, as we're simply treating multibackends
as totally separated services.
While this worked in RabbitMQ, zmq is communicating explicitly using
hostnames, so appending anything to hostname in Target.server breaks
communication.
This commit modifies the messaging layer of cinder-volume to use
Target.topic to distinguish backends. This is done by:
* Making cinder-volume listen on new RPC server, with Target.server
set to raw hostname, and topic is set to 'cinder-volume.host@backend'.
'cinder-volume' prefix is added to keep compatibility with Newton's
services (we're relying on how RabbitMQ transport is implemented in
oslo.messaging).
* Note that old RPC server listening on 'cinder-volume' topic is left
there, as we need it to recieve fanout messages from scheduler.
* When sending a message to cinder-volume, we're sending it using
Target.topic to route it to correct host and backend. For backward
compatibility it's controlled by conditional based on RPC version pin.
Closes-Bug: 1630975
Related-Bug: 1440631
Implements: cinder-zeromq-support
Change-Id: I22efbeb97e11838139e2b33226d1c10094d27c1d
Now that we have clustered services it is no longer correct to refer to
"hosts" in the scheduler, as we may be referring to a cluster sometimes.
This patch changes those cases where "host" is no longer appropriate
(ie: `find_retype_host`) and uses the more generic name "backend" (ie:
`find_retype_backend`).
Specs: https://review.openstack.org/327283
Implements: blueprint cinder-volume-active-active-support
Change-Id: I6edbdaf5f38841c7e801b5f3fc0cab3e8ef44a20
This patch allows scheduler to work with clustered hosts to support A/A
operations.
Reporting capabilities of clustered hosts will be grouped by the
cluster_name instead of the host, and non clustered hosts will still be
stored by host.
To avoid replacing a newer capability report with an older version we
timestamp capabilities on the volumes (it's backward compatible) and
only replace currently stored values in scheduler when they are newer.
Following actions now support A/A operation:
- manage_existing
- manage_existing_snapshot
- get_pools
- create_volume
- retype
- migrate_volume_to_host
- create_consistencygroup
- create_group
- update_service_capabilities
- extend_volume
And Affinity and Driver filters have been updated.
The new functionality to notify service capabilities has not been
changed to Active/Active and will be done in another patch.
APIImpact: Added microversion 3.16
Specs: https://review.openstack.org/327283
Implements: blueprint cinder-volume-active-active-support
Change-Id: I611e75500f3d5281188c5aae287c62e5810e6b72
This patch allows deleting operations and getting capabilities in HA
Active-Active configurations.
To allow this we have to use the cluster topic queue in the Message
Broker, so following RPC methods in cinder/volume/rpcapi have been
changed:
- delete_volume
- delete_snapshot
- delete_consistencygroup
- delete_cgsnapshot
- delete_group
- delete_group_snapshot
When the cluster field is not set all RPC calls will behave as before,
sending it to the host topic queue.
Change-Id: I8bcf26afec7f2c54f281dc1ac771825b1c1625ad
Specs: https://review.openstack.org/327283
Implements: blueprint cinder-volume-active-active-support
The following patch updates detach_volume
API to use volume versionedobjects. Changes were
made to be backwards compatible with older RPC clients.
It only includes changes to the core cinder code.
Changes in the drivers are left to each driver
maintainer to update.
We want to update both the attach_volume()
and detach_volume() with versionedobjects.
There are 3 patches in the chain.
The patch sequence is:
- Update attach_volume() with versionedojbects
- Update detach_volume() with versionedobjects
- Update test cases related to attach_volume
and detach_volume in file
cinder/tests/unit/test_volume.py
Co-Authored-By: Thang Pham <thang.g.pham@gmail.com>
Co-Authored-By: lisali <xiaoyan.li@intel.com>
Partial-Implements: blueprint cinder-objects
Change-Id: Ib153342b20f5b3e74d2815cb422b411f5690443f
We want to update both the attach_volume API and
detach_volume API to use volume versionedobjects.
There are three patches for it in the chain.
- Update attach_volume() with versionedobjects
- Update detach_volume() with versionedobjects
- Update test cases related to attach_volume()
and detach_volume() in file
cinder/tests/unit/test_volume.py
This patch updates attach_volume API to use
volume versionedobjects. Changes were made to
be backwards compatible with older RPC clients.
It only includes changes to the core cinder code.
Changes in the drivers are left to each driver
maintainer to update.
Co-Authored-By: Thang Pham <thang.g.pham@gmail.com>
Co-Authored-By: lisali <xiaoyan.li@intel.com>
Partial-Implements: blueprint cinder-objects
Change-Id: I0ef693a9c3d72349563e7199aa27a0724f98a774
This patch allows attaching and detaching volumes in HA Active-Active
configurations.
To allow the attach and detach of volumes in Cinder using the cluster
topic queue in the Message Broker following RPC methods in
cinder/volume/rpcapi has been changed:
- attach_volume
- detach_volume
- initialize_connection
- terminate_connection
- remove_export
When the cluster field is not set for a volume all RPC calls will behave
as before, sending it to the host topic queue.
Specs: https://review.openstack.org/327283
Implements: blueprint cinder-volume-active-active-support
Change-Id: I6ec689ea8abb10832a47b20f82bf2e710c62deae
This commit introduces BackupDevice object to formalize data earlier
sent over RPC as an undefined dict. This is required to be able to make
non-backward compatible changes to data sent as this parameter while
maintaining compatibility with previous release - so to support rolling
upgrades.
Change-Id: Ie57d84e32ec1c5fcfac27a7bb6d4bbb189108a5b
Partial-Implements: blueprint cinder-objects
rpc.RPCAPI._get_cctxt method had unnecessary host argument.
volume.rpcapi.VolumeAPI._get_cctxt allowed to pass version
only by named attribute.
Change-Id: I105120661bb9043a351888463f35f7c8a6e08621
To be able to support multiple hosts working with the same resources we
have added the workers table to keep track of which host is working with
each specific resource.
This patch makes c-vol service work with this new table by adding
entries on cleanable operations and removing them once these operations
have completed.
Service cleanup on initialization has also been changed to use this new
table so hosts will cleanup only resources from operations they left on
the air and leave any operations that are being processed by other
hosts.
Specs: https://review.openstack.org/236977
Implements: blueprint cinder-volume-active-active-support
Change-Id: I4e5440b8450558add372214fd1a0373ab4ad2434
Moves version checks into method preparing message context.
Provides default versions for context preparation to avoid repetitive
task of updating it in every method after introduction of new version.
Change-Id: I761e98ae46b7d1140f30b883a617a75b4af3fe0a
The REST APIs for promote_replica and reenable_replication were removed
in If862bcd18515098639f94a8294a8e44e1358c52a with implementation of
replication V2.1. Some code was left behind and now can be considered
dead. This commit removes it.
This should be safe from upgradeability point of view as we've deleted
the APIs back in Mitaka and we're supporting backward compatibility with
only one previous release.
Changes in the drivers are left for the driver maintainers.
Change-Id: Ia7dfcaa7601176ecb3a4b19bb59f6d9329e62635
Closes-Bug: 1620001
This patch creates volume RPC API version 3.0, while retaining
compatibility in rpcapi and manager for 2.x, allowing for continuous
deployment scenarios.
This should be merged just before the Newton release.
Change-Id: Ib927ccb3bb1f91e441f5b8540a3e39acefa4a6ab
In c-bak we're assuming we'll get a Snapshot or Volume o.vo from c-vol's
get_backup_device. This isn't true when we're running Mitaka's c-vol in
our environement. As we should be compatible with services in Mitaka
this commit adds a check to volume.rpcapi to make sure that if we'll
receive a dictionary, we're converting it to o.vo.
Change-Id: Ifab88181d78481e79bc913f90b3dd1be2cbf7400
Closes-Bug: 1621836
There is a flake8 error in rpcapi.py,so this patch fixes it:
"D200 One-line docstring should fit on one line with quotes"
Change-Id: If1d161d9a66ef0ebb49cf024a1d1ad816b01f34c
This is the fifth patch that implements the generic-volume-group
bluerpint. It adds APIs for group snapshots and create group
from source.
This patch depends on the fourth patch which implements group
snapshots support in the volume manager:
https://review.openstack.org/#/c/361376/
Client side patch is here:
https://review.openstack.org/#/c/329770/
Current microversion is 3.14. The following CLI's are supported:
cinder --os-volume-api-version 3.14 group-create-from-src
--name my_group --group-snapshot <group snapshot uuid>
cinder --os-volume-api-version 3.14 group-create-from-src
--name my_group --source-group <source group uuid>
cinder --os-volume-api-version 3.14 group-snapshot-create
--name <name> <group uuid>
cinder --os-volume-api-version 3.14 group-snapshot-list
cinder --os-volume-api-version 3.14 group-snapshot-show
<group snapshot uuid>
cinder --os-volume-api-version 3.14 group-snapshot-delete
<group snapshot uuid>
APIImpact
DocImpact
Partial-Implements: blueprint generic-volume-group
Change-Id: I2e628968afcf058113e1f1aeb851570c7f0f3a08
Cinder had config options to customize the RPC topics on which the
scheduler, volume and backup nodes listen. But this feature has been
dysfunctional for quite a long time. This commit removed this feature.
For more details: Refer the bug comments.
DocImpact
Change-Id: Ie76f070fe9a1222c209e8defd0d04fa7a7931b14
Closes-Bug: #1301888
This is the second patch that implements the generic-volume-group
bluerpint. It adds the groups table and introduces create/delete/
update/list/show APIs for groups.
It depends on the first patch which adds group types and group specs:
https://review.openstack.org/#/c/320165/
Client side patch is here:
https://review.openstack.org/#/c/322627/
Current microversion is 3.13. The following CLI's are supported:
cinder --os-volume-api-version 3.13 group-create --name my_group
<group type uuid> <volume type uuid>
cinder --os-volume-api-version 3.13 group-list
cinder --os-volume-api-version 3.13 create --group-id <group uuid>
--volume-type <volume type uuid> <size>
cinder --os-volume-api-version 3.13 group-update <group uuid>
--name new_name description new_description
--add-volumes <uuid of volume to add>
--remove-volumes <uuid of volume to remove>
cinder --os-volume-api-version 3.13 group-show <group uuid>
cinder --os-volume-api-version 3.13 group-delete
--delete-volumes <group uuid>
APIImpact
DocImpact
Change-Id: I35157439071786872bc9976741c4ef75698f7cb7
Partial-Implements: blueprint generic-volume-group
To be able to make changes in request_spec passed in create_volume calls
(in c-sch and c-vol RPC API) while supporting rolling upgrades we need
to convert it from arbitrary dict blob to a well-defined versioned
object. This commit does so while maintaining backwards compatibility
with Mitaka. When version is pinned to Mitaka we're serializing the
dict before sending and when receiving a dict we're converting it to the
object.
We actually have a lot of duplicated/unused data sent using request_spec
and filter_properties. We should start to clean that up.
The future patches should:
* Convert filter_properties to ovo.
* Make services use only one occurrence of the data.
* Remove the unused duplicates while maintaining backwards compatibility
through object translations.
Change-Id: I7dae83667a1aca92c552fbfaa1e90c6558e293bf
Partial-Implements: blueprint cinder-objects
The following patch updates initialize_connection
API to use volume versionedobjects. Changes were
made to be backwards compatible with older RPC clients.
It only includes changes to the core cinder code.
Changes in the drivers are left to each driver
maintainer to update.
Note that this patch DOES NOT try to use object dot
notation everywhere, since it would increase the
size of the patch. Instead, it will be done in
subsequent patches.
Co-Authored-By: Thang Pham <thang.g.pham@gmail.com>
Change-Id: Ib45cf5934b09fb2de9c228160bbad39c8a896e26
Partial-Implements: blueprint cinder-objects
The following patch updates manage_existing APIs to use volume versioned
objects. Changes were made to be backward compatible with older RPC
clients. Changes in the drivers are left to each driver maintainer to
update.
Note that this patch DOES NOT try to use object dot notation everywhere
to keep the size small. This cleanup will be done in the future.
Change-Id: Ie806336ad95834b091c5942d7dfa13345006c1c8
Partial-Implements: blueprint cinder-objects
Cinder currently has the ability to take over the management of
existing volumes and snapshots ("manage existing") and to relinquish
management of volumes and snapshots ("unmanage"). The API to manage an
existing volume takes a reference, which is a driver-specific string
that is used to identify the volume on the storage backend. This
patch adds APIs for listing volumes and snapshots available for
management to make this flow more user-friendly.
DocImpact
APIImpact
Change-Id: Iff19b5002e5bc037e28c91d104853f40eb4cb6ab
Implements: blueprint list-manage-existing
This commit gets rid of most of our Liberty compatibility code in volume
RPC API.
Some shims in volume.manager need to stay through Newton, as I've missed
the opportunity to reorganize arguments in RPC methods when introducing
VolumeV1Proxy. It's a shame, but only thing I can do safely now is to
update TODO comments there.
Co-Authored-By: Szymon Borkowski <szymon.borkowski@intel.com>
Change-Id: Iae5b664ff008876a23eb8ea1df52ce8f8347a37b