Commit Graph

610 Commits

Author SHA1 Message Date
Or Ozeri
9892ead7fc librbd/crypto: allow loading luks format without specifying version
This commits extends rbd API's to allow the user to load encryption
using either LUKS1 or LUKS2 formats, without explicitly specifying which.
Prior, the user had to specify explicitly LUKS1 or LUKS2.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
2022-08-04 10:36:07 +03:00
Or Ozeri
40f6f5224b qa/workunits/rbd: fix issues in luks-encryption.sh
This commit fixes 2 issues in luks-encryption.sh:
1. Fix sporadic comparison failures due to stale data read from kernel buffer cache.
2. Fix test skipping condition (when journaling is enabled)

Additionally, sudo is removed from most commands.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
2022-08-04 10:36:07 +03:00
Ilya Dryomov
b2137e2058 rbd: don't default empty pool name unless namespace is specified
Commit 96f05a7956 ("rbd: delay determination of default pool name")
broke "rbd perf image iostat" and "rbd perf image iotop" GLOBAL_POOL_KEY
support (the ability to blend all rbd pools together into a single
view).

Fixes: https://tracker.ceph.com/issues/56561
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-07-16 10:04:02 +02:00
Ilya Dryomov
7fb4fdbed0 mgr/rbd_support: always rescan image mirror snapshots on refresh
Establishing a watch on rbd_mirroring object and skipping rescanning
image mirror snapshots on periodic refresh unless rbd_mirroring object
gets notified in the interim is flawed.  rbd_mirroring object is
notified when mirroring is enabled or disabled on some image (including
when the image is removed), but it is not notified when images are
promoted or demoted.  However, load_pool_images() discards images that
are not primary at the time of the scan.  If the image is promoted
later, no snapshots are created even if the schedule is in place.  This
happens regardless of whether the schedule is added before or after the
promotion.

This effectively reverts commit 69259c8d37 ("mgr/rbd_support: make
mirror_snapshot_schedule rescan only updated pools").  An alternative
fix could be to stop discarding non-primary images (i.e. drop

    if not info['primary']:
        continue

check added in commit d39eb283c5 ("mgr/rbd_support: mirror snapshot
schedule should skip non-primary images")), but that would clutter the
queue and therefore "rbd mirror snapshot schedule status" output with
bogus entries.  Performing a rescan roughly every 60 seconds should be
manageable: currently it amounts to a single mirror_image_status_list
request, followed by mirror_image_get, get_snapcontext and snapshot_get
requests for each snapshot-based mirroring enabled image and concluded
by a single dir_list request.  Among these, per-image get_snapcontext
and snapshot_get requests are necessary for determining primaryness.

Fixes: https://tracker.ceph.com/issues/53914
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-06-21 12:46:49 +02:00
Ilya Dryomov
90a90ad47d qa/workunits/rbd/cli_generic.sh: relax trash purge schedule status assert
Commit 08df6e0fd0 ("qa/workunits/rbd: expand LevelSpec parsing
coverage") didn't account for images with a separate data pool.  This
was missed because of small-cache-pool.yaml breakage.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-03-19 14:54:00 +01:00
Ilya Dryomov
08df6e0fd0 qa/workunits/rbd: expand LevelSpec parsing coverage
Invoke "rbd mirror snapshot schedule ls -R" and "rbd mirror snapshot
schedule status" commands on all levels, consistently.  In particular,
make sure that an image level schedule is listed for a recursive query
at the pool level both before and after the schedule kicks in:

  $ rbd create --size 1G --mirror-image-mode snapshot -p foo bar
  $ rbd mirror snapshot schedule add -p foo --image bar 1m
  $ rbd mirror snapshot schedule ls -p foo -R
  POOL  NAMESPACE  IMAGE  SCHEDULE
  foo              bar    every 1m
  <wait for schedule to become visible in status>
  $ rbd mirror snapshot schedule ls -p foo -R
  POOL  NAMESPACE  IMAGE  SCHEDULE
  foo              bar    every 1m

Also, make sure that pool and image level status queries work:

  $ rbd mirror snapshot schedule status -p foo
  SCHEDULE TIME        IMAGE
  2022-03-04 07:14:00  foo/bar
  $ rbd mirror snapshot schedule status -p foo --image bar
  SCHEDULE TIME        IMAGE
  2022-03-04 07:14:00  foo/bar

Both of these issues are fixed by the previous commit.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-03-05 11:20:33 +01:00
Ilya Dryomov
bad21fa497
Merge pull request #44842 from idryomov/wip-krbd-rxbounce-option
rbd: recognize rxbounce map option

Reviewed-by: Deepika Upadhyay <dupadhya@redhat.com>
2022-02-06 20:37:31 +01:00
Ilya Dryomov
512f8da720
Merge pull request #43910 from sunnyku/wip-rbd-snap-sched
mgr/rbd_support: fix schedule remove

Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2022-02-06 20:32:09 +01:00
Ilya Dryomov
95d30b534e qa: krbd rxbounce test
Lives in its own directory since ms_mode doesn't need to be permuted
here.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-02-04 19:04:37 +01:00
Sunny Kumar
a9312d4777 qa/workunits/rbd: improve schedule add/remove cli test
This patch adds few tests to cover schedule add/remove with invalid
inputs.

Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
2022-02-04 16:16:03 +00:00
Ilya Dryomov
a5eef01e92 mgr/rbd_support: level_spec is optional for schedule list/status
Commit fea6fdff4c ("mgr/rbd_support: level_spec passed to some
commands is not optional") is wrong.  While it is true that a valid
level_spec is needed to create a LevelSpec instance, an empty string
is very much a valid level spec -- it signifies "all levels".

This wasn't caught because within Ceph these commands are wrapped by
rbd CLI which injects an empty string in get_level_spec_args().

Fixes: https://tracker.ceph.com/issues/54058
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-01-30 14:22:35 +01:00
Prasanna Kumar Kalever
2adfe55bcc qa/workunits/rbd: test map/attach with --show-cookie/--cookie options
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2021-10-26 19:24:13 +05:30
Mykola Golub
8c646721c2
Merge pull request #41696 from MrFreezeex/fix-rbd-mirror-remove
rbd-mirror: fix mirror image removal

Reviewed-by: Mykola Golub <mgolub@suse.com>
2021-10-25 18:12:38 +03:00
Ilya Dryomov
366e9c51a8 qa/suites/rbd: test case for one-way snapshot-based mirroring
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2021-09-24 12:30:14 +02:00
Ken Dreyer
65f4d6eb36 workunits/rbd: remove lsb_release
The lsb_release utility brings in a lot of other dependencies. Remove
it from the RBD workunit script.

Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
2021-08-18 13:08:24 -04:00
Arthur Outhenin-Chalandre
e135403c73
rbd-mirror: add image_map cleanup in LoadRequest
In the LoadRequest in the ImageMap class add initial cleanup to remove
stale entries. To cleanup the LoadRequest will query the mirror image
list and remove all the image_map that are notin the list.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
2021-08-18 18:52:37 +02:00
Arthur Outhenin-Chalandre
4db66da512
qa/rbd-mirror: add OMAP cleanup checks
This make sure that all images are deleted in the existing qa scripts
and checks if all rbd-mirror metadata in OMAP are correctly deleted.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
2021-08-18 18:50:44 +02:00
Ilya Dryomov
df96b85b58 qa/workunits/rbd: use xenial version of qemu-iotests for centos stream 8
It is already used for centos 8(.3) and rhel 8(.4).

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2021-08-03 09:44:18 +02:00
Prasanna Kumar Kalever
2fa7f90d42 qa/workunits/rbd-nbd: add notrim test
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2021-06-30 13:09:24 +05:30
Ilya Dryomov
bb92c4ff83
Merge pull request #41588 from idryomov/wip-rbd-trash-purge
librbd: don't stop at the first unremovable image when purging 

Reviewed-by: Mykola Golub <mgolub@suse.com>
2021-06-01 21:56:57 +02:00
Ilya Dryomov
16d9a68a3e librbd: don't stop at the first unremovable image when purging
As there is no inherent ordering, there may be multiple removable
images past the unremovable image.  On top of that, removing a clone
may make its parent removable so perform an additional pass if any
image gets removed.

Fixes: https://tracker.ceph.com/issues/51021
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2021-05-31 11:44:47 +02:00
Prasanna Kumar Kalever
e2aa4128f1 qa/workunits/rbd: use rbd cli for device attach/detach commands
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
2021-05-26 10:27:09 +05:30
Ilya Dryomov
338920fcf6
Merge pull request #41070 from sunnyku/wip-rbd-50522
rbd: fix default pool handling for nbd map/unmap

Reviewed-by: Mykola Golub <mgolub@suse.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
2021-05-20 16:41:22 +02:00
Sunny Kumar
b19905272a qa/workunits/rbd-nbd: add new test for map/unmap
This patch includes twe new test cases:
 a. map/unmap test with only image name and
 b. map/unmap test after changing default pool which expects the image
 to come from new default pool.

Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
2021-05-18 16:23:10 +01:00
Sunny Kumar
4f6370b884 qa/workunits/rbd: use rbd device wrapper where appropriate
Use `rbd device` wrapper call instead of making a direct call to rbd-nbd.

Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
2021-05-14 12:38:25 +01:00
Ilya Dryomov
602db5e386 qa/workunits/rbd: disable qemu-iotest test 055 globally
It doesn't work on Focal and already disabled on CentOS 7 and 8.  More
importantly, it doesn't actually test rbd -- it always tests "file", no
matter which protocol is specified in IMGPROTO.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2021-05-02 23:38:56 +02:00
Ilya Dryomov
2de2146c30 qa/workunits/rbd: use bionic version of qemu-iotests for focal
Currently Focal ends up with v2.2.0-rc3, which results in "WARNING:
Image format was not specified for ..." for all tests and all tests
fail.

Fixes: https://tracker.ceph.com/issues/50605
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2021-05-02 23:38:43 +02:00
Jason Dillaman
bc0b9f52ad librbd: permit disabling QCOW migration format support
Downstream Red Hat products do not support the older QCOW format. This
will allow the support for the legacy QCOW format to be disabled for the
new RBD import-only migration support.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2021-02-23 07:19:43 -05:00
Mykola Golub
f737c2855a qa/workunits/rbd: make luks-encryption test work on vstart cluster
When running as non-root, it might not find the `rbd` binary.

Signed-off-by: Mykola Golub <mgolub@suse.com>
2021-02-15 15:03:00 +00:00
Jason Dillaman
f079116e87 qa/workunits/rbd: show snapshot deltas during stress test failure
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2021-02-08 10:13:35 -05:00
Jason Dillaman
094bfeaf8e qa/suites/rbd: add snapshot-based mirroring stress test
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2021-02-08 09:23:35 -05:00
Jason Dillaman
8643b046fb test/rbd-mirror: fix broken ceph_test_rbd_mirror_random_write
It appears that commit 6eb8f30a23 broke the test utility and
its failure was masked by the test case that expected a failure
due to a timeout force-killing the app.

Fixes: https://tracker.ceph.com/issues/49117
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2021-02-02 23:34:18 -05:00
Or Ozeri
2f1eb8eba0 test/librbd: fix luks encryption cli test on unsupported runs
This commit changes the luks encryption cli test to return success instead of failure when not supported.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
2021-01-26 18:54:05 +02:00
Or Ozeri
4f438f0dc3 test/librbd: add luks encryption cli test
This commit adds a cli test for rbd encryption verifying LUKS compatbility with cryptsetup

Signed-off-by: Or Ozeri <oro@il.ibm.com>
2021-01-24 09:11:50 +02:00
Jason Dillaman
42f00487b9 qa/workunits/rbd: simplify QCOW migration distro check
If the qemu-img command fails when attempting to use the QCOW (v1) format,
assume that the distro does not have support for the format enabled.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2021-01-14 11:52:05 -05:00
Jason Dillaman
f3c44b083a librbd/migration: compute deltas between QCOW2 snapshots
Utilize the COPIED bit within the cluster offset to quickly determine
if the corresponding cluster block has been copied.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2021-01-14 09:35:35 -05:00
Jason Dillaman
1f4b5aeb0e librbd/migration: add support for reading from QCOW2 snapshots
Tweak the IO read path to now utilize the L1 table associated with
the specified snapshot id. This will cause the IO to properly read
from the specific snapshot.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2021-01-14 09:35:35 -05:00
Jason Dillaman
bd8db295ea librbd/migration: basic QCOW2 format handler
The initial implementation does not support backing files, compression,
snapshots, (deprecated) encryption, external data files, nor L2 subcluster
allocation. The former three features will be added in a future commit.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2021-01-14 09:35:35 -05:00
Jason Dillaman
83aa1a9e73 librbd/migration: basic QCOW v1 format handler
The initial implementation does not support backing files, compression, nor
(deprecated) encryption. The former two features will be added in a future commit.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2021-01-14 09:35:34 -05:00
Jason Dillaman
d22ca3d978 librbd/migration: require snapshot when importing from native source
Since we cannot mark the source image read-only when running in import-only
migration mode, we should require the user to provide a snapshot to ensure
that data cannot change while the migration is running.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2021-01-02 09:26:53 -05:00
Ilya Dryomov
fb03fa3766
Merge pull request #38638 from idryomov/wip-krbd-stable-writes-attr
qa: krbd_stable_pages_required.sh: move to stable_writes attribute

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
2020-12-18 10:30:34 +01:00
Ilya Dryomov
5adfc15b87 qa: krbd_stable_pages_required.sh: move to stable_writes attribute
bdi/stable_pages_required attribute was deprecated in 5.10 and now
always returns 0.  The replacement is queue/stable_writes.  (It is
also writeable, so we can simplify these test cases somewhat in the
future.)

Fixes: https://tracker.ceph.com/issues/48232
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-12-17 13:41:34 +01:00
Jason Dillaman
80fe5a8735 qa/suites/rbd: new basic migration CLI test case
Pending a larger suite of tests for instant-restore image migration,
this test provides a basic sanity check for both the native and
raw image formats -- including basic snapshot tests.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2020-12-03 08:30:52 -05:00
Mykola Golub
9c9b14fab6 qa/workunits/rbd: improve regex for parsing ps output
On some platforms the pid may be indented with spaces.

Signed-off-by: Mykola Golub <mgolub@suse.com>
2020-11-10 17:16:00 +00:00
Mykola Golub
4cda97a822 rbd-nbd: when unmapping or detaching by device try to find process
For `detach` failing to find the process is fatal while unmap
will still try to send disconnect to the device.

Signed-off-by: Mykola Golub <mgolub@suse.com>
2020-11-10 17:15:59 +00:00
Mykola Golub
5e10672e4e
Merge pull request #37884 from dillaman/wip-48032
qa/workunits/rbd: fix permission issue when removing mirror peer

Reviewed-by: Mykola Golub <mgolub@suse.com>
2020-10-29 15:48:35 +02:00
Jason Dillaman
caaba8eabe qa/workunits/rbd: fix permission issue when removing mirror peer
Fixes: https://tracker.ceph.com/issues/48032
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2020-10-28 14:06:57 -04:00
Mykola Golub
3043d80168 rbd-nbd: make unmap/detach wait for rbd-nbd process to terminate
Signed-off-by: Mykola Golub <mgolub@suse.com>
2020-10-13 18:32:50 +01:00
Mykola Golub
7d75c1d6b8 rbd-nbd: introduce new attach and detach commands
The commands allow to restart a daemon without destroying the nbd
device.

Now, if the netlink is used, a dead connection timeout is set on
the nbd device setup, so the device is not immediately released
if the rbd-nbd process terminates without disconnect (unmap).

The attach command just sends terminate signal to the rbd-nbd
process. The detach command starts a new process and connects to
the existing device.

Signed-off-by: Mykola Golub <mgolub@suse.com>
2020-10-07 13:26:07 +01:00
Mykola Golub
b360186eb6 rbd-nbd: don't ignore namespace when unmapping by image spec
Fixes: https://tracker.ceph.com/issues/47665
Signed-off-by: Mykola Golub <mgolub@suse.com>
2020-09-27 17:59:49 +01:00