Commit Graph

119 Commits

Author SHA1 Message Date
Konrad Gube 2a1a0bc3e2 Add the os-extend_volume_completion volume action
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
2024-02-16 18:14:33 +01:00
Eric Harney 349b0a1ccd mypy: Cleanup "noqa: H301" comments
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
2023-12-14 16:29:27 +00:00
Eric Harney 5179e4f6bf Use modern type annotation format for collections
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
2022-05-18 10:01:18 -04:00
Eric Harney d3afa4db00 mypy: set no_implicit_optional
The current version of PEP-484 indicates that
type checkers should not allow implicit optional
parameters.

- https://www.python.org/dev/peps/pep-0484/#union-types
- https://github.com/python/mypy/issues/9091

Change-Id: I49e5729a4d754934e861d4d0fd25fd8b2a80602e
2022-03-09 13:43:49 -05:00
Yikun Jiang d69e89ea3b Support volume re-image
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
2022-02-24 15:23:38 +05:30
Hemna e38fb71aac Rework backup process to make it async
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
2022-01-19 15:43:54 +00:00
Eric Harney b5ac2af0c2 mypy: continued manager, scheduler, rpcapi
Change-Id: I9a8d24ac27af8fe4864934d1b9bc5b66da6d2c1e
2021-08-11 08:36:09 -04:00
Eric Harney 5dea649c47 Backup manager: Synchronously call remove_export_snapshot
Similar to the fix in I482c3d552, wait for remove_export_snapshot()
to complete before returning from _detach_volume().

Related-Bug: #1920237
Change-Id: Ibf81c839fc9015051edcdb625e1018b817a9c675
2021-03-22 14:35:35 -04:00
Eric Harney d6895f9d2a Backup manager: Synchronously call remove_export
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
2021-03-22 11:04:16 -04:00
Eric Harney de789648e5 Rename volume/utils.py to volume/volume_utils.py
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
2019-09-09 15:00:07 -04:00
wanghao c0efaa1d46 Transfer snapshots with volumes
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
2018-07-19 09:42:43 +08:00
TommyLike 17798b3a47 Replace cluster object's host with service_topic_queue
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
2018-05-02 17:44:15 +08:00
wanghao 91953041c0 Use constants for cinder-volume
Since we have defined constants.VOLUME_BINARY, this patch
change some cinder volume binary strings to use constans.VOLUME_BINARY.

Change-Id: I91b1ed2331a3b197a2ba39fa5cfb02e9d161d709
2017-12-29 09:05:08 +08:00
TommyLike 8fba9a9080 Cinder volume revert to snapshot
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
2017-06-21 10:35:32 +08:00
xing-yang 18744ba199 Tiramisu: replication group support
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
2017-04-30 22:49:13 -04:00
xing-yang ea7d0860c5 Fix backup temp snapshot path on remote node
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
2017-04-22 21:01:58 -04:00
Gorka Eguileor a60a09ce5f Add service dynamic log change/query
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
2017-05-16 13:37:35 +02:00
xing-yang c979bdac87 Remove unused CG code
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
2017-03-19 00:49:10 -04:00
Jenkins 2202f73d41 Merge "Add assert_min_rpc_version decorator" 2017-01-26 08:58:57 +00:00
Karthik Prabhu Vinod 8e554059e2 Switch ManageableSnaphots & ManageableVolumes list to OVO
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
2017-01-25 00:41:30 +00:00
Michał Dulko 0b7c4cc54e Add assert_min_rpc_version decorator
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
2017-01-24 22:47:11 +01:00
John Griffith 22e6998868 Add new attachment APIS
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
2017-01-20 11:47:10 -07:00
Gorka Eguileor b4a13281ea Make Replication support Active-Active
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
2017-01-19 10:42:18 +01:00
Gorka Eguileor efa8e210c9 Allow triggering cleanup from API
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
2017-01-13 14:34:45 +01:00
Michał Dulko df647d0ccd Use oslo.messaging topics for multibackend
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
2016-12-21 09:40:01 +01:00
Gorka Eguileor 0d2dceddd0 Add more operations to cluster
This patch adds cluster support to these methods:
 - update_consistencygroup
 - update_group
 - create_cgsnapshot
 - create_group_snapshot
 - create_snapshot
 - copy_volume_to_image
 - accept_transfer
 - get_backup_device
 - secure_file_operations_enabled
 - get_manageable_volumes
 - get_manageable_snapshots

APIImpact: Now listings of manageable volumes and snapshots accept
           cluster parameter.
Specs: https://review.openstack.org/327283
Implements: blueprint cinder-volume-active-active-support
Change-Id: I5d25fd2e442c0cc077149bec6a58f5a5380365be
2016-12-20 19:20:52 +01:00
Gorka Eguileor 41bbdbc8a9 Cosmetic changes to scheduler
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
2016-12-14 17:48:53 +01:00
Gorka Eguileor 9acf079b8c Support A/A on Scheduler operations
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
2016-12-14 17:48:28 +01:00
Gorka Eguileor f91b29cd0c Support A/A in delete actions and get_capabilities
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
2016-12-07 11:09:42 +01:00
lisali 324fae75e2 Update detach_volume() with versionedobjects
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
2016-12-02 03:01:29 +00:00
lisali f0998f72b6 Update attach_volume() with versionedobjects
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
2016-12-02 02:42:15 +00:00
Gorka Eguileor aff65749b7 Support A/A in attach/detach operations
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
2016-11-25 17:01:46 +01:00
Szymon Borkowski a08aa7ad79 Convert backup_device to OVO
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
2016-11-08 16:49:53 +01:00
Szymon Wroblewski 808038053f Clean _get_cctxt method signatures
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
2016-11-08 16:28:14 +01:00
Gorka Eguileor d2ec578725 Make c-vol use workers table for cleanup
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
2016-11-03 10:17:38 +01:00
Szymon Wroblewski 10bff37595 Cleanup RCP API versioning
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
2016-10-13 04:17:37 -05:00
Michał Dulko 9a73f5999c Remove support for 2.x volume RPC API
This commit gets rid of most of our Mitaka compatibility code in
volume RPC API.

Change-Id: I5606528c8db9a725c6450d084fdcb369db60b49b
2016-10-05 11:00:16 +02:00
Michał Dulko 154404f5dd Remove dead code - replication RPC APIs
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
2016-09-28 17:10:20 +02:00
Michał Dulko 7a2adc08c7 Add volume RPC API v3.0
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
2016-09-15 15:02:01 +02:00
Michał Dulko 4f7074c156 Make sure get_backup_device result is an o.vo
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
2016-09-09 13:33:00 +02:00
xianming mao 43c44c9175 Trivial: Fix a trivial flake8 error
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
2016-09-07 20:30:22 +08:00
xing-yang 708b9be9c0 Add group snapshots - APIs
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
2016-07-19 11:27:15 -04:00
Vivek Dhayaal f6c20ed00b Removed RPC topic config options
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
2016-08-29 11:16:53 +05:30
xing-yang 8c74c74695 Add generic volume groups
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
2016-07-16 19:34:39 -04:00
Michał Dulko 294425d347 Switch request_spec in create volume calls to ovo
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
2016-08-01 18:40:48 +00:00
Szymon Wroblewski 83a1fdb5c4 Update initialize_connection to use versionedobjects
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
2016-06-20 17:38:09 -05:00
Michał Dulko 092a01f2cf Update manage_existing to use volume object
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
2016-06-10 10:42:02 +02:00
Avishay Traeger 1574ccf2d2 List manageable volumes and snapshots
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
2016-05-29 11:06:10 +03:00
Michał Dulko 3f12a1f374 Remove support for 1.x volume RPC API
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
2016-05-19 09:43:43 +02:00
Danny Al-Gaaf 1323339d33 Fix doc and source documentation errors and warning
Solve warnings and errors from build_sphinx. Fix rst doc files
and source code docstring issues.

Closes-Bug: #1557047

Change-Id: Ib59df2681c98716c786ff0edf6d7cfcc3e8fe5ec
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2016-04-14 12:30:08 +02:00