Adding support to revert a volume to a snapshot in Infinidat driver.
This patch implements:
- revert_to_snapshot()
- snapshot_revert_use_temp_snapshot()
Implements: blueprint infinidat-add-snapshot-revert
Change-Id: I7d3e639b896604a09c4e8a9fc24ab8aff1f65622
Signed-off-by: Alexander Deiter <adeiter@infinidat.com>
As a new feature, os-brick now supports setting the location of file
locks in a different location from the locks of the service.
The functionality is intended for HCI deployments and hosts that are
running Cinder and Glance using Cinder backend. In those scenarios the
service can use a service specific location for its file locks while
only sharing the location of os-brick with the other services.
To leverage this functionality the new os-brick code is needed and
method ``os_brick.setup`` needs to be called once the service
configuration options have been loaded.
The default value of the os-brick ``lock_path`` is the one set in
``oslo_concurrency``.
This patch adds support for this new feature in a non backward
compatible way, so it requires an os-brick version bump in the
requirements.
The patch also ensures that ``tox -egenconfig`` includes the os-brick
configuration options when generating the sample config.
Change-Id: I9f3e46c262f5b2b72fed5a4927165b3834a1c383
This patch contains the implmentation of the functions used in the
operations related to volume migration. The following functions
were migrated from ZAPI to REST API:
> get_cluster_name
> get_vserver_peers
> create_vserver_peer
> start_lun_move
> get_lun_move_status
> start_lun_copy
> get_lun_copy_status
> cancel_lun_copy
> start_file_copy
> get_file_copy_status
The unit tests related to these functions were also included
in this patch.
Co-authored-by: Luisa Amaral <luisaa@netapp.com>
Co-authored-by: Nahim Alves de Souza <nahimsouza@outlook.com>
Change-Id: I16c305492bbfa3f6f25fd6e70803d47711276c0a
partially-implements: blueprint netapp-ontap-rest-api-client
This patch contains the functions used to manage volume replicas in
the NetApp driver (NFS, iSCSI and FCP). The functions were migrated
to the REST client based on the ZAPI implementation.
The following functions and its unit tests were implemented:
> get_provisioning_options_from_flexvol
> flexvol_exists
> create_flexvol
> create_volume_async
> enable_volume_dedupe_async
> enable_volume_compression_async
> get_snapmirrors
> create_snapmirror
> initialize_snapmirror
> abort_snapmirror
> delete_snapmirror
> release_snapmirror
> resync_snapmirror
> resume_snapmirror
> quiesce_snapmirror
> break_snapmirror
> update_snapmirror
> mount_flexvol
Co-authored-by: Fábio Oliveira <fabioaurelio1269@gmail.com>
Co-authored-by: Luisa Amaral <luisaa@netapp.com>
Co-authored-by: Vinícius Angiolucci Reis <angiolucci@gmail.com>
Change-Id: Ib3117c3f3891f42f0542c83407dbc424e1c5ccd8
partially-implements: blueprint netapp-ontap-rest-api-client
Lighbits volumes have a state field indicating the state of the volume
as per actions that were invoked for this
volume (create, delete, attach...).
New states were recently added to volume:
- Migrating - specifying the lightbits dynamic rebalance logic,
is currently migrating one of the replicas of this volume
within the cluster to better balance the cluster.
- Rollback - Rollback the data of the volume to a previously
created snapshot of this volume.
Migrating is identical to Avaialble with respect to most operations.
Rollback has various restriction (more similiar to Updating state)
on concurrent operations while in this state.
this patch adds handling of volume actions additional
considerations of the new states.
Signed-off-by: Yuval Brave <yuval@lightbitslabs.com>
Change-Id: Icf873eedde145de0a7e2696036bf30ed3ca36a8f
The copy offload tool is no longer available and maintained by NetApp,
so it supports is deprecated on NFS driver.
Change-Id: I20667e0d6bcb2cd5e05a18525ae94f72c0396037
This patch contains the implementation of the core functions of the
NetApp drivers (NFS, iSCSI and FCP). The functions were migrated
from ZAPI to REST API, but ZAPI client was not removed since it is
being used as a fallback mechamism when a function does not have an
equivalent in the REST API.
In summary, the features implemented in this patch are related to:
> Periodic tasks - methods used during driver initialization and
executed periodically to get information about the volumes,
performance metrics and stats
> Basic volume operations - methods used to create, delete,
attach, detach and extend volumes
Co-authored-by: Fábio Oliveira <fabioaurelio1269@gmail.com>
Co-authored-by: Fernando Ferraz <sfernand@netapp.com>
Co-authored-by: Luisa Amaral <luisaa@netapp.com>
Co-authored-by: Matheus Andrade <matheus.handrade15@gmail.com>
Co-authored-by: Vinícius Angiolucci Reis <angiolucci@gmail.com>
Change-Id: I67eb7f6264cf5eea94c0a364082b530b9cdc1ae3
partially-implements: blueprint netapp-ontap-rest-api-client
As the result of adoption of a REST API by NetApp ONTAP, some client
requests are now being gradually moved to the new format. A fallback
mechanism will be used to switch back to ZAPI if a client is using
an old version with an unsupported rest endpoint.
A new module was created to handle the REST requests, but the old
ZAPI client was not removed yet to keep the compatibility with old ONTAP
systems.
In this patch the functions needed for the NetApp driver intialization
were also added.
Co-authored-by: Fábio Oliveira <fabioaurelio1269@gmail.com>
Co-authored-by: Felipe Rodrigues <felipefuty01@gmail.com>
Co-authored-by: Fernando Ferraz <sfernand@netapp.com>
Co-authored-by: Luisa Amaral <luisaa@netapp.com>
Change-Id: I2df082fc79152ade713fea2474eefe639b43b4b8
partially-implements: blueprint netapp-ontap-rest-api-client
Fix the following deprecation warning.
* DeprecationWarning: Flags not at the start of
the expression '^tid:(?m)'
Change-Id: I04aede6aec12cf89addeb1c9d500f0c623bba1a5
Closes-Bug: 1987539
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
The cinder side change for reimaging a volume merged in yoga[1].
However, it assume the nova side change has microversion 2.91
which was correct during that time but since then many new
features have merged in nova causing the nova side microversion
to bump to 2.93 (as per current upstream change[2]).
This patch updates the nova microversion (which we use) to send
'volume-reimaged' external event to nova notifying about
completion of the operation from cinder side.
[1] d69e89ea3b
[2] https://review.opendev.org/c/openstack/nova/+/830883
Change-Id: I8fae9e2b138545e97cc60e32bbfb527c2e2072ea
Change Idc00b125b33b added the ability to store and retrieve user
message data in the request context, but it neglected to add code to
make sure they would persist across serialization and deserialization
of the request context object, as happens in the create-backup
workflow. As a result, when a user message needed to be created to
describe an error condition in the backup driver, instead we'd get an
exception raised: "TypeError: 'NoneType' object is not subscriptable".
This patch fixes the issue by making sure the message_* properties
persist across serialization/deserialization of RequestContext objects.
Closes-Bug: 1978729
Change-Id: Ibdaaf39abafbae6bfcb9fdf9fb7a55d968ad9f11
Signed-off-by: Jesper Schmitz Mouridsen <jesper@schmitz.computer>
A new microversion 3.70 adds the ability to transfer a volume's
encryption key when transferring a volume to another project.
When the volume transfer is initiated, the volume's encryption
secret is essentially transferred to the cinder service.
- The cinder service creates a new encryption_key_id that contains
a copy of the volume's encryption secret.
- The volume (and its snapshots) is updated with the new
encryption_key_id (the one owned by the cinder service).
- The volume's original encryption_key_id (owned by the volume's
owner) is deleted.
When the transfer is accepted, the secret is transferred to the
user accepting the transfer.
- A new encryption_key_id is generated on behalf of the new user
that contains a copy of the volume's encryption secret.
- The volume (and its snapshots) is updated with the new
encryption_key_id (the one owned by the user).
- The intermediate encryption_key_id owned by the cinder service
is deleted.
When a transfer is cancelled (deleted), the same process is used
to transfer ownship back to the user that cancelled the transfer.
Implements: blueprint transfer-encrypted-volume
Change-Id: I459f06504e90025c9c0b539981d3d56a2a9394c7
Test test_handle_created_vol_properties_returns_vol_update can make
other XIV unit tests fail if executed before them because it changes
a class with a Mock and doesn't restore it after the test.
This patch fixes this test.
Change-Id: I3ad9e565e4bdeca2e4b6ca76d239ba96cca0cd20
This patch fixes the Quobyte driver unit tests that forcefully replace
the 'convert_image' method in 'image_utils' with a Mock and then doesn't
restore it afterwards, so any method that runs afterwards and expects
'convert_image' to actually run code will fail.
This patch uses the proper mocking mechanisms that restore things
afterwards.
Change-Id: Iec1cf6ade1d97900d4db6e29555ddef8d45b9534
Because of how stestr processes and filters tests to run there are tests
that are not being run.
The way stestr executes tests is that a parent process first builds a
list of existing tests, then splits it equally into N lists, which are
passed into as many processes via command line (not fork) and this new
process builds the list of existing tests and then uses the list for
filtering.
The problem is that if a test name changes from when the parent builds
the list to when the child builds the list then the test will not be
run.
That is the case for tests decorated with 'ddt.data' where the data is
not a static value but is dynamically built, for example if they use
'time.time()'.
This patch fixes such unit tests in the Inspur driver, where not only
the test is not run, but if will fail if it is forcefully run with:
$ tox -epy39 -- -n cinder.tests.unit.volume.drivers.inspur.as13000.test_as13000_driver.AS13000DriverTestCase
The test in question are:
cinder.tests.unit.volume.drivers.inspur.as13000.test_as13000_driver.AS13000DriverTestCase.test__update_volume_stats_1_#####_####
cinder.tests.unit.volume.drivers.inspur.as13000.test_as13000_driver.AS13000DriverTestCase.test__update_volume_stats_2_#####_####
Change-Id: I3b434f8f4d515b688d70ef7c8ee3fc9aacdc4846
The tpool.killall method seems to block in some cases when running unit
tests, as observed with the Guru Meditation Reports. This has been
happening primarily on Python 3.9 and 3.10.
Moving the call from the test setUp to the cleanup after stopping
existing looping calls seems to resolve the issue. At least we've been
unable to reproduce the issue again even when running tests with
'--random'.
We need a way to identify existing looping calls that must be stopped,
tracking them with a decorator on the LoopingCallBase class __init__
method or looking for its instances in the objects tracked by the
Garbage Collector.
Using the GC mechanisms makes tests take 12 times longer to complete, so
this patch creates a new test utils class called InstanceTracker that
allows tracking any class.
We haven't been able to reproduce the test runner freeze situation with
this patch, even when running tests with '--random', but just in case
this happens again a TPOOL_KILLALL_ISSUE flag has been created to allow
easily disabling things if this were to happen again.
Because the tests use greenthreads, debugging blocked tests with GDB is
a nightmare, so the patch also adds the Guru Meditation Reports feature
to the test runner, that way we can do:
$ kill -USR2 <child_runner_pid>
And see the greenthreads, where in this case we would see one of them
stuck in the tpool.killall() call.
Change-Id: Idb5c428adcc1112046cc81a441c572a2e6bfa80c
This patch documents in tox.ini the change introduced by change-id
Ic9a6ac412a334710eb5e45935cd301ca80a5edb9 where we use "install_command"
to prevent installing dependencies without constraints.
We document it to prevent people from thinking that just adding the
constraints in "deps" is enough and removing the "install_command" line.
Change-Id: Iccd84cb5d4db78e4953d58a05392c61b08988d4e
Our tests don't do the eventlet monkey patching in the same way that the
Cinder services -backup, scheduler, volume- do.
This patch changes this by doing the monkey patching as soon as
possible, before cinder OVOs are loaded and bring in a number of oslo
libraries.
When copying the initialization part from the Cinder commands a fix for
'current_thread' is also copied.
Change-Id: I6c44d557466dfcb1f6507917eb88959e2ff388df
Our services don't have a 'kill' method, they have a 'stop' method, so
it doesn't make any sense to call the 'kill' method on them during test
cleanup.
This patch changes the 'kill' call with the right 'stop' call.
Change-Id: Ib1bae260b8b5289e9a6c80baf2de9e908f977d09
This patch update volume delete section in api-ref
to understand preconditions more correctly
Partial-Bug: #1918932
Change-Id: Icb5b4da3423555cd2ab0f5ee6d1dc881fc782484