Commit Graph

436 Commits

Author SHA1 Message Date
Sage Weil
dcb5e9b6d8 Merge PR #32098 into master
* refs/pull/32098/head:
	ceph-daemon: py2: tolerate whitespace before config key name

Reviewed-by: Sebastian Wagner <swagner@suse.com>
2019-12-09 18:29:41 -06:00
Sage Weil
bffe2dd9e9 Merge PR #32046 into master
* refs/pull/32046/head:
	mgr/DaemonServer: fix 'osd ok-to-stop' for EC pools

Reviewed-by: Neha Ojha <nojha@redhat.com>
2019-12-09 15:34:57 -06:00
Sage Weil
3036d11c60 ceph-daemon: py2: tolerate whitespace before config key name
The py2 ConfigParser doesn't like whitespace before the config option
name.  (The py3 version doesn't care.)  Filter it out before parsing.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-12-09 07:15:13 -06:00
Sage Weil
ade391513c ceph-daemon: remove prepare-host
I thought I took this out of the PR but somehow it got merged in... must
have repushed and old branch and not realized.  :/

Signed-off-by: Sage Weil <sage@redhat.com>
2019-12-08 11:26:14 -06:00
Sage Weil
86950ce9aa Merge PR #32039 into master
* refs/pull/32039/head:
	test: Improve races by using kill_daemons which waits for OSDs terminate
	test: run-standalone.sh: Only run execs in the subdirectories of qa/standalone
	test: Use activate_osd() when restarting OSDs
	test: osd-scrub-snaps.sh: Fix race with osd restart and doing a scrub

Reviewed-by: Neha Ojha <nojha@redhat.com>
2019-12-07 12:28:15 -06:00
David Zafman
676d882649 test: Improve races by using kill_daemons which waits for OSDs terminate
osd-backfill-space.sh: More sleep time to make sure the backfill gets started

Signed-off-by: David Zafman <dzafman@redhat.com>
2019-12-06 19:44:06 -08:00
David Zafman
43f6218993 test: Use activate_osd() when restarting OSDs
Signed-off-by: David Zafman <dzafman@redhat.com>
2019-12-05 15:13:31 -08:00
David Zafman
cca541d0f9 test: osd-scrub-snaps.sh: Fix race with osd restart and doing a scrub
Fixes: https://tracker.ceph.com/issues/43150

Signed-off-by: David Zafman <dzafman@redhat.com>
2019-12-05 15:12:43 -08:00
Sage Weil
66690ea314 mgr/DaemonServer: fix 'osd ok-to-stop' for EC pools
We need to pay attention to account for CRUSH_ITEM_NONE entries in the
EC PG acting set.

Fixes: https://tracker.ceph.com/issues/43151
Signed-off-by: Sage Weil <sage@redhat.com>
2019-12-05 14:31:24 -06:00
Sage Weil
91cb6eb613 ceph-daemon: add check-host and prepare-host
Check for (and/or install/configure):

- podman | docker
- systemctl
- LVM2
- chrony (or ntp or timesyncd)

Signed-off-by: Sage Weil <sage@redhat.com>
2019-12-04 09:22:06 -06:00
Sage Weil
1770270af6 Merge PR #31869 into master
* refs/pull/31869/head:
	ceph-daemon: bootstrap: deploy initial mon via deploy_daemon()
	qa/standalone/test_ceph_daemon.sh: more $SUDO
	ceph-daemon: configure firewalld for new daemon deploys
	ceph-daemon: name mgr the same way mgr/ssh does

Reviewed-by: Michael Fritch <mfritch@suse.com>
2019-12-03 16:00:14 -06:00
Sage Weil
8aadba15bf qa/standalone/test_ceph_daemon.sh: more $SUDO
Signed-off-by: Sage Weil <sage@redhat.com>
2019-12-03 10:13:37 -06:00
Sage Weil
2c1235ba69 Merge PR #31913 into master
* refs/pull/31913/head:
	ceph-daemon: Allow env var for setting the used image

Reviewed-by: Michael Fritch <mfritch@suse.com>
Reviewed-by: Sage Weil <sage@redhat.com>
2019-12-02 16:26:33 -06:00
Thomas Bechtold
45bae8219a ceph-daemon: Allow env var for setting the used image
Instead of always adding "--image my-custom-image" when calling
ceph-daemon with a non-standard image, allow to set the environment
variable called CEPH_DAEMON_IMAGE which will adjust the --image
default.
That way, the command line arguments when using ceph-daemon with a
custom image are a bit shorter.

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
2019-11-28 09:06:18 +01:00
David Zafman
9d2e0267e1 test: Add test case based on Xie script in commit comment
Other test fixes to reflect changes

Signed-off-by: David Zafman <dzafman@redhat.com>
2019-11-27 16:29:29 -08:00
David Zafman
0af7e25620 mgr: Fix balancer print
Signed-off-by: David Zafman <dzafman@redhat.com>
2019-11-27 16:29:29 -08:00
Sage Weil
61ba2d7b66 Merge PR #31677 into master
* refs/pull/31677/head:
	qa/standalone/ceph-helpers.sh: remove osd down check
	qa/standalone/ceph-helpers.sh: destroy_osd: mark osd down
	osd: add osd_fast_shutdown option (default true)

Reviewed-by: Sébastien Han <seb@redhat.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Reviewed-by: Neha Ojha <nojha@redhat.com>
2019-11-25 08:54:45 -06:00
Sage Weil
3a62d166a7 qa/standalone/ceph-helpers.sh: remove osd down check
A kill doesn't induce a mark-down of the OSD with osd_fast_shutdown=true.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-11-24 12:19:33 -06:00
Sage Weil
07193aec3a qa/standalone/test_ceph_daemon.sh: remove old vg before creating
Signed-off-by: Sage Weil <sage@redhat.com>
2019-11-20 18:27:31 -06:00
Sage Weil
fd6bfad498 qa/standalone/test_ceph_daemon.sh: sudo for untar
The deepsea.tgz tar contains actual device nodes for the OSD block devices
(not symlinks or files).  Must be root to untar.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-11-20 18:27:31 -06:00
Sage Weil
723fdb111a qa/standalone/test_ceph_daemon.sh: sudo for losetup etc
Signed-off-by: Sage Weil <sage@redhat.com>
2019-11-20 18:27:31 -06:00
Sage Weil
cb67545e99 qa/standalone/test_ceph_daemon.sh: fix overwrites of temp files
mktemp creates these files, so we have to pass --allow-overwrite (or
delete them after we get the unique name but before we write to them--this
is easier).

Broken by c7fe27a72a

Signed-off-by: Sage Weil <sage@redhat.com>
2019-11-20 18:27:31 -06:00
Sage Weil
ede1d36773 qa/standalone/ceph-helpers.sh: destroy_osd: mark osd down
Stopping the OSD doesn't guarantee that it will be marked down.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-11-19 20:05:16 -06:00
Michael Fritch
5cb5e77f50
ceph-daemon: add osd create test(s)
Signed-off-by: Michael Fritch <mfritch@suse.com>
2019-11-18 22:30:22 -07:00
Michael Fritch
479e9be91c
ceph-daemon: add standalone adopt tests
Signed-off-by: Michael Fritch <mfritch@suse.com>
2019-11-13 16:51:59 -07:00
Sridhar Seshasayee
8819c3c37a
Merge pull request #31416 from sseshasa/wip-41666-replicaSizeWarn
osd/OSDMap: Show health warning if a pool is configured with size 1

Reviewed-by: Sage Weil <sweil@redhat.com>
Reviewed-by: David Zafman <dzafman@redhat.com>
Reviewed-by: Neha Ojha <nojha@redhat.com>
2019-11-12 12:06:46 +05:30
Sridhar Seshasayee
33c647e811 osd/OSDMap: Show health warning if a pool is configured with size 1
Introduce a config option called 'mon_warn_on_pool_no_redundancy' that is
used to show a health warning if any pool in the ceph cluster is
configured with a size of 1. The user can mute/unmute the warning using
'ceph health mute/unmute POOL_NO_REDUNDANCY'.

Add standalone test to verify warning on setting pool size=1. Set the
associated warning to 'false' in ceph.conf.template under qa/tasks so
that existing tests do not break.

Fixes: https://tracker.ceph.com/issues/41666
Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-11-11 10:36:35 +05:30
Thomas Bechtold
4258c4772a ceph-daemon: Move ceph-daemon executable to own directory
Moving ceph-daemon into src/ceph-daemon/ makes it simpler to add extra
code (eg. tox.ini, README, unittests, ...) specific to ceph-daemon.
That way related files are in a single directory.

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
2019-11-08 17:05:57 +01:00
Sage Weil
5def1df5e8 Merge PR #31064 into master
* refs/pull/31064/head:
	test: Test balancer module commands
	mgr: Improve balancer module status
	mgr: Release GIL before calling OSDMap::calc_pg_upmaps()

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2019-11-07 10:57:56 -06:00
Thomas Bechtold
5eaf133038 qa/standalone/test_ceph_daemon: Make container images configurable
Instead of hardcoding the images, make them configureable via
environment variables.
That way, downstream can use the script with custom images.

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
2019-11-06 16:24:17 +01:00
Thomas Bechtold
b04b8f7398 qa/standalone/test_ceph_daemon: Allow running from root dir
Allow running the script from root directory via:

./qa/standalone/test_ceph_daemon.sh

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
2019-11-06 16:11:46 +01:00
Thomas Bechtold
a004d92ae0 qa/standalone/test_ceph_daemon: Fix hang when CEPH_DAEMON is not set
When running test_ceph_daemon.sh from the root dir and not setting
$CEPH_DAEMON manually, the call hangs at:

$ ./qa/standalone/test_ceph_daemon.sh
[...]
+ for p in $PYTHONS
+ echo '=== re-running with python3 ==='
=== re-running with python3 ===
++ which python3
+ ln -s /usr/bin/python3 /tmp/tmp.6hneCsNMio/python
+ echo '#!/tmp/tmp.6hneCsNMio/python'
+ cat

Check that there is a ceph-daemon found before continue.

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
2019-11-06 16:09:55 +01:00
Sage Weil
f5c7a8c986 qa/standalone/test_ceph_daemon: fix multi-version python test
We have to rewrite the shebang line, since it is no longer just
'#/usr/bin/env python' (as of e12ad1b016).

Signed-off-by: Sage Weil <sage@redhat.com>
2019-11-03 10:09:06 -06:00
Sage Weil
df40a49eb8 ceph-daemon: use client.admin keyring during bootstrap
It's usually okay to use the mon. key for CLI commands, except we had a
mgr but that prevented you from issuing mgr commands correctly.  We have
the new client.admin key available, so use that instead.

Update tests to not --skip-ssh (now that it doesn't hang).

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-30 14:07:52 -05:00
Sage Weil
debde146d2 qa/standalone/test_ceph_damon.sh: test with python2 and python3
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-28 12:15:47 -05:00
Sage Weil
b830870bbb Merge PR #31130 into master
* refs/pull/31130/head:
	ceph-daemon: only set up crash dir mount if it exists

Reviewed-by: Sebastian Wagner <swagner@suse.com>
2019-10-25 09:18:20 -05:00
David Zafman
3a0e2c8ff1 test: Test balancer module commands
Signed-off-by: David Zafman <dzafman@redhat.com>
2019-10-24 18:56:19 -07:00
Sage Weil
f56a8db34d ceph-daemon: only set up crash dir mount if it exists
Sometimes we run containers on a host that doesn't have a crash dir set
up (becuase no daemon has been deployed).  Examples include shell and
ceph-volume.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-24 20:06:23 -05:00
David Zafman
4ea43f7342
Merge pull request #31133 from dzafman/wip-42476
ceph-objectstore-tool: call collection_bits() crashes on the meta col…

Reviewed-by: Sage Weil <sage@redhat.com>
2019-10-24 17:23:48 -07:00
David Zafman
2d79e77b6a ceph-objectstore-tool: call collection_bits() crashes on the meta collection
Skip new check for meta collection
test:
    Turn off osd_pool_default_pg_autoscale_mode just like bash tests do
    Fix test by checking for new error message

Caused by: f88b353454

Fixes: https://tracker.ceph.com/issues/42476

Signed-off-by: David Zafman <dzafman@redhat.com>
2019-10-24 11:37:30 -07:00
Sage Weil
29c97547a9 Merge PR #30859 into master
* refs/pull/30859/head:
	auth: EACCES, not EPERM
	mon: shunt old tell commands from cli interface to asok
	mon: allow mgr to tell mon.foo smart
	mon: include quorum features in quorum_status
	qa/workunits/mon/caps.sh: fix test
	ceph_test_rados_api_cmd: fix MonDescribe test
	Merge branch 'vstart-fs-auth' of git://github.com/batrick/ceph into wip-cleanup-mon-asok
	test/pybind/test_ceph_argparse: fix tests
	vstart: add volume client keys to keyring
	vstart: use fs authorize to create master client key
	vstart: redirect some output to stderr
	vstart: output command strings to stderr
	qa/workunits/cephtool/test.sh: fix 'quorum enter' caller
	qa: change mon_status calls to quorum_status or tell commands
	mon: fix 'heap ...' command
	mon: consolidate 'sync force' commands
	mon: allow asok commands to return an error code
	mon: move 'quorum enter|exit' and 'mon_status' to asok
	mon: fix 'smart' asok command
	mon: remove old 'config set' and 'injectargs'

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2019-10-23 21:05:42 -05:00
Sage Weil
d7bd029b51 test_ceph_daemon: test unit, enter, shell
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-23 15:08:55 -05:00
Sage Weil
86b2c8dd60 ceph-daemon: drop exec
It's not identical to enter.  enter seems more intuitive to me, but that
may be because I'm not a longtime docker user.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-23 15:08:55 -05:00
Sage Weil
202d615d38 qa/standalone/test_ceph_daemon.sh: add new functional tests
- sudo as needed
- clean up afterward

There is still a bit of missing coverage, but this captures most of it.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-23 15:08:55 -05:00
Sage Weil
70367de903 qa: change mon_status calls to quorum_status or tell commands
The tests were doing logs of 'ceph mon_status'; change that to
quorum_status or tell.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-12 12:05:36 -05:00
Sage Weil
1e44d86b2c osd: change trigger_[deep_]scrub tommands to a pg tell command
This is cleaner.  All users are currently standalone tests; updated.

It also means that *all* commands that have a name=pgid arg are pg tell
commands.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 09:07:02 -05:00
Sage Weil
d8d2b71db5 qa/standalone/mon/health-mute: use power of 2 for pg_num
Signed-off-by: Sage Weil <sage@redhat.com>
2019-09-26 09:29:32 -05:00
Sage Weil
ab594b9b31 Merge PR #30475 into master
* refs/pull/30475/head:
	qa/standalone/ceph-helpers: default pg autoscale mode off for standalone
	os/bluestore: fix objectstore_blackhole read-after-write
	test,misc: do not specify pg_num per pool
	mgr/volumes: do not specify pg_num
	pybind/ceph_volume_client: do not specify pg_num for new pools
	doc: remove all pg_num arguments to 'osd pool create'
	mon: do not require pg_num to 'osd pool create'
	common: default pg_autoscale_mode=on for new pools

Reviewed-by: xie xingguo <xie.xingguo@zte.com.cn>
2019-09-23 09:12:42 -05:00
Sage Weil
f71672c6ad qa/standalone/ceph-helpers: default pg autoscale mode off for standalone
Signed-off-by: Sage Weil <sage@redhat.com>
2019-09-22 16:59:07 -05:00
Sage Weil
8994a65242 qa/standalone/osd/divergent-priors: add reproducer for bug 41816
Reproducer for https://tracker.ceph.com/issues/41816

Signed-off-by: Sage Weil <sage@redhat.com>
2019-09-21 10:09:15 -05:00