]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
3 years agodoc/rados/op: ceph/df show DIRTY field N/A 42860/head
Deepika Upadhyay [Wed, 23 Jun 2021 03:57:25 +0000 (09:27 +0530)]
doc/rados/op: ceph/df show DIRTY field N/A

DIRTY field should only be available if cache tiering is in use.

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
(cherry picked from commit ba52429897c34a132f2868aad3dc0c79de3db45d)

3 years agotest: update test for when cache tier is not available
Deepika Upadhyay [Wed, 23 Jun 2021 05:14:21 +0000 (10:44 +0530)]
test: update test for when cache tier is not available

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
(cherry picked from commit e80a80c7d932ab60c5b31ad50c7b62d5fb0b37bc)

3 years agomon/PGMap: DIRTY field as N/A in `df detail` when cache tier not in use
Deepika Upadhyay [Wed, 23 Jun 2021 05:12:38 +0000 (10:42 +0530)]
mon/PGMap: DIRTY field as N/A in `df detail` when cache tier not in use

    'ceph df detail' reports a column for DIRTY objects under POOLS even
    though cache tiers not being used.  In replicated or EC pool all objects
    in the pool are reported as logically DIRTY as they have never been
    flushed .
    we display N/A for DIRTY objects if the pool is not a cache tier.

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
(cherry picked from commit fafebb1824eb474dbbeb4137c033954d45b508af)

3 years agoMerge pull request #42211 from ideepika/wip-51549-pacific
Yuri Weinstein [Thu, 19 Aug 2021 20:48:13 +0000 (13:48 -0700)]
Merge pull request #42211 from ideepika/wip-51549-pacific

pacific: monitoring/grafana/build/Makefile: revamp for arm64 builds, pushes to docker and quay, jenkins

Reviewed-by: Alfonso Martínez <almartin@redhat.com>
Reviewed-by: Aashish Sharma <aasharma@redhat.com>
3 years agoMerge pull request #42736 from sebastian-philipp/pacific-backport-41854-42108-42134...
Sebastian Wagner [Wed, 18 Aug 2021 15:23:07 +0000 (17:23 +0200)]
Merge pull request #42736 from sebastian-philipp/pacific-backport-41854-42108-42134-42017-41906-42032-41829-41938-42177-42092-

pacific: cephadm: August batch 1

Reviewed-by: Sage Weil <sage@newdream.net>
3 years agoMerge pull request #42753 from guits/wip-52133-pacific
Guillaume Abrioux [Wed, 18 Aug 2021 14:33:12 +0000 (16:33 +0200)]
Merge pull request #42753 from guits/wip-52133-pacific

pacific: ceph-volume: work around phantom atari partitions

3 years agoMerge pull request #42829 from tchaikov/pacific-pr-42811
Kefu Chai [Wed, 18 Aug 2021 13:43:54 +0000 (21:43 +0800)]
Merge pull request #42829 from tchaikov/pacific-pr-42811

pacific: mgr/dashboard/api: set a UTF-8 locale when running pip

Reviewed-by: Avan Thakkar <athakkar@redhat.com>
Reviewed-by: Alfonso Martínez <almartin@redhat.com>
3 years agomgr/dashboard/api: set a UTF-8 locale when running pip 42829/head
Kefu Chai [Tue, 17 Aug 2021 07:53:51 +0000 (15:53 +0800)]
mgr/dashboard/api: set a UTF-8 locale when running pip

ansible-core started to include files whose filenames are encoded in
non-ascii characters, so we have to use a more capable encoding for the
locale in order to install this package. otherwise we'd have following
error:

Collecting ansible-core<2.12,>=2.11.3
  Using cached ansible-core-2.11.4.tar.gz (6.8 MB)
ERROR: Exception:

Traceback (most recent call last):
  File "/tmp/tmp.fX76ASIrch/venv/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
    status = self.run(options, args)
...
  File "/tmp/tmp.fX76ASIrch/venv/lib/python3.8/site-packages/pip/_internal/utils/unpacking.py", line 226, in untar_file
    with open(path, "wb") as destfp:
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 137-140: ordinal not in range(256)

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

3 years agoMerge pull request #42819 from rhcs-dashboard/wip-52293-pacific
Alfonso Martínez [Wed, 18 Aug 2021 08:40:42 +0000 (10:40 +0200)]
Merge pull request #42819 from rhcs-dashboard/wip-52293-pacific

pacific: mgr/dashboard: disable create snapshot with subvolumes

3 years agoMerge pull request #42817 from rhcs-dashboard/wip-52294-pacific
Alfonso Martínez [Wed, 18 Aug 2021 06:32:13 +0000 (08:32 +0200)]
Merge pull request #42817 from rhcs-dashboard/wip-52294-pacific

pacific: mgr/dashboard: Refresh button on the iscsi targets page

3 years agoMerge pull request #42812 from aaSharma14/wip-52135-pacific
Alfonso Martínez [Wed, 18 Aug 2021 06:25:43 +0000 (08:25 +0200)]
Merge pull request #42812 from aaSharma14/wip-52135-pacific

pacific: mgr/dashboard: monitoring: replace Grafana JSON with Grafonnet based code

3 years agoMerge pull request #42702 from joscollin/wip-52084-pacific
Yuri Weinstein [Tue, 17 Aug 2021 15:57:13 +0000 (08:57 -0700)]
Merge pull request #42702 from joscollin/wip-52084-pacific

pacific: pybind/mgr/stats: validate cmdtag

Reviewed-by: Ramana Raja <rraja@redhat.com>
3 years agomgr/dashboard: disable create snapshot with subvolumes 42819/head
Pere Diaz Bou [Tue, 17 Aug 2021 07:41:58 +0000 (09:41 +0200)]
mgr/dashboard: disable create snapshot with subvolumes

Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
(cherry picked from commit b38259b62950ed2b15175935af7de00059926f3f)

3 years agomgr/dashboard: Refresh button on the iscsi targets page 42817/head
Nizamudeen A [Mon, 9 Aug 2021 07:52:51 +0000 (13:22 +0530)]
mgr/dashboard: Refresh button on the iscsi targets page

Added a refresh button on the iscsi targets page. I've noticed that the
auto reload causes some load on the backend. So I disabled the auto
reload and went for the same approach as we have on rgw. A yellow
warning color on refresh btn to let the user know to manually refresh
that whenever needed.

Fixes: https://tracker.ceph.com/issues/52102
Signed-off-by: Nizamudeen A <nia@redhat.com>
(cherry picked from commit 8f23a587a8ccc686b1e3acbfa587fcab76bee45d)

3 years agomgr/dashboard: fix grafonnet build error 42812/head
Aashish Sharma [Thu, 12 Aug 2021 08:58:23 +0000 (14:28 +0530)]
mgr/dashboard: fix grafonnet build error

This PR tends to fix the issue caused by #42194

Fixes:https://tracker.ceph.com/issues/52238
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
(cherry picked from commit 4907c78bb732b613ae223d3a7d1a046da457d1cc)

Conflicts:
ceph.spec.in (added jsonnet package)
monitoring/grafana/dashboards/CMakeLists.txt (added grafana jsons code)
(cherry picked from commit 570160e291b9029c7998d4dd4fee33327da91312)

3 years agoMerge pull request #42788 from rhcs-dashboard/wip-52248-pacific
Alfonso Martínez [Tue, 17 Aug 2021 10:27:01 +0000 (12:27 +0200)]
Merge pull request #42788 from rhcs-dashboard/wip-52248-pacific

pacific: mgr/dashboard: tox.ini: delete useless env. 'apidocs'

3 years agoMerge pull request #42789 from rhcs-dashboard/wip-52250-pacific
Alfonso Martínez [Tue, 17 Aug 2021 10:26:36 +0000 (12:26 +0200)]
Merge pull request #42789 from rhcs-dashboard/wip-52250-pacific

pacific: mgr/dashboard: cephadm e2e start script: add --expanded option

3 years agoMerge pull request #42810 from rhcs-dashboard/wip-52291-pacific
Alfonso Martínez [Tue, 17 Aug 2021 10:02:37 +0000 (12:02 +0200)]
Merge pull request #42810 from rhcs-dashboard/wip-52291-pacific

pacific: mgr/dashboard: fix rename inventory to disks

3 years agomgr/dashboard: monitoring: replace Grafana JSON with Grafonnet based Code
Aashish Sharma [Tue, 6 Jul 2021 11:02:20 +0000 (16:32 +0530)]
mgr/dashboard: monitoring: replace Grafana JSON with Grafonnet based Code

This PR intends to add grafonnet to generate grafana JSON files

Fixes: https://tracker.ceph.com/issues/45184
Signed-off-by: Aashish Sharma <aasharma@redhat.com>
(cherry picked from commit e9bd94515f865b6c8865210b6329c11f3ebe9d23)

Conflicts:
debian/control (added jsonnet package)
run-make-check.sh (switched ON the WITH_GRAFANA bool for make check)

3 years agomgr/dashboard: fix rename inventory to disks 42810/head
Navin Barnwal [Fri, 7 May 2021 07:47:39 +0000 (13:17 +0530)]
mgr/dashboard: fix rename inventory to disks

Fix Inventory breadcrumbs

Fixes: https://tracker.ceph.com/issues/50314
Signed-off-by: Navin Barnwal <knbarnwal@gmail.com>
(cherry picked from commit 23f44e894462e5658f8bcb85899df009fe379379)

3 years agomgr/dashboard: fix rename inventory to disks
Navin Barnwal [Thu, 6 May 2021 17:25:57 +0000 (22:55 +0530)]
mgr/dashboard: fix rename inventory to disks

Fix Orchestrator e2e tests

Fixes: https://tracker.ceph.com/issues/50314
Signed-off-by: Navin Barnwal <knbarnwal@gmail.com>
(cherry picked from commit 15b3665f27d7ceb2de74796a365d4bd19d716ff6)

3 years agomgr/dashboard: fix rename inventory to disks
Navin Barnwal [Wed, 5 May 2021 15:54:36 +0000 (21:24 +0530)]
mgr/dashboard: fix rename inventory to disks
Fix failure check in Host detail component

Fixes: https://tracker.ceph.com/issues/50314
Signed-off-by: Navin Barnwal <knbarnwal@gmail.com>
(cherry picked from commit 356c3c3bbf18a1dbce05d5b7b190df5ef69112e0)

3 years agomgr/dashboard: fix rename inventory to disks
Navin Barnwal [Tue, 4 May 2021 14:29:30 +0000 (19:59 +0530)]
mgr/dashboard: fix rename inventory to disks
Inventory -> Physical Disks changed in total 3 locations

Fixes: https://tracker.ceph.com/issues/50314
Signed-off-by: Navin Barnwal <knbarnwal@gmail.com>
(cherry picked from commit f2aa58a5faaa8aa47c4245fc557a584a97496e67)

3 years agomgr/dashboard: fix rename inventory to disks
Navin Barnwal [Fri, 30 Apr 2021 09:56:28 +0000 (15:26 +0530)]
mgr/dashboard: fix rename inventory to disks

Fixes: https://tracker.ceph.com/issues/50314
Signed-off-by: Navin Barnwal <knbarnwal@gmail.com>
(cherry picked from commit 6c609ace4998a087f21fa55c576b1f3cf1a0e054)

3 years agomgr/dashboard: fix rename inventory to disks
Navin Barnwal [Fri, 30 Apr 2021 09:21:29 +0000 (14:51 +0530)]
mgr/dashboard: fix rename inventory to disks

Fixes: https://tracker.ceph.com/issues/50314
Signed-off-by: Navin Barnwal <knbarnwal@gmail.com>
(cherry picked from commit fe0bbdaf6a1da13b76a261f8aebe181fd66bee91)

3 years agoMerge pull request #42659 from cfsnyder/wip-50386-pacific
Yuri Weinstein [Mon, 16 Aug 2021 23:36:46 +0000 (16:36 -0700)]
Merge pull request #42659 from cfsnyder/wip-50386-pacific

pacific: SimpleRADOSStriper: use debug_cephsqlite

Reviewed-by: Neha Ojha <nojha@redhat.com>
3 years agoMerge pull request #42693 from tchaikov/pacific-pr-41215
Yuri Weinstein [Mon, 16 Aug 2021 23:33:55 +0000 (16:33 -0700)]
Merge pull request #42693 from tchaikov/pacific-pr-41215

pacific: cmake: Replace boost download url

Reviewed-by: Boris Ranto <branto@redhat.com>
3 years agoMerge pull request #42692 from tchaikov/pacific-pr-42681
Yuri Weinstein [Mon, 16 Aug 2021 23:33:21 +0000 (16:33 -0700)]
Merge pull request #42692 from tchaikov/pacific-pr-42681

pacific: cmake: link bundled fmt statically

Reviewed-by: Boris Ranto <branto@redhat.com>
3 years agoMerge pull request #42561 from smithfarm/wip-51969-pacific
Yuri Weinstein [Mon, 16 Aug 2021 23:32:19 +0000 (16:32 -0700)]
Merge pull request #42561 from smithfarm/wip-51969-pacific

pacific: rpm/luarocks: simplify conditional and support Leap 15.3

Reviewed-by: Yuval Lifshitz <yuvalif@yahoo.com>
Reviewed-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
3 years agoMerge pull request #42544 from cybozu/pacific-kv-rocksdbstore-enrich-debug-message
Yuri Weinstein [Mon, 16 Aug 2021 23:30:36 +0000 (16:30 -0700)]
Merge pull request #42544 from cybozu/pacific-kv-rocksdbstore-enrich-debug-message

pacific: kv/RocksDBStore: enrich debug message

Reviewed-by: Neha Ojha <nojha@redhat.com>
Reviewed-by: Igor Fedotov <ifedotov@suse.com>
3 years agoMerge pull request #42542 from smithfarm/wip-51955-pacific
Yuri Weinstein [Mon, 16 Aug 2021 23:29:53 +0000 (16:29 -0700)]
Merge pull request #42542 from smithfarm/wip-51955-pacific

pacific: compression/snappy: use uint32_t to be compatible with 1.1.9

Reviewed-by: Kefu Chai <kchai@redhat.com>
3 years agoMerge pull request #42224 from cfsnyder/wip-51568-pacific
Yuri Weinstein [Mon, 16 Aug 2021 23:29:21 +0000 (16:29 -0700)]
Merge pull request #42224 from cfsnyder/wip-51568-pacific

pacific: mon/OSDMonitor: resize oversized Lec::epoch_by_pg, after PG merging, preventing osdmap trimming

Reviewed-by: Kefu Chai <kchai@redhat.com>
3 years agoMerge pull request #42536 from batrick/i51940
Yuri Weinstein [Mon, 16 Aug 2021 20:58:44 +0000 (13:58 -0700)]
Merge pull request #42536 from batrick/i51940

pacific: MDSMonitor: monitor crash after upgrade from ceph 15.2.13 to 16.2.4

Reviewed-by: Ramana Raja <rraja@redhat.com>
Reviewed-by: Neha Ojha <nojha@redhat.com>
3 years agoMerge pull request #42773 from neha-ojha/wip-52244-pacific
Neha Ojha [Mon, 16 Aug 2021 17:26:11 +0000 (10:26 -0700)]
Merge pull request #42773 from neha-ojha/wip-52244-pacific

pacific: os/bluestore: make deferred writes less aggressive for large writes

Reviewed-by: Igor Fedotov <ifedotov@suse.com>
3 years agoMerge pull request #42135 from dang/wip-dang-41991-backport
Yuri Weinstein [Mon, 16 Aug 2021 15:50:33 +0000 (08:50 -0700)]
Merge pull request #42135 from dang/wip-dang-41991-backport

pacific: RGW - Bucket Remove Op: Pass in user

Reviewed-by: Casey Bodley <cbodley@redhat.com>
3 years agoMerge pull request #40696 from singuliere/wip-50156-pacific
Yuri Weinstein [Mon, 16 Aug 2021 15:50:00 +0000 (08:50 -0700)]
Merge pull request #40696 from singuliere/wip-50156-pacific

pacific: rgw/notification: fix persistent notification hang when ack-levl=none

Reviewed-by: Casey Bodley <cbodley@redhat.com>
Reviewed-by: Yuval Lifshitz <yuvalif@yahoo.com>
3 years agoMerge pull request #40695 from singuliere/wip-50157-pacific
Yuri Weinstein [Mon, 16 Aug 2021 15:49:17 +0000 (08:49 -0700)]
Merge pull request #40695 from singuliere/wip-50157-pacific

pacific: rgw/notification: fixing the "persistent=false" flag

Reviewed-by: Casey Bodley <cbodley@redhat.com>
3 years agoMerge pull request #40693 from singuliere/wip-50214-pacific
Yuri Weinstein [Mon, 16 Aug 2021 15:48:39 +0000 (08:48 -0700)]
Merge pull request #40693 from singuliere/wip-50214-pacific

pacific: rgw: objectlock: improve client error messages

Reviewed-by: Casey Bodley <cbodley@redhat.com>
3 years agomgr/dashboard: run-cephadm-e2e-tests.sh improvements 42789/head
Alfonso Martínez [Wed, 11 Aug 2021 08:25:42 +0000 (10:25 +0200)]
mgr/dashboard: run-cephadm-e2e-tests.sh improvements

- Jenkins env.: make sure the cluster is always started.
- PR template: add trigger phrase to the jenkins commands list.
- Cypress: add --no-install flag; clean previous reports.

Fixes: https://tracker.ceph.com/issues/52082
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
(cherry picked from commit cadf8c75ac0266e42c1ea0b4d6733590ea3dac21)

3 years agomgr/dashboard: cephadm e2e start script: add --expanded option
Alfonso Martínez [Mon, 9 Aug 2021 13:14:21 +0000 (15:14 +0200)]
mgr/dashboard: cephadm e2e start script: add --expanded option

- Additional improvements: clean npm cache in jenkins env.; display mgr logs on error.

Fixes: https://tracker.ceph.com/issues/52082
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
(cherry picked from commit 973a6f534383e84bd92b690eaf2862a5a30ba70c)

3 years agomgr/dashboard: tox.ini: delete useless env. 'apidocs' 42788/head
Alfonso Martínez [Wed, 11 Aug 2021 09:14:53 +0000 (11:14 +0200)]
mgr/dashboard: tox.ini: delete useless env. 'apidocs'

Fixes: https://tracker.ceph.com/issues/52130
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
(cherry picked from commit d7346ec1486d7ca24177c3064f457f9722c0c8cb)

3 years agotest/store_test: more testing for deferred writes 42773/head
Igor Fedotov [Mon, 9 Aug 2021 15:18:20 +0000 (18:18 +0300)]
test/store_test: more testing for deferred writes

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

3 years agoos/bluestore: enforce one more non-inclusive comparision against prefer_deferred_size
Igor Fedotov [Mon, 9 Aug 2021 16:14:33 +0000 (19:14 +0300)]
os/bluestore: enforce one more non-inclusive comparision against prefer_deferred_size

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

3 years agoos/bluestore: Better handling of deferred write trigger
Adam Kupczyk [Mon, 9 Aug 2021 13:59:46 +0000 (15:59 +0200)]
os/bluestore: Better handling of deferred write trigger

Now deferred write in _do_alloc_write does not depend on blob size,
but on size of extent allocated on disk.
It is now possible to set bluestore_prefer_deferred_size way larger than
bluestore_max_blob_size and still get desired behavior.
Example: for deferred=256K, blob=64K : when op write is 128K both blobs will be
written as deferred. When op write is 256K then all will go as regular write.

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
(cherry picked from commit 06ac561a72a93bd24d05b6c2266d66fee49228b8)

3 years agoos/bluestore: account for alignment with max_blob_size when splitting
Igor Fedotov [Mon, 9 Aug 2021 15:18:35 +0000 (18:18 +0300)]
os/bluestore: account for alignment with max_blob_size when splitting
write I/O into chunks.

Without the fix the following write seq:
0~4M
4096~4M

produces tons of deferred writes at the second stage.

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

3 years agoos/bluestore: introduce l_bluestore_write_deferred_bytes perf counter.
Igor Fedotov [Fri, 6 Aug 2021 23:22:12 +0000 (02:22 +0300)]
os/bluestore: introduce l_bluestore_write_deferred_bytes perf counter.

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

3 years agoos/bluestore: use non-inclusive comparision against prefer_deferred_size
Igor Fedotov [Fri, 6 Aug 2021 18:32:23 +0000 (21:32 +0300)]
os/bluestore: use non-inclusive comparision against prefer_deferred_size

Fixes: https://tracker.ceph.com/issues/52089
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
(cherry picked from commit f1c4448fc549ed58bb58f920dfa16886e4910315)

3 years agoos/bluestore: improve logging around deferred writes
Igor Fedotov [Fri, 6 Aug 2021 14:50:13 +0000 (17:50 +0300)]
os/bluestore: improve logging around deferred writes

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

3 years agoos/bluestore: fix missing 'l_bluestore_write_deferred' perf counter increment
Igor Fedotov [Fri, 6 Aug 2021 12:23:52 +0000 (15:23 +0300)]
os/bluestore: fix missing 'l_bluestore_write_deferred' perf counter increment

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

3 years agoos/bluestore: cosmetic cleanups
Igor Fedotov [Fri, 6 Aug 2021 12:09:40 +0000 (15:09 +0300)]
os/bluestore: cosmetic cleanups

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

3 years agoMerge pull request #42679 from callithea/wip-51992-pacific
Ernesto Puerta [Thu, 12 Aug 2021 17:33:21 +0000 (19:33 +0200)]
Merge pull request #42679 from callithea/wip-51992-pacific

pacific: monitoring/grafana/cluster: use per-unit max and limit values

3 years agoMerge pull request #42755 from guits/wip-50896-pacific
Guillaume Abrioux [Thu, 12 Aug 2021 11:35:45 +0000 (13:35 +0200)]
Merge pull request #42755 from guits/wip-50896-pacific

pacific: ceph-volume: Consider /dev/root as mounted

3 years agoceph-volume: work around phantom atari partitions 42753/head
Blaine Gardner [Fri, 23 Jul 2021 18:56:35 +0000 (12:56 -0600)]
ceph-volume: work around phantom atari partitions

See Rook issue https://github.com/rook/rook/issues/7940 for full
information.

Ceph bluestore disks can sometimes appear as though they have "phantom"
Atari (AHDI) partitions created on them when they don't in reality. This
is due to a series of bugs in the Linux kernel when it is built with
Atari support enabled. This behavior does not appear for raw mode OSDs on
partitions, only on disks.

Changing the on-disk format of Bluestore OSDs comes with
backwards-compatibility challenges, and fixing the issue in the Kernel
could be years before users get a fix. Working around the Kernel issue
in ceph-volume is therefore the best place to fix the issue for Ceph.

To work around the issue in Ceph volume, there are two behaviors that need
adjusted:
1. `ceph-volume inventory` should not report that a partition is
   available if the parent device is a BlueStore OSD.
2. `ceph-volume raw list` should report parent disks if the disk is a
   BlueStore OSD and not report the disk's children, BUT it should still
   report children if the parent disk is not a BlueStore OSD.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
(cherry picked from commit 9212420bbc88e0caaf0b2302dd1f379f563f7d26)

3 years agoceph-volume: use safer check for bluestore label
Blaine Gardner [Mon, 19 Jul 2021 17:57:09 +0000 (11:57 -0600)]
ceph-volume: use safer check for bluestore label

Using only the exit status of `ceph-bluestore-tool show-label` to
determine if a device is a bluestore OSD could report a false negative
if there is a system error when `ceph-bluestore-tool` opens the device.

A better check is to open the device and read the bluestore device
label (the first 22 bytes of the device) to look for the bluestore
device signature ("bluestore block device"). If ceph-volume fails to
open the device due to a system error, it is safest to assume the device
is BlueStore so that an existing OSD isn't overwritten.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
(cherry picked from commit 651b28f2e3cb39dbe9c7038cd677a01523f08821)

3 years agoceph-volume: consider /dev/root mounted 42755/head
David Caro [Fri, 7 May 2021 15:58:23 +0000 (17:58 +0200)]
ceph-volume: consider /dev/root mounted

Fixes: https://tracker.ceph.com/issues/50604
Signed-off-by: David Caro <david@dcaro.es>
(cherry picked from commit c7b959c35ff463cfbffa2abf0f56a1c1a5f594c8)

3 years agoMerge pull request #42493 from dsavineau/wip-51852-pacific
Guillaume Abrioux [Wed, 11 Aug 2021 14:32:13 +0000 (16:32 +0200)]
Merge pull request #42493 from dsavineau/wip-51852-pacific

pacific: ceph-volume: lvm batch: fast_allocations(): avoid ZeroDivisionError

3 years agoMerge pull request #42546 from dsavineau/wip-51958-pacific
Guillaume Abrioux [Wed, 11 Aug 2021 14:29:33 +0000 (16:29 +0200)]
Merge pull request #42546 from dsavineau/wip-51958-pacific

pacific: ceph-volume/tests: retry when destroying osd

3 years agocephadm: fix container name detection 42736/head
Sage Weil [Mon, 9 Aug 2021 18:15:28 +0000 (14:15 -0400)]
cephadm: fix container name detection

'enter' was broken because we weren't correctly identifying the container
name.  Strip the newline from the inspect result so that we can reliably
match against the 'running' state.

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

3 years agocephadm: add AlmaLinux to supported distro
Dimitri Savineau [Thu, 5 Aug 2021 17:47:56 +0000 (13:47 -0400)]
cephadm: add AlmaLinux to supported distro

AlmaLinux [1] is an open-source 1:1 binary compatible fork of RHEL.

[1] https://almalinux.org/

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit f450f25bcf2ddd3322efca8f0c21eba90178840d)

3 years agodoc/cephadm: update documentation
Guillaume Abrioux [Thu, 5 Aug 2021 10:02:19 +0000 (12:02 +0200)]
doc/cephadm: update documentation

This commit fixes a couple of typos in the cephadm documentation.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 32b2c57bf66ccb030e24f78e3a5902babc1bbb38)

3 years agocephadm: fix unit tests.
Sebastian Wagner [Thu, 5 Aug 2021 07:53:09 +0000 (09:53 +0200)]
cephadm: fix unit tests.

Fixes AttributeError: 'FakePipeWrapper' object has no attribute 'readable'

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit 61cfaec7002caadb3b4e09d672919ed159853311)

3 years agodoc/cephadm: Offline hosts will pause upgrades
Sebastian Wagner [Thu, 5 Aug 2021 08:27:01 +0000 (10:27 +0200)]
doc/cephadm: Offline hosts will pause upgrades

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit 1eb48e3876d0b1fab7d1fac2574639112d39a8bf)

3 years agocephadm: Introduce unit.stop
Sebastian Wagner [Wed, 21 Jul 2021 12:13:52 +0000 (14:13 +0200)]
cephadm: Introduce unit.stop

Reason is we now have to stop two containers named differently. This is possible
with `bash -c ... echo %i | tr . -`. But we're not gainig anything readability
compared to putting it into a unit.stop script.

As not all daemons have this stop script, we still have to call podman for old daemons.

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit 0f66a5198e38c59aba1be11d586d49ad01c9afce)

3 years agocephadm: don't log on exit.
Sebastian Wagner [Wed, 21 Jul 2021 09:46:16 +0000 (11:46 +0200)]
cephadm: don't log on exit.

At this point, the garbage collector already colleceted the `open` function

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit 71162c6fea7aba2e30cf50d8a0f1a5a0cf3b2462)

3 years agocephadm: `stats` might return `--` for containers
Sebastian Wagner [Mon, 19 Jul 2021 10:13:11 +0000 (12:13 +0200)]
cephadm: `stats` might return `--` for containers

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit d183661be552acf7f30fce2e038173c5bdfa8421)

3 years agocephadm: exec: also search for old cname
Sebastian Wagner [Wed, 14 Jul 2021 13:15:50 +0000 (15:15 +0200)]
cephadm: exec: also search for old cname

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit a57ab6f50968921b26b87695e704f84a25101597)

3 years agocephadm: dashes: use both cnames for `inspect`
Sebastian Wagner [Tue, 13 Jul 2021 14:56:06 +0000 (16:56 +0200)]
cephadm: dashes: use both cnames for `inspect`

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit a1f9959df474e671e979849450f8a00d0e24ea72)

3 years agocephadm: Add CephContainer.for_daemon()
Sebastian Wagner [Mon, 19 Jul 2021 09:45:54 +0000 (11:45 +0200)]
cephadm: Add CephContainer.for_daemon()

To avoid calling get_container()

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit bb0587b8e0bde24d9bbfed7c65e0d351c5f7446b)

3 years agocephadm: use dashes for container names
Sebastian Wagner [Thu, 8 Jul 2021 09:52:52 +0000 (11:52 +0200)]
cephadm: use dashes for container names

podman adds the current container name to the /etc/hosts
file. Turns out, python's `socket.getfqdn()` differs from
`hostname -f`, when we have the container names containing
dots in it.:

[root@sebastians-laptop /]# cat /etc/hosts
127.0.0.1   localhost
::1         localhost
127.0.1.1   sebastians-laptop foo.bar.baz.com
[root@sebastians-laptop /]# hostname -f
sebastians-laptop
[root@sebastians-laptop /]# python3 -c 'import socket; print(socket.getfqdn())'
foo.bar.baz.com

Fascinatingly, this doesn't happen when using dashes.

Fixes: https://tracker.ceph.com/issues/51590
Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit 67abea15b12c1a60a9da2db35e3470d8d8a128f7)

3 years agodoc/cephadm: MON IP change
Sebastian Wagner [Fri, 23 Jul 2021 08:09:08 +0000 (10:09 +0200)]
doc/cephadm: MON IP change

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit 9df20490b210cf0e5fcf17920e91d390989cc4bf)

3 years agodoc/cephadm: Move some sections from mon.rst to serivce-management.rst
Sebastian Wagner [Fri, 23 Jul 2021 07:54:14 +0000 (09:54 +0200)]
doc/cephadm: Move some sections from mon.rst to serivce-management.rst

Avoid duplication and instead only reference the corresponding sections.

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit 24b753f2c8111305cf73de9b40a393c0c1a9bae7)

3 years agocephadm: Clarify no container engine message
Sebastian Wagner [Mon, 19 Jul 2021 08:23:52 +0000 (10:23 +0200)]
cephadm: Clarify no container engine message

Multiple people didn't understand the message. Let's try to impove it.

(Also make mypy happy)

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit 240b2435bad903b811a3279b0e7a5d0806ee0b93)

3 years agocephadm: Add missing type annotations
Sebastian Wagner [Tue, 3 Aug 2021 12:38:32 +0000 (14:38 +0200)]
cephadm: Add missing type annotations

Turnd out `command_maintenance` missing an if-branch that returned
None instead of a str

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit 0c78d239a1933338fea14e21fde2638a418bc660)

Conflicts:
src/cephadm/cephadm

3 years agocephadm: set global default container for ingress
Dimitri Savineau [Fri, 30 Jul 2021 19:27:52 +0000 (15:27 -0400)]
cephadm: set global default container for ingress

This was partially done in b94c8de but only for haproxy in the cephadm
mgr module not in the cephadm binary.
This adds the same change for keepalived container image.
Now both haproxy and keepalived container images are fully qualified
(registry + namespace + image).

Fixes: https://tracker.ceph.com/issues/51973
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit f9eb7d826563ab9b995b4123c03f6d1b89423e01)

3 years agodoc/cephadm: update about disabling logging to journald for quincy
Varsha Rao [Tue, 3 Aug 2021 11:51:45 +0000 (17:21 +0530)]
doc/cephadm: update about disabling logging to journald for quincy

Signed-off-by: Varsha Rao <varao@redhat.com>
(cherry picked from commit bdb2241ca5a9758e8c52d47320d8b5ea0766aea9)

3 years agodoc/cephadm: remove repeated section on disabling logging to stderr
Varsha Rao [Wed, 28 Jul 2021 09:27:41 +0000 (14:57 +0530)]
doc/cephadm: remove repeated section on disabling logging to stderr

Signed-off-by: Varsha Rao <varao@redhat.com>
(cherry picked from commit 9691f76d46cd2d2a0fa4f7ec776e0689c3c22413)

3 years agodoc/cephadm: linking to log material
Zac Dover [Tue, 20 Jul 2021 00:08:47 +0000 (10:08 +1000)]
doc/cephadm: linking to log material

This PR rewrites a section in the Troubleshooting
chapter of the Cephadm Guide. The material that this
section discusses has been covered already in the
Cephadm Guide in the Cephadm Operations chapter.
There's no reason to repeat this information twice,
unless adding technical debt to the documentation
is our goal (which of course it is not, and the
opposite of adding technical debt to the documentation
has been the aim that has guided my work these past
six months).

Signed-off-by: Zac Dover <zac.dover@gmail.com>
(cherry picked from commit d0a6903274a9f9335b1d4dc31504fac03943521b)

3 years agomgr/cephadm: make return message for entering maintenance mode more explicit
Adam King [Thu, 29 Jul 2021 18:30:00 +0000 (14:30 -0400)]
mgr/cephadm: make return message for entering maintenance mode more explicit

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 8b3493e5513b98ae4480323e2b6ac6e1ce8d257a)

3 years agomgr/cephadm: don't return hosts in offline_hosts set as schedulable
Adam King [Mon, 19 Jul 2021 16:19:15 +0000 (12:19 -0400)]
mgr/cephadm: don't return hosts in offline_hosts set as schedulable

we are only checking for host status here but we
should also be checking the offline_hosts set

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

3 years agomgr/cephadm: fix unit test for don't touch offline hosts
Adam King [Mon, 19 Jul 2021 16:14:16 +0000 (12:14 -0400)]
mgr/cephadm: fix unit test for don't touch offline hosts

We use an offline_hosts set for marking offline hosts
rather than the host status so changing this unit test
to reflect that

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 141072bc71b23d10554cb3b3414451a7eda76ce4)

3 years agomgr/cephadm: stop removal of daemons from offline hosts
Adam King [Mon, 19 Jul 2021 16:07:39 +0000 (12:07 -0400)]
mgr/cephadm: stop removal of daemons from offline hosts

This check was only looking for the status of the
host and not looking at the offline_hosts set so
it wasn't actually stopping daemons from being removed
from offline hosts

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 7c138ed52d806726f5e0a1548d958af0f95813e8)

3 years agomgr/cephadm: fix exceptions causing stuck progress indicators
Cory Snyder [Thu, 29 Jul 2021 20:08:19 +0000 (16:08 -0400)]
mgr/cephadm: fix exceptions causing stuck progress indicators

Added a try block to ensure that progress of applying a service spec is updated as failed in the case of exceptions.

Fixes: https://tracker.ceph.com/issues/51961
Signed-off-by: Cory Snyder <csnyder@iland.com>
(cherry picked from commit f247a7bed24756ba8a6f02579c98813931497421)

3 years agocephadm: validate fsid during ceph-volume command
Michael Fritch [Tue, 27 Jul 2021 21:56:25 +0000 (15:56 -0600)]
cephadm: validate fsid during ceph-volume command

Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit f0609429c05a70b6e6e7f131f56468e704be9640)

3 years agocephadm: validate fsid during shell command
Michael Fritch [Mon, 26 Jul 2021 22:58:54 +0000 (16:58 -0600)]
cephadm: validate fsid during shell command

Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit 25febfd9e081eaa275faa786102d59522ddba405)

3 years agocephadm: `ceph-volume` should raise fsid mismatch
Michael Fritch [Wed, 14 Jul 2021 20:43:00 +0000 (14:43 -0600)]
cephadm: `ceph-volume` should raise fsid mismatch

raise an fsid mismatch error when passed differing fsids via `--fsid` and `--config`:

```
self = <tests.test_cephadm.TestCephVolume object at 0x7f1c711961f0>, cephadm_fs = <pyfakefs.fake_filesystem.FakeFilesystem object at 0x7f1c713addc0>

    def test_fsid(self, cephadm_fs):
        cv_cmd = ['--', 'inventory', '--format', 'json']
        fsid = '00000000-0000-0000-0000-0000deadbeef'

        cmd = ['ceph-volume', '--fsid', fsid] + cv_cmd
        with with_cephadm_ctx(cmd) as ctx:
            cd.command_ceph_volume(ctx)
            assert ctx.fsid == fsid

        s = get_ceph_conf(fsid=fsid)
        f = cephadm_fs.create_file('ceph.conf', contents=s)

        cmd = ['ceph-volume', '--fsid', fsid, '--config', f.path] + cv_cmd
        with with_cephadm_ctx(cmd) as ctx:
            cd.command_ceph_volume(ctx)
            assert ctx.fsid == fsid

        cmd = ['ceph-volume', '--fsid', '10000000-0000-0000-0000-0000deadbeef', '--config', f.path] + cv_cmd
        with with_cephadm_ctx(cmd) as ctx:
            err = 'fsid does not match ceph.conf'
            with pytest.raises(cd.Error, match=err):
                cd.command_ceph_volume(ctx)
>               assert ctx.fsid == None
E               AssertionError: assert '10000000-0000-0000-0000-0000deadbeef' == None
E                +  where '10000000-0000-0000-0000-0000deadbeef' = <cephadm.CephadmContext object at 0x7f1c7121c1c0>.fsid
```

Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit d9198d8668055fdc9e5c3c58668a6aeeda61df4a)

3 years agocephadm: add `ceph-volume` tests
Michael Fritch [Wed, 14 Jul 2021 21:32:05 +0000 (15:32 -0600)]
cephadm: add `ceph-volume` tests

add basic ceph-volume tests for `--fsid`, `--config`, and `--keyring`

Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit 2d2bb9f96d7c34fab3e8d25c77986ab1a319fa1b)

3 years agocephadm: remove `get_parm` mock
Michael Fritch [Thu, 15 Jul 2021 14:01:48 +0000 (08:01 -0600)]
cephadm: remove `get_parm` mock

fixture does not need to patch the `get_parm` func

Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit b589ae68fa63ddb303a60232fe14200443bca0cc)

3 years agocephadm: don't use ctx.fsid for clean_cgroup
Dimitri Savineau [Wed, 28 Jul 2021 20:52:05 +0000 (16:52 -0400)]
cephadm: don't use ctx.fsid for clean_cgroup

The clean_cgroup method assumes that the ctx.fsid is set while this is
true for the bootstrap command, it isn't set for adopt or deploy commands
(and maybe others).

This ends up to the adopt command to fails:

Traceback (most recent call last):
  File "/sbin/cephadm", line 8301, in <module>
    main()
  File "/sbin/cephadm", line 8289, in main
    r = ctx.func(ctx)
  File "/sbin/cephadm", line 1764, in _default_image
    return func(ctx)
  File "/sbin/cephadm", line 5091, in command_adopt
    command_adopt_ceph(ctx, daemon_type, daemon_id, fsid)
  File "/sbin/cephadm", line 5299, in command_adopt_ceph
    osd_fsid=osd_fsid)
  File "/sbin/cephadm", line 2884, in deploy_daemon_units
    clean_cgroup(ctx, unit_name)
  File "/sbin/cephadm", line 2724, in clean_cgroup
    if not ctx.fsid:
  File "/sbin/cephadm", line 155, in __getattr__
    return super().__getattribute__(name)
AttributeError: 'CephadmContext' object has no attribute 'fsid'

Since we already have the fsid value in deploy_daemon_units (which calls
clean_cgroup) then we can pass the fsid value directly.

This fixes a regression introduced by 1fee255

Fixes: https://tracker.ceph.com/issues/51902
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 3907ce7d6e091f87c3bd4437d13951ee838dc02b)

3 years agocephadm: don't fail hard on SameFileError during shutil.copy
Adam King [Wed, 21 Jul 2021 18:42:44 +0000 (14:42 -0400)]
cephadm: don't fail hard on SameFileError during shutil.copy

Fixes: https://tracker.ceph.com/issues/51829
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 3909be178addb6f692d97651bfdaf9ae742497f1)

3 years agomgr/cephadm: ingress: fix typo in spec.virtual_interface_networks reference
Asbjørn Sannes [Sun, 18 Jul 2021 09:35:44 +0000 (11:35 +0200)]
mgr/cephadm: ingress: fix typo in spec.virtual_interface_networks reference

When using virtual_inteface_networks to identify the interface to have the
virtual ip on, it referenced spec.networks instead of
spec.virtual_interface_networks.

Fixes: https://tracker.ceph.com/issues/51721
Signed-off-by: Asbjørn Sannes <asbjorn.sannes@interhost.no>
(cherry picked from commit 024c6aba01362e18ff02d88004b501663dbfdeed)

3 years agomgr/cephadm: Don't allow stopping full mgr, mon or osd services
Adam King [Fri, 23 Jul 2021 14:01:54 +0000 (10:01 -0400)]
mgr/cephadm: Don't allow stopping full mgr, mon or osd services

I can't think of any case where we would want to allow this

Fixes: https://tracker.ceph.com/issues/51298
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 6402c587d006f8e179f01ec2007828bb5fbf5489)

3 years agomgr/cephadm/grafana: check if dashboard is enabled
Dimitri Savineau [Fri, 23 Jul 2021 15:03:42 +0000 (11:03 -0400)]
mgr/cephadm/grafana: check if dashboard is enabled

When deploying the grafana service but the mgr dashboard isn't enabled then
dashboard set-grafana-api-ssl-verify command fails.

Closes: https://tracker.ceph.com/issues/51796
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 16bb5b8076a6df30b1e6323b406fee0ba6cc2b39)

3 years agomgr/cephadm/iscsi: simplify the dashboard check
Dimitri Savineau [Fri, 23 Jul 2021 15:14:25 +0000 (11:14 -0400)]
mgr/cephadm/iscsi: simplify the dashboard check

We don't need to run an extra command (mgr module ls) to obtain the mgr
modules list since we already have this information in the mgr_map.
This workflow is already done for the monitoring stack or for configuring
the iscsi integration within the dashboard (during creation) via the
config_dashboard method.

The mgr_map is mocked in the tests with the dashboard module enabled so we
don't need _mon_command_mock_mgr_module_ls anymore.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit a6808efca4535f10c5639ee0a6a517c110da3f44)

3 years agomgr/cephadm: Fix haproxy not being recognized as a proper daemon
Sebastian Wagner [Wed, 21 Jul 2021 08:45:51 +0000 (10:45 +0200)]
mgr/cephadm: Fix haproxy not being recognized as a proper daemon

Turns out daemon types != service types:

    cephadm [WRN] Found unknown service type haproxy on host smithi019
    cephadm [WRN] Found unknown service type keepalived on host smithi019

leading to `self.mgr.cache.get_daemons_by_service(spec.service_name())`
not returning any daemons.

Fixes: https://tracker.ceph.com/issues/51311
Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit a8f1cf2edb0ef5b48632af8da9577c8a42a6ff60)

3 years agomgr/cephadm/templates: add jinja2 lint
Dimitri Savineau [Wed, 14 Jul 2021 18:57:51 +0000 (14:57 -0400)]
mgr/cephadm/templates: add jinja2 lint

This adds a jinja2 lint environment in tox for testing the cephadm jinja2
templates.

This patch fixes some minor jinja2 syntax for ganesha and keepalived even if
the current templates work perfectly.

Tags should have one (and only one) space

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 9eac2fba90a3b179087455100e494d7da6b0910e)

3 years agocephadm: haproxy 2.4 defaults to a different container user.
Sebastian Wagner [Tue, 20 Jul 2021 14:09:57 +0000 (16:09 +0200)]
cephadm: haproxy 2.4 defaults to a different container user.

Another alternative would be to investigage a different setup
leverageing `--sysctl net.ipv4.ip_unprivileged_port_start=0`,
but that would be a larger PR.

Fixes: https://tracker.ceph.com/issues/51355
Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit 250064bdcbe778b3cc245df843d14dd19cbb8772)

3 years agocephadm: use pyfakefs during `test_create_daemon_dirs_prometheus`
Michael Fritch [Fri, 9 Jul 2021 19:35:52 +0000 (13:35 -0600)]
cephadm: use pyfakefs during `test_create_daemon_dirs_prometheus`

convert test to use the `cephadm_fs` fixture

Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit f853ce7e9a52b4abd0f6626ca13886bd0e2e36a6)

3 years agocephadm: use CephadmContext rather than MagicMock
Michael Fritch [Fri, 9 Jul 2021 01:35:42 +0000 (19:35 -0600)]
cephadm: use CephadmContext rather than MagicMock

MagicMock hides attribute errors:

```
self = <cephadm.CephadmContext object at 0x7f1121e62370>, name = 'config_json'

    def __getattr__(self, name: str) -> Any:
        if '_conf' in self.__dict__ and hasattr(self._conf, name):
            return getattr(self._conf, name)
        elif '_args' in self.__dict__ and hasattr(self._args, name):
            return getattr(self._args, name)
        else:
>           return super().__getattribute__(name)
E           AttributeError: 'CephadmContext' object has no attribute 'config_json'
```

Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit 4a99b771a4a59671728e072bb27270bba8cb78c8)

3 years agocephadm: add `infer_config` unit test
Michael Fritch [Mon, 28 Jun 2021 17:48:06 +0000 (11:48 -0600)]
cephadm: add `infer_config` unit test

Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit 53d07362ff8efa5846fd6067b469923457d5ac8d)

3 years agocephadm: add `shell` command tests
Michael Fritch [Fri, 25 Jun 2021 03:10:31 +0000 (21:10 -0600)]
cephadm: add `shell` command tests

Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit e6dca29ae7513c2555aacf953a5d4ec7fb7ea0bb)