]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
4 years agolibrbd/mirror: leave non-primary snapshot images in creating state 39439/head
Jason Dillaman [Thu, 11 Feb 2021 20:54:01 +0000 (15:54 -0500)]
librbd/mirror: leave non-primary snapshot images in creating state

The creating state is a special case in rbd-mirror where it will
automatically delete the image since it assumes it's malformed.
A non-primary, snapshot-based mirror image needs to have at least
one non-primary snapshot and the first one is not created until
after replay has started. Now rbd-mirror will update the mirror
image state to the enabled state after creating the first
non-primary snapshot but before attempting the sync.

Fixes: https://tracker.ceph.com/issues/49238
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 43f2c208fa3042d93e4810d804ffe28e9ca7af77)

4 years agorbd-mirror: ensure that the last non-primary snapshot cannot be pruned
Jason Dillaman [Thu, 11 Feb 2021 20:45:01 +0000 (15:45 -0500)]
rbd-mirror: ensure that the last non-primary snapshot cannot be pruned

Tweak the normal pruning behavior to ensure that an incomplete initial
non-primary snapshot is not included in the prune set since we know
it will be complete since otherwise the image would have been deleted
due to not updating the mirror-image-state to enabled. Also ensure
we cannot prune a non-primary mirror snapshot if we don't have a
predecessor.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit ecd3778a6f9a6ca33aebbf47cef79db5f04157a9)

4 years agorbd-mirror: update snapshot mirror image state after snapshot creation
Jason Dillaman [Thu, 11 Feb 2021 20:23:56 +0000 (15:23 -0500)]
rbd-mirror: update snapshot mirror image state after snapshot creation

The non-primary mirror snapshot is what is used to link the non-primary
to the primary image. If there is an interruption between creating the
non-primary image and the creation of the first non-primary snapshot,
the images will be considerered unlinked.

A future commit will modify librbd to avoid setting the mirror image
state to enabled for non-primary snapshot-based mirroring images.
rbd-mirror will already automatically delete images in the CREATING
state during the bootstrap phase.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit c9378ab8293e531a49970a01becd9762cf1f8f80)

4 years agodoc/rbd: rbd encryption
Or Ozeri [Mon, 15 Feb 2021 15:50:35 +0000 (17:50 +0200)]
doc/rbd: rbd encryption

This commit adds documentation of the new rbd encryption feature

Signed-off-by: Or Ozeri <oro@il.ibm.com>
(cherry picked from commit e45cd83af1edeca33c4acdfb52e53a030f199074)

4 years agocmake: enable write-back cache in spec
lixiaoy1 [Thu, 18 Feb 2021 01:12:26 +0000 (20:12 -0500)]
cmake: enable write-back cache in spec

Signed-off-by: Li, Xiaoyan <xiaoyan.li@intel.com>
(cherry picked from commit a49d1dbb32e2436ff2836a85b2fa84418f0a5fff)

4 years agolibrbd/cache/pwl: wait for the completion of reads
lixiaoy1 [Fri, 19 Feb 2021 05:04:57 +0000 (00:04 -0500)]
librbd/cache/pwl: wait for the completion of reads

Shut down PWL after the read IOs are completed.

Signed-off-by: Li, Xiaoyan <xiaoyan.li@intel.com>
(cherry picked from commit 54e8e4608708fc38e6d0de7e4bc352e9a442c02f)

4 years agomgr/rbd_support: mirror snapshot schedule should skip non-primary images
Mykola Golub [Wed, 17 Feb 2021 14:15:57 +0000 (14:15 +0000)]
mgr/rbd_support: mirror snapshot schedule should skip non-primary images

And while here, suppress error messages for ENOENT errors.

Fixes: https://tracker.ceph.com/issues/49284
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit d39eb283c5cee12c98afb2667d63112ef9409630)

4 years agolibrbd: allow disabling journaling for snapshot based mirroring image
Mykola Golub [Fri, 12 Feb 2021 17:18:07 +0000 (17:18 +0000)]
librbd: allow disabling journaling for snapshot based mirroring image

Fixes: https://tracker.ceph.com/issues/49282
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit 2a5885fedaaf2ddd3c7005162064c9981a499240)

4 years agoqa/workunits/rbd: make luks-encryption test work on vstart cluster
Mykola Golub [Mon, 15 Feb 2021 15:03:00 +0000 (15:03 +0000)]
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>
(cherry picked from commit f737c2855a19c75c38804bdd0caacc915b0472a1)

4 years agolibrbd: don't log error if get mirror status fails due to mirroring disabled
Mykola Golub [Thu, 11 Feb 2021 09:24:49 +0000 (09:24 +0000)]
librbd: don't log error if get mirror status fails due to mirroring disabled

Fixes: https://tracker.ceph.com/issues/49245
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit 1d303e6faa51ab71e5b5b909053fd6120c981081)

4 years agolibrbd/io: conditionally disable move optimization
Jason Dillaman [Thu, 4 Feb 2021 16:17:48 +0000 (11:17 -0500)]
librbd/io: conditionally disable move optimization

If the requested write length does not match the provided bufferlist
length, disable the move optimization and instead fallback to creating
a new sub-bufferlist for the object request.

Fixes: https://tracker.ceph.com/issues/49173
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 8dbb4a3d971d9a48c171f161f531956dd0030403)

4 years agotest/rbd-mirror: fix broken ceph_test_rbd_mirror_random_write
Jason Dillaman [Wed, 3 Feb 2021 04:34:18 +0000 (23:34 -0500)]
test/rbd-mirror: fix broken ceph_test_rbd_mirror_random_write

It appears that commit 6eb8f30a238 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>
(cherry picked from commit 8643b046fb4d5b05b4c75b83f16cd8ccc6a8b0a0)

4 years agoMerge pull request #39428 from dillaman/wip-49253-pacific
Jason Dillaman [Fri, 12 Feb 2021 13:15:47 +0000 (08:15 -0500)]
Merge pull request #39428 from dillaman/wip-49253-pacific

pacific: librbd: correct incremental deep-copy object-map inconsistencies

Reviewed-by: Mykola Golub <mgolub@suse.com>
4 years agoMerge pull request #39316 from petrutlucian94/wip-49155-pacific
Jason Dillaman [Fri, 12 Feb 2021 13:15:25 +0000 (08:15 -0500)]
Merge pull request #39316 from petrutlucian94/wip-49155-pacific

pacific: Windows RBD fixes

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
4 years agoMerge pull request #39305 from dillaman/wip-librbd-backports-pacific-3
Jason Dillaman [Fri, 12 Feb 2021 13:15:00 +0000 (08:15 -0500)]
Merge pull request #39305 from dillaman/wip-librbd-backports-pacific-3

pacific: librbd: miscellaneous backports

Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Mykola Golub <mgolub@suse.com>
4 years agolibrbd: journal::StandardPolicy template defaults to ImageCtx 39305/head
Ilya Dryomov [Tue, 9 Feb 2021 13:04:39 +0000 (14:04 +0100)]
librbd: journal::StandardPolicy template defaults to ImageCtx

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit b90ee634fa2aca4d1223ee19f43d026917aa969d)

4 years agolibrbd: don't hold owner_lock for validate_image_removal()
Ilya Dryomov [Mon, 8 Feb 2021 16:01:47 +0000 (17:01 +0100)]
librbd: don't hold owner_lock for validate_image_removal()

handle_exclusive_lock() and handle_shut_down_exclusive_lock() call
validate_image_removal() without owner_lock held, so holding it in
shut_down_exclusive_lock() appears to be redundant.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit b1bf3eaef200fb5d1aa847cad14936f2bbbf7b64)

4 years agolibrbd: treat EROFS as expected in handle_acquire_lock()
Ilya Dryomov [Sun, 7 Feb 2021 14:09:24 +0000 (15:09 +0100)]
librbd: treat EROFS as expected in handle_acquire_lock()

If the peer refuses to release exclusive lock (e.g. in case automatic
exclusive lock transitions are disabled), EROFS is retured.  Suppress
a rather confusing "Read-only file system" error message -- this case
is no different from EBUSY or EAGAIN.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 2f82c98f5a542a69057f3e78d232380eee14eff7)

4 years agolibrbd: refuse to release exclusive lock when removing
Ilya Dryomov [Sun, 7 Feb 2021 12:46:15 +0000 (13:46 +0100)]
librbd: refuse to release exclusive lock when removing

Commit 25c2ffe145be ("librbd: acquire exclusive lock from peer when
removing") changed PreRemoveRequest to request exclusive lock from the
peer instead of giving up and proceeding without exclusive lock.  This
caused one of the test cases that sometimes runs concurrent "rbd rm"
against the same image to fail intermittently, most often on assert

  ceph_assert(image_ctx.exclusive_lock == nullptr ||
              image_ctx.exclusive_lock->is_lock_owner());

because exclusive lock is now automatically transitioned to another
"rbd rm" on its request.

The root cause is older and probably goes back to when synchronous
librbd::remove() which held owner_lock across all operations including
trim_image() was converted to a set of state machines.  Since then, any
peer that requests exclusive lock (instead of trying once and backing
off) is able to mess with image removal.

Install StandardPolicy to disable automatic exclusive lock transitions
during image removal.

Fixes: https://tracker.ceph.com/issues/49226
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 707907ea3f6ff39968666af4ba718ceef8cd8953)

4 years agolibrbd: templatize exclusive_lock::StandardPolicy
Ilya Dryomov [Mon, 8 Feb 2021 15:49:35 +0000 (16:49 +0100)]
librbd: templatize exclusive_lock::StandardPolicy

This will be used by expect_set_exclusive_lock_policy() in
test_mock_PreRemoveRequest.cc.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 948f3c761dce4678b38d22e240da06434dbe10e4)

4 years agolibrbd/cache/pwl: Fix user request completion in
Mahati Chamarthy [Wed, 3 Feb 2021 15:03:50 +0000 (20:33 +0530)]
librbd/cache/pwl: Fix user request completion in

... persist_on_flush mode

Signed-off-by: Mahati Chamarthy <mahati.chamarthy@intel.com>
(cherry picked from commit d8eb9391c9dd7425053bd91f79eea103ae90cc93)

4 years agorbd-mirror: don't prune older mirror snapshots when pruning incomplete snapshot 39428/head
Jason Dillaman [Mon, 8 Feb 2021 16:53:28 +0000 (11:53 -0500)]
rbd-mirror: don't prune older mirror snapshots when pruning incomplete snapshot

Since we normally prune in order, we need to ensure that we don't prune older
snapshots when we need to delete an incomplete mirror snapshot since the
older snapshot might be the only remaining mirror snapshot.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 7ba9214ea5b73d0436af6c2896abf4836d741de9)

4 years agoqa/workunits/rbd: show snapshot deltas during stress test failure
Jason Dillaman [Mon, 8 Feb 2021 15:13:35 +0000 (10:13 -0500)]
qa/workunits/rbd: show snapshot deltas during stress test failure

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit f079116e87161b55acaa08c55bf8b8e79cee8670)

4 years agolibrbd/deep-copy: compute parent overlap before computing zero extents
Jason Dillaman [Fri, 5 Feb 2021 18:33:16 +0000 (13:33 -0500)]
librbd/deep-copy: compute parent overlap before computing zero extents

An object might not overlap with its parent so avoid injecting an empty
object to hide the non-existent parent.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit f1c6147623fc7876f7f9cc7beda98d1f7edf9e68)

4 years agoqa/suites/rbd: add snapshot-based mirroring stress test
Jason Dillaman [Tue, 2 Feb 2021 20:28:48 +0000 (15:28 -0500)]
qa/suites/rbd: add snapshot-based mirroring stress test

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 094bfeaf8efe1c4794a2b301314eddedfa5246f9)

4 years agolibrbd/deep_copy: skip snap list if object is known to be clean
Jason Dillaman [Fri, 29 Jan 2021 15:44:38 +0000 (10:44 -0500)]
librbd/deep_copy: skip snap list if object is known to be clean

If the fast-diff indicates that the destination object should exist
and that it hasn't changed, there shouldn't be a need to issue the
snap list operation. Instead, just update the destination object map
to indicate the existence of the object.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 235b27a8f08a82fc46efa8b6a3e5cb8a5276956b)

4 years agolibrbd/deep_copy: object-copy state machine must update object map
Jason Dillaman [Fri, 29 Jan 2021 02:42:09 +0000 (21:42 -0500)]
librbd/deep_copy: object-copy state machine must update object map

If there was no data to copy, the object-copy state machine was bypassing
the object-map update states and prematurely completing. Since the
object-map is default-initialized to all non-existent objects, this results
in incorrect state for OBJECT_EXISTS_CLEAN objects.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit ca0b9bfc28ef7287ca139ca9640c876223eda87b)

4 years agolibrbd/io: track object non-existence when computing snapshot deltas
Jason Dillaman [Wed, 3 Feb 2021 18:21:34 +0000 (13:21 -0500)]
librbd/io: track object non-existence when computing snapshot deltas

Re-use the existing DNE state to track whether or not the object
already exists when computing snapshot deltas from an arbitrary
set of snapshots. Previously, the non-existence of the object was
only computed for snap id 0 for tracking whiteouts. In a future
commit, the deep-copy object-copy state machine will be able to
properly update the object-map state to indicate exists clean
vs non-existent state.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 89d2a13db67945bfd7c6d6fe79584f00574b8ba3)

4 years agolibrbd/io: minor reorganization for object list-snaps
Jason Dillaman [Wed, 3 Feb 2021 21:23:20 +0000 (16:23 -0500)]
librbd/io: minor reorganization for object list-snaps

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit a75c8a0abdb43a60dd7eeb3b405f6b30481cf321)

4 years agolibrbd/io: only track initial diff extents if no diffs exists
Jason Dillaman [Wed, 3 Feb 2021 15:13:28 +0000 (10:13 -0500)]
librbd/io: only track initial diff extents if no diffs exists

The purpose of the initial diff extents ({0, 0}) was to help track
whether or not objects exists for read-from-parent / whiteout
tracking. Once we have at least one set of diffs on the object, we
actually have enough information to know about the object state.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 688cbf3da38025b48be1e308f79170c40f0760d3)

4 years agolibrbd/object_map: diff state machine should track object existence
Jason Dillaman [Thu, 28 Jan 2021 23:30:16 +0000 (18:30 -0500)]
librbd/object_map: diff state machine should track object existence

The deep-copy snapshot-create state machine initializes the object-map
state to non-existent for all objects. There was an assumption that the
deep-copy object-copy state machine would always update the object map
but that was being skipped for clean objects as an optimization. This
change will support a future commit to run the object-copy state machine
for existing objects.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit b81cd2460de748c71210520f8c819895f257f0c7)

4 years agoMerge pull request #39272 from jan--f/wip-49142-pacific
Guillaume Abrioux [Thu, 11 Feb 2021 07:49:03 +0000 (08:49 +0100)]
Merge pull request #39272 from jan--f/wip-49142-pacific

pacific: ceph-volume: add some flexibility to bytes_to_extents

4 years agoMerge pull request #39403 from neha-ojha/wip-49228-pacific
Neha Ojha [Thu, 11 Feb 2021 02:06:18 +0000 (18:06 -0800)]
Merge pull request #39403 from neha-ojha/wip-49228-pacific

pacific: Revert "qa/tasks/cephadm: use cluster.sh and remote.sh for better readibility"

Reviewed-by: Sage Weil <sage@redhat.com>
4 years agoRevert "qa/tasks/cephadm: use cluster.sh and remote.sh for better readibility" 39403/head
Neha Ojha [Tue, 9 Feb 2021 22:10:19 +0000 (22:10 +0000)]
Revert "qa/tasks/cephadm: use cluster.sh and remote.sh for better readibility"

This reverts commit 6d7ba1180e66df2d6dee3a01fe3e12cafaa6fe8c.

Fixes: https://tracker.ceph.com/issues/49228
Signed-off-by: Neha Ojha <nojha@redhat.com>
(cherry picked from commit 3ced450cdd7a1f4083a19dd29b2d27e03883ab52)

4 years agoMerge pull request #39309 from liewegas/pr-39150-pacific
Sebastian Wagner [Wed, 10 Feb 2021 11:33:38 +0000 (12:33 +0100)]
Merge pull request #39309 from liewegas/pr-39150-pacific

pacific: qa/suites/rados/cephadm/thrash: add cephadm thrashing test

Reviewed-by: Neha Ojha <nojha@redhat.com>
4 years agoMerge pull request #39181 from liewegas/pr-39039-pacific
Sebastian Wagner [Wed, 10 Feb 2021 11:32:54 +0000 (12:32 +0100)]
Merge pull request #39181 from liewegas/pr-39039-pacific

pacific: quincy feature, custom git_url for cephadm_branch

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Reviewed-by: Neha Ojha <nojha@redhat.com>
Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
4 years agoMerge pull request #39190 from liewegas/pr-39097-pacific
Sebastian Wagner [Wed, 10 Feb 2021 11:31:35 +0000 (12:31 +0100)]
Merge pull request #39190 from liewegas/pr-39097-pacific

pacific: qa/workunits/cephadm/test_cephadm: fixes and cleanup

Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
4 years agoMerge pull request #39252 from sebastian-philipp/pacific-cephadm-daemon-base-devel...
Sebastian Wagner [Wed, 10 Feb 2021 11:31:07 +0000 (12:31 +0100)]
Merge pull request #39252 from sebastian-philipp/pacific-cephadm-daemon-base-devel-pacific

pacific: cephadm: use ceph/daemon-base:latest-pacific-devel image

Reviewed-by: Dimitri Savineau <dsavinea@redhat.com>
Reviewed-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
4 years agoMerge pull request #39038 from kotreshhr/fix-test-idempotency-test
Ramana Raja [Mon, 8 Feb 2021 20:16:18 +0000 (15:16 -0500)]
Merge pull request #39038 from kotreshhr/fix-test-idempotency-test

pacific: pybind/ceph_volume_client: Fix test_idempotency test failure

Reviewed-by: Ramana Raja <rraja@redhat.com>
4 years agoMerge pull request #39109 from kotreshhr/wip-49027-pacific
Ramana Raja [Mon, 8 Feb 2021 20:14:44 +0000 (15:14 -0500)]
Merge pull request #39109 from kotreshhr/wip-49027-pacific

pacific: mgr/volumes: Evict clients based on auth-IDs and subvolume path

Reviewed-by: Ramana Raja <rraja@redhat.com>
4 years agoMerge pull request #39284 from neha-ojha/wip-49145-pacific
Yuri Weinstein [Mon, 8 Feb 2021 18:31:57 +0000 (10:31 -0800)]
Merge pull request #39284 from neha-ojha/wip-49145-pacific

pacific: osd: fix the scrubber behavior on multiple preemption attempts

Reviewed-by: Ronen Friedman <rfriedma@redhat.com>
4 years agoMerge pull request #39264 from neha-ojha/wip-49134-pacific
Yuri Weinstein [Mon, 8 Feb 2021 18:31:06 +0000 (10:31 -0800)]
Merge pull request #39264 from neha-ojha/wip-49134-pacific

pacific: qa/*/test_envlibrados_for_rocksdb: use osd_client_message_cap to prevent slow requests

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
4 years agoMerge pull request #39257 from ifed01/wip-ifed-fsck-spanning-blobs-pac
Yuri Weinstein [Mon, 8 Feb 2021 18:30:39 +0000 (10:30 -0800)]
Merge pull request #39257 from ifed01/wip-ifed-fsck-spanning-blobs-pac

pacific: os/bluestore: detect and fix "zombie" spanning blobs using fsck.

Reviewed-by: Adam Kupczyk <akupczyk@redhat.com>
4 years agoMerge pull request #39247 from kamoltat/wip-ksirivad-pacific-backports
Yuri Weinstein [Mon, 8 Feb 2021 18:29:46 +0000 (10:29 -0800)]
Merge pull request #39247 from kamoltat/wip-ksirivad-pacific-backports

pacific: mgr/pg_autoscaler: avoid scale-down until there is pressure

Reviewed-by: Neha Ojha <nojha@redhat.com>
4 years agoMerge pull request #39237 from liewegas/pr-39206-pacific
Yuri Weinstein [Mon, 8 Feb 2021 18:28:51 +0000 (10:28 -0800)]
Merge pull request #39237 from liewegas/pr-39206-pacific

pacific: mgr/MetricTypes: condition encoding on feature bits

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
4 years agoMerge pull request #39102 from k0ste/wip-49021-pacific
Ernesto Puerta [Mon, 8 Feb 2021 18:01:25 +0000 (19:01 +0100)]
Merge pull request #39102 from k0ste/wip-49021-pacific

pacific: mgr/dashboard: trigger alert if some nodes have a MTU different than the median value

Reviewed-by: Aashish Sharma <aasharma@redhat.com>
Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Nizamudeen A <nia@redhat.com>
4 years agoMerge pull request #39026 from rhcs-dashboard/wip-48962-pacific
Ernesto Puerta [Mon, 8 Feb 2021 18:00:22 +0000 (19:00 +0100)]
Merge pull request #39026 from rhcs-dashboard/wip-48962-pacific

pacific: mgr/dashboard: Fix for incorrect validation in rgw user form

Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
4 years agocephadm: use ceph/daemon-base:latest-pacific-devel image 39252/head
Sebastian Wagner [Wed, 3 Feb 2021 11:34:49 +0000 (12:34 +0100)]
cephadm: use ceph/daemon-base:latest-pacific-devel image

Fixes: https://tracker.ceph.com/issues/49041
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
4 years agoMerge pull request #39050 from vshankar/wip-mgr-mirroring-interface-pacific
Venky Shankar [Fri, 5 Feb 2021 10:57:35 +0000 (16:27 +0530)]
Merge pull request #39050 from vshankar/wip-mgr-mirroring-interface-pacific

pacific: pybind/mgr/mirroring: directory snapshot mirror support

4 years agowin32*.sh: move debug symbols to separate files 39316/head
Lucian Petrut [Wed, 3 Feb 2021 08:59:24 +0000 (08:59 +0000)]
win32*.sh: move debug symbols to separate files

This patch simplifies releasing Windows binaries along with debug
symbols.

By default, we're going to provide minimum debug information (-g1).
The symbols are extracted from the binaries and placed in separate
files in the ".debug" folder, which is used by gdb implicitly.

This is more convenient than having separate versions of the binaries,
with or without debug symbols.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 1c426e96b0efb2f8198fa742c0ad0f2ddd090ad2)

4 years agorbd: propagate rbd-wnbd errors
Lucian Petrut [Fri, 29 Jan 2021 13:38:19 +0000 (13:38 +0000)]
rbd: propagate rbd-wnbd errors

This change updates the "rbd device" commands, propagating
rbd-wnbd.exe exit codes.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 8d64c7cf4265ae853fd05a99b87e260c98c2b34c)

4 years agorbd: propagate WNBD start errors
Lucian Petrut [Fri, 29 Jan 2021 11:03:20 +0000 (11:03 +0000)]
rbd: propagate WNBD start errors

This change will propagate the errors that WNBD may return when
spinning up the IO workers.

Also, we'll avoid removing the registry record for failed
non-persistent mappings. Those will be cleaned up when the service
restarts or when explicitly unmapped.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit afa7b532b2b53ba3734e13f5f72213cbe6ba22fd)

4 years agorbd: improve Windows remap failure handling
Lucian Petrut [Fri, 29 Jan 2021 09:54:10 +0000 (09:54 +0000)]
rbd: improve Windows remap failure handling

At the moment, if an image can't be remapped when the centralized
RBD service starts, the service will stop and already started
daemons will continue running.

This change adds a new option: "--remap-failure-fatal". If set,
when an image can't be remmaped, the service stops AND cleans up
the running daemons. By default, an error will be logged and the
service will continue running.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 14b78e45383f77dc18de5d31a36e0220c8cd13ad)

4 years agorbd: add image map timeouts on Windows
Lucian Petrut [Thu, 28 Jan 2021 14:08:29 +0000 (14:08 +0000)]
rbd: add image map timeouts on Windows

This change adds configurable timeouts used when starting the centralized RBD
service and mapping images.

This change also fixes an issue where the service would wait indefinitely for
a failed mapping. This issue was caused by the fact that multiple child
processes were inheriting pipe handles.

Note that we can't use timeouts with Windows anonymous pipes, which is why
we're going to use unique named pipes.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 8b08fb80284ee1cce62f800db92231f8493756fc)

4 years agorbd: restrict Windows service exec calls
Lucian Petrut [Wed, 27 Jan 2021 12:58:48 +0000 (12:58 +0000)]
rbd: restrict Windows service exec calls

The centralized Ceph Windows service is responsible of managing
rbd-wnbd daemons. When starting, it's respawns the daemons using the
command line saved in the Windows registry. Also, for new mappings,
the command line is passed through a named pipe.

While writing to the according named pipe and windows registry entries
requires admin privileges, it's better to avoid running arbitrary
commands.

This patch will drop the executable from the commands that the
Ceph service accepts. Instead, it will only accept arguments that
are passed to the the binary that was used to start the service
(rbd-wnbd.exe).

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 1744ba056869c2d5fb6b9d4551ea4da38dc8546a)

4 years agorbd: allow non persistent Windows mappings
Lucian Petrut [Wed, 27 Jan 2021 09:06:19 +0000 (09:06 +0000)]
rbd: allow non persistent Windows mappings

At the moment, all Windows RBD mappings are persistent, being
recreated when the Ceph service starts.

This change adds the "--non-persistent" flag to allow skipping
certain images.

Note that even for non-persistent mappings, we're still storing
data in the Windows registry, allowing us to retrieve image
details such as the rbd pool as well as the admin socket path.

When the daemons stop or the Ceph service starts, non-persistent
entries are cleaned up from the Windows registry.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 2455a907e66e706e2be4f91322b8f4cdd59fc844)

4 years agorbd: fix Windows block count overflow
Lucian Petrut [Wed, 27 Jan 2021 08:30:54 +0000 (08:30 +0000)]
rbd: fix Windows block count overflow

rbd-wnbd uses uint32_t for storing the image total block count,
which will overflow for >2TB images that are using 512B blocks.

This patch will switch to a uint64_t.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 6dc45eea209e1d3b2262a5d8d04d145adc7708a6)

4 years agorbd: delegate map requests to the Windows service
Lucian Petrut [Tue, 26 Jan 2021 14:13:22 +0000 (14:13 +0000)]
rbd: delegate map requests to the Windows service

At the moment, rbd-wnbd daemons are tied to the Windows
session. When the user logs off or the WinRM remote session
terminates, the daemons are killed.

In order to avoid such issues, we'll delegate the daemon
initialization to the centralized Ceph Windows service.

We're using a named pipe for the Ceph service communication.
We're not using Ceph admin sockets for now since unix sockets
aren't available on Windows Server 2016.

Worth mentioning that the Ceph Windows service will restart
registered mappings when the host reboots based on the command
lines saved in the Windows registries. Writing to the registry
key as well as the service named pipe requires admin privileges.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 7a2f9903fe97422da2baf602c426aabd0907973e)

4 years agoMerge pull request #39045 from smithfarm/wip-48970-pacific
Jason Dillaman [Fri, 5 Feb 2021 00:23:18 +0000 (19:23 -0500)]
Merge pull request #39045 from smithfarm/wip-48970-pacific

pacific: ocf: add support for mapping images within an RBD namespace

Reviewed-by: Mykola Golub <mgolub@suse.com>
Reviewed-by: Jason Dillaman <dillaman@redhat.com>
4 years agoMerge pull request #39177 from cbodley/wip-qa-rgw-pacific-branches
Yuri Weinstein [Thu, 4 Feb 2021 19:43:19 +0000 (11:43 -0800)]
Merge pull request #39177 from cbodley/wip-qa-rgw-pacific-branches

pacific: qa: rgw tests target ceph-pacific branches instead of ceph-master

Reviewed-by: Yuri Weinstein <yweinste@redhat.com>
4 years agoqa/suites/rados/cephadm/thrash: add cephadm thrashing test 39309/head
Sage Weil [Mon, 25 Jan 2021 15:19:01 +0000 (09:19 -0600)]
qa/suites/rados/cephadm/thrash: add cephadm thrashing test

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit cc6412c99127c05dda639ff753cb1102bdb995bb)

4 years agolibrbd: crypto performance optimization
Or Ozeri [Thu, 28 Jan 2021 13:21:47 +0000 (15:21 +0200)]
librbd: crypto performance optimization

This commit removes input bufferlist rebuilding, which adds significant overhead (about 50%)

Signed-off-by: Or Ozeri <oro@il.ibm.com>
(cherry picked from commit 8215741744dd5fb79319787fcf617808ac6936b5)

4 years agoqa: add REST API method support for ceph-iscsi
Xiubo Li [Fri, 25 Dec 2020 01:08:04 +0000 (09:08 +0800)]
qa: add REST API method support for ceph-iscsi

Fixes: https://tracker.ceph.com/issues/48529
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit 6d0d1d96c2d34153f14cacb569688d7a929199d6)

4 years agoqa: rename gwcli_client to iscsi_client
Xiubo Li [Fri, 25 Dec 2020 01:02:14 +0000 (09:02 +0800)]
qa: rename gwcli_client to iscsi_client

This could be used for both gwcli and REST API methods.

Fixes: https://tracker.ceph.com/issues/48529
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit a18c1e66586d2a07ce343ff26105427f8c940931)

4 years agodoc: cleanup cephfs-mirroring document 39050/head
Venky Shankar [Wed, 3 Feb 2021 05:11:59 +0000 (00:11 -0500)]
doc: cleanup cephfs-mirroring document

Remove references to in-progress feature, remove internal interfaces
section and minor cleanups.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit bf19651d6ad0a11e939c5d9f4bb744e90ad8a9d7)

4 years agotest: cephfs-mirror teuthology task and test yamls
Venky Shankar [Tue, 4 Aug 2020 09:05:51 +0000 (05:05 -0400)]
test: cephfs-mirror teuthology task and test yamls

Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit 3478b2a06204bc58dcefae7f1d1f2497dd08fccf)

4 years agotest: add tests for mirroring module w/ daemon verification
Venky Shankar [Tue, 18 Aug 2020 09:33:33 +0000 (05:33 -0400)]
test: add tests for mirroring module w/ daemon verification

Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit f81e8f1e8831d6e79f24531ec73483343e3e2b9f)

4 years agotest: optionally create a backup filesystem on startup
Venky Shankar [Tue, 18 Aug 2020 09:32:38 +0000 (05:32 -0400)]
test: optionally create a backup filesystem on startup

Also filter out client-id's starting with "mirror" when
cleaning leftover auth-ids since teuthology would be
configured to create client.mirror and client.mirror_remote
clients before executing mirroring tests.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit 8334bea5a64bb4b863e3ff1a6b46807bf03f3270)

4 years agopybind/mgr/mirroring: interface to mirror CephFS directory snapshots
Venky Shankar [Thu, 9 Jul 2020 10:43:47 +0000 (06:43 -0400)]
pybind/mgr/mirroring: interface to mirror CephFS directory snapshots

Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit b7acf7fc77d8c7865935643c3eb484be2f9999a1)

4 years agopybind/mgr/mgr_util: make RTimer calss reusable
Venky Shankar [Thu, 9 Jul 2020 10:43:04 +0000 (06:43 -0400)]
pybind/mgr/mgr_util: make RTimer calss reusable

Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit 296e879009a16130138c9f7aa09bfdbf29ff9847)

4 years agoosd: fix the scrubber behavior on multiple preemption attempts 39284/head
Ronen Friedman [Thu, 28 Jan 2021 17:04:35 +0000 (19:04 +0200)]
osd: fix the scrubber behavior on multiple preemption attempts

Latest scrub code creates a time window in which a specific scrub
is marked as "preempted", but future preemptions are prohibited.
Write operations handled are then blocked but not restarted on time.

Fixes: https://tracker.ceph.com/issues/48793
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
(cherry picked from commit 4cdb293e08f0ea066511c9e33f48635d20d58dd9)

4 years agoosd: replacing list::size() with list::empty() in some scrub code
Ronen Friedman [Thu, 28 Jan 2021 14:28:15 +0000 (16:28 +0200)]
osd: replacing list::size() with list::empty() in some scrub code

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
(cherry picked from commit f100f2f7f4e332ac784db44a35bf23cf53a43dff)

4 years agoMerge pull request #39280 from neha-ojha/wip-49139-pacific
Neha Ojha [Wed, 3 Feb 2021 23:00:28 +0000 (15:00 -0800)]
Merge pull request #39280 from neha-ojha/wip-49139-pacific

pacific: qa/suites/rados/perf: pin to 18.04

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
4 years agoqa/suites/perf-basic: pin to 18.04 39280/head
Neha Ojha [Wed, 3 Feb 2021 18:57:50 +0000 (18:57 +0000)]
qa/suites/perf-basic: pin to 18.04

This will have same problems as https://tracker.ceph.com/issues/49139

Signed-off-by: Neha Ojha <nojha@redhat.com>
(cherry picked from commit e5895dd8012f646ae9d67b9d1b331e7c06fe89d3)

4 years agoqa/suites/rados/perf: pin to 18.04
Neha Ojha [Wed, 3 Feb 2021 17:29:59 +0000 (17:29 +0000)]
qa/suites/rados/perf: pin to 18.04

Caused by a07ca4c5c0f04c43c71231a898c2a89e99a80606

Fixes: https://tracker.ceph.com/issues/49139
Signed-off-by: Neha Ojha <nojha@redhat.com>
(cherry picked from commit 6a03b4cec9be39b2c3217e5f28372e1db3999781)

4 years agoMerge pull request #39165 from sebastian-philipp/pacific-backport-39035-38935-39028...
Yuri Weinstein [Wed, 3 Feb 2021 18:14:56 +0000 (10:14 -0800)]
Merge pull request #39165 from sebastian-philipp/pacific-backport-39035-38935-39028-39087-38998-38854-38982-39101-39043-39113-

pacific: cephadm: Batch backport January (2)

Reviewed-by: Jan Fajerski <jfajerski@suse.com>
Reviewed-by: Neha Ojha <nojha@redhat.com>
Reviewed-by: Laura Paduano <lpaduano@suse.com>
Reviewed-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
4 years agoceph-volume: mock VGs with string properties in tests 39272/head
Jan Fajerski [Tue, 22 Dec 2020 14:44:10 +0000 (15:44 +0100)]
ceph-volume: mock VGs with string properties in tests

The real things uses string properties as well.

Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit c4bbb1b999b08bd84d793537f2602fc8e4c93bae)

4 years agoceph-volume: add some flexibility to bytes_to_extents
Jan Fajerski [Tue, 22 Dec 2020 13:29:02 +0000 (14:29 +0100)]
ceph-volume: add some flexibility to bytes_to_extents

For batch we want to report the projected sizes before creating any LVM
structures, we use the device size for that. This means we pass this
projected size to lvm/api.py::create_lv. This could result in situations
where we request more extents for the new LV than are actually
available, as LVM takes up some available space on the block device
(plus alignment).
We fix this by adjusting the extent count downwards if its less than 1% off the
requested value.

Fixes: https://tracker.ceph.com/issues/47758
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit ece6e7eb9a92cb944b2f201a05a5acfb877c2dba)

4 years agoqa/*/test_envlibrados_for_rocksdb: use osd_client_message_cap to prevent slow requests 39264/head
Neha Ojha [Tue, 2 Feb 2021 17:43:56 +0000 (17:43 +0000)]
qa/*/test_envlibrados_for_rocksdb: use osd_client_message_cap to prevent slow requests

EnvLibradosMutipoolTest.DBBulkLoadKeysInRandomOrder can overload OSDs and cause
heartbeat timeouts. Tests in test_envlibrados_for_rocksdb also generate slow
requests on OSDs. Use osd_client_message_cap to prevent this.
Since this option is disabled by default, this may be a good way to exercise it.

Fixes: https://tracker.ceph.com/issues/49064
Signed-off-by: Neha Ojha <nojha@redhat.com>
(cherry picked from commit f02cd4d8b0c9f1566462b7b950f121a44efc1d06)

4 years agoMerge pull request #39233 from idryomov/wip-unbreak-rbd-task-pacific
Ilya Dryomov [Wed, 3 Feb 2021 09:36:17 +0000 (10:36 +0100)]
Merge pull request #39233 from idryomov/wip-unbreak-rbd-task-pacific

pacific: qa/tasks/rbd: fix regressions introduced with rbd encryption support

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
4 years agomgr/pg_autoscaler: avoid scale-down until there is pressure 39247/head
Kamoltat [Thu, 7 Jan 2021 15:39:19 +0000 (15:39 +0000)]
mgr/pg_autoscaler: avoid scale-down until there is pressure

The autoscaler will start out with scaling each
pools to have a full complements of pgs from the start
and will only decrease it when pools need more due to
increased usage.

Introduced a unit test that tests only the
function get_final_pg_target_and_ratio() which
deals with the distrubtion of pgs amongst the
pools

Edited workunit script to reflect the change
of how pgs are calculated and distrubted.

Signed-off-by: Kamoltat <ksirivad@redhat.com>
(cherry picked from commit daeb6f6ac0c8f77ae07147f9d1e2ed18d6d8e4cc)

4 years agomgr/MetricTypes: condition encoding on feature bits 39237/head
Sage Weil [Sun, 31 Jan 2021 16:29:51 +0000 (10:29 -0600)]
mgr/MetricTypes: condition encoding on feature bits

Do not encode new metric|config types for older peers.

The combination of boost::optional and boost::variant make this super
awkward to condition on the features. :(

Fixes: https://tracker.ceph.com/issues/49069
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 5cf13459813228a2b8d78bba2d28a10528490c1f)

4 years agoqa/tasks/rbd: don't wait for krbd symlink to be created/removed 39233/head
Ilya Dryomov [Sun, 31 Jan 2021 14:24:32 +0000 (15:24 +0100)]
qa/tasks/rbd: don't wait for krbd symlink to be created/removed

Commit 3754c665a11e (":qa/tasks/rbd: test qemu on top of rbd
encryption") broke dev_create() for krbd by messing up the "wait
for the symlink to be created by udev" loop.  The rbd tool has been
synchronizing with udev internally since 2014, so rather than fixing
let's just drop it.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit d89613f52dee83c308a2b169ba1c2869c16ac9d7)

4 years agoqa/tasks/rbd: dev_create() expects a properties dict
Ilya Dryomov [Sun, 31 Jan 2021 13:27:52 +0000 (14:27 +0100)]
qa/tasks/rbd: dev_create() expects a properties dict

In order to add encryption_format property, commit 3754c665a11e
(":qa/tasks/rbd: test qemu on top of rbd encryption") changed the
dev_create() contract.  It now expects a properties dict, but the
main task routine wasn't updated and still passes role_images.

On top of that, role_images itself got broken.  It is supposed
to be a mapping from role to a corresponding image name, not to
a dict with an image_name key.  This affected generic_mount().

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 0357c0215b2fbbf7fa801331df1f92b101ad9d5e)

4 years agoos/bluestore: detect and fix "zombie" spanning blobs using fsck. 39257/head
Igor Fedotov [Thu, 12 Nov 2020 17:04:45 +0000 (20:04 +0300)]
os/bluestore: detect and fix "zombie" spanning blobs using fsck.

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
(cherry picked from commit 18d120dc2c15c0cf8d3b27ddba3c7f2057856555)

4 years agoqa/workunits/cephadm/test_cephadm: fix argument 39190/head
Sage Weil [Fri, 29 Jan 2021 15:07:15 +0000 (09:07 -0600)]
qa/workunits/cephadm/test_cephadm: fix argument

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 8c625c077b067380acbe005c2db818322011f56e)

4 years agoqa/workunits/cephadm/test_cephadm: show exporter output
Sage Weil [Thu, 28 Jan 2021 21:15:02 +0000 (15:15 -0600)]
qa/workunits/cephadm/test_cephadm: show exporter output

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit a78dab9e53ea19488a7c8719852a46311841ae75)

4 years agoqa/workunits/cephadm/test_cephadm: don't bother pulling octopus
Sage Weil [Wed, 27 Jan 2021 03:46:24 +0000 (21:46 -0600)]
qa/workunits/cephadm/test_cephadm: don't bother pulling octopus

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit f394eafd647fa6117aa93379464a089b8b5a2261)

4 years agoqa/workunits/cephadm/test_cephadm: behave on terminal
Sage Weil [Wed, 27 Jan 2021 03:46:09 +0000 (21:46 -0600)]
qa/workunits/cephadm/test_cephadm: behave on terminal

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit c82770f77c77a14334dab668a1e0e2c992974849)

4 years agoqa/workunits/cepham/test_cephadm: pull only recent images, from quay.ceph.io
Sage Weil [Tue, 26 Jan 2021 16:19:53 +0000 (10:19 -0600)]
qa/workunits/cepham/test_cephadm: pull only recent images, from quay.ceph.io

No reason to pull nautilus/mimic, which don't even support cephadm.

This test will mostly run in the sepia lab, so pull from there.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 1dccdd2fa182dcf666829a54bc6bc599a1f9da69)

4 years agoqa/workunits/cephadm/test_cephadm: don't respawn for python versions
Sage Weil [Tue, 26 Jan 2021 16:19:20 +0000 (10:19 -0600)]
qa/workunits/cephadm/test_cephadm: don't respawn for python versions

We aren't supporting python2 anymore.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 90676eb9b1a6e1593c37d158b8592e94ae30d655)

4 years agoqa/tasks/cephadm: allow custom git_url for cephadm_branch pull 39181/head
Sage Weil [Fri, 29 Jan 2021 20:03:43 +0000 (14:03 -0600)]
qa/tasks/cephadm: allow custom git_url for cephadm_branch pull

Normally the git_url is git://git.ceph.com/ceph-ci.git, which mirrors
upstream ceph-ci.git.  However, the release branches aren't present there.
Allow a custom git_url so we can pull these from the main ceph.git.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 5842058d128d48495285242b46e41eba18916084)

# Conflicts:
# qa/suites/upgrade/pacific-x/parallel/1-tasks.yaml

4 years agoqa: rgw tests target ceph-pacific branches instead of ceph-master 39177/head
Casey Bodley [Fri, 29 Jan 2021 17:13:45 +0000 (12:13 -0500)]
qa: rgw tests target ceph-pacific branches instead of ceph-master

s3test and ragweed tests now use ceph-pacific branch. this commit
diverges from master, so is applied directly to the pacific branch

Signed-off-by: Casey Bodley <cbodley@redhat.com>
4 years agocmake: install rook-client-python using ExternalProject 39165/head
Kefu Chai [Thu, 28 Jan 2021 12:35:36 +0000 (20:35 +0800)]
cmake: install rook-client-python using ExternalProject

so we don't need to rerun the generate_rook_ceph_client.sh script
everytime when building the script. cmake creates a stamp file for
tracking the dependencies and the time of modification of dependencies.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 7fb44404bb8bed2a60177ba3948b318f14d28521)

4 years agopython-common: fix test_datetime_to_str_2 on non-UTC hosts
Sage Weil [Wed, 27 Jan 2021 21:44:21 +0000 (15:44 -0600)]
python-common: fix test_datetime_to_str_2 on non-UTC hosts

The old test parsed to a datetime without a tz, which was interpreted as
the local time zone when rendering back to a string.  Specify that it's a
UTC datetime so that behavior is consistent regardless of the test host
timezone.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 78aca4db249c409d0cd5a24bfae81e55cf930bc3)

4 years agocephadm:add missing kernel_security property
Paul Cuzner [Wed, 27 Jan 2021 20:40:58 +0000 (09:40 +1300)]
cephadm:add missing kernel_security property

The propery decorator had gone missing which meant
the dump of host facts was missing the kernel security
(LSM) settings. This patch just adds the @property
decorator back

Signed-off-by: Paul Cuzner <pcuzner@redhat.com>
(cherry picked from commit 1bc953cfbfe015d3eccf9ead002b9eb0253a6825)

4 years agocephadm: refactor call() using asyncio.asyncio.StreamReader
Kefu Chai [Sun, 24 Jan 2021 06:58:51 +0000 (14:58 +0800)]
cephadm: refactor call() using asyncio.asyncio.StreamReader

simpler this way, also fix a couple issues:

* create a child watcher explicitly, see
  https://bugs.python.org/issue35621
* use StringIO for collecting outputs for better performance,
  instead of appending the lines to an existing str
* catch ValueError when reading from the stream reader,
  because StreamReader.readline() could raise ValueError when
  it reaches the buffer limit while looking for a separator.
  in this case, we should try again, in hope that the spawned
  process can feed the reader with more data which contains
  the separator (i.e., b'\n').
* backport ThreadedChildWatcher from Python 3.8 so we can
  run create_subprocess_exec() in non-main threads.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 30070be24860c2dfc0d27c79b0958d6c09316d87)

4 years agomgr/cephadm: Fix wrong argument type to HandleCommandResult
Sebastian Wagner [Wed, 27 Jan 2021 12:15:47 +0000 (13:15 +0100)]
mgr/cephadm: Fix wrong argument type to HandleCommandResult

the argument must be a string

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit 677b3d1b0f925cd36fccbdf9fb12251b77afd030)

4 years agocephadm: Fix iscsi client caps (allow mgr <service status> calls)
Juan Miguel Olmo Martínez [Wed, 20 Jan 2021 09:36:30 +0000 (10:36 +0100)]
cephadm: Fix iscsi client caps (allow mgr <service status> calls)

iSCSI daemons need to execute <ceph service status> command

Fixes: https://tracker.ceph.com/issues/48925
Signed-off-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
(cherry picked from commit 9b9934f75b648a9ee01848710a6f7150a371e26e)

4 years agomgr/cephadm: force flag for ok-to-stop and ok-to-stop for monitoring stack
Adam King [Mon, 11 Jan 2021 18:23:04 +0000 (13:23 -0500)]
mgr/cephadm: force flag for ok-to-stop and ok-to-stop for monitoring stack

Daemons that could cause data loss when stopped will always block.

Daemons that will only cause loss in availability should block but have
a workaround in the form of a force flag if the user is okay with the service
being down.

Also implements ok-to-stop for monitoring stack daemons that uses this system
of blocking on availability loss unless force flag is provided

Signed-off-by: Adam King <adking@redhat.com>
Signed-off-by: Daniel-Pivonka <dpivonka@redhat.com>
(cherry picked from commit aeeffb07f1bb226b64a362de4eecd7d63fc0b0d1)