]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
4 years agomgr/cephadm: clean up misc messages
Sage Weil [Wed, 17 Mar 2021 19:49:47 +0000 (15:49 -0400)]
mgr/cephadm: clean up misc messages

- join list with ' '
- key, not keyring
- -ing, not ': '

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

4 years agomgr/cephadm/configcheck: do not spam info every minute
Sage Weil [Wed, 17 Mar 2021 19:43:33 +0000 (15:43 -0400)]
mgr/cephadm/configcheck: do not spam info every minute

It doesn't make to spam INF every minute.  Reducing this to DBG means
it'll never be seen.  Just remove it.

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

4 years agomgr/cephadm: stop conflicting daemon when deploying to a specific port
Sage Weil [Wed, 17 Mar 2021 19:39:15 +0000 (15:39 -0400)]
mgr/cephadm: stop conflicting daemon when deploying to a specific port

If we are deploying a daemon to bind to a specific port and there is
an existing daemon we are removing that also binds to that port, stop
it first.  Unless we are both binding to different IPs.

This resolves the case where daemons bind to * and we redeploy with a
subnet to bind to.  It would eventually converge before, but would
throw a bind error in the process and take longer.

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

4 years agomgr/cephadm: make DaemonPlacement print nicer
Sage Weil [Wed, 17 Mar 2021 19:38:57 +0000 (15:38 -0400)]
mgr/cephadm: make DaemonPlacement print nicer

'host(ip:port)' or 'host(*:port)' so we can show it to a user.

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

4 years agomgr/cephadm: fix --force remove comment
Sage Weil [Wed, 17 Mar 2021 18:42:34 +0000 (14:42 -0400)]
mgr/cephadm: fix --force remove comment

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

4 years agomgr/cephadm/schedule: choose an IP from a subnet list
Sage Weil [Thu, 11 Mar 2021 23:47:24 +0000 (18:47 -0500)]
mgr/cephadm/schedule: choose an IP from a subnet list

Choose an IP from the subnet list provided by the ServiceSpec.

A few caveats:
- we ignore hosts that don't have IPs in the given subnet
- the subnet matching is STRICT.  That is, the CIDR name has to exactly
match what is configured on the host.  That means you can't just say 10/8
to match any 10.whatever addres--you need the exactly network on the host
(e.g, 10.1.2.0/24).
- If you modify a servicespec and change the networks when there are
already deployed daemons, we will try to deploy the new instances on
the same ports but bound to a specific IP instead of *.  Which will fail.
You need to remove the service first, or remove the old daemons manually
so that creating new ones will succeed.

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

4 years agomgr/cephadm: rgw: clean up config and config-key values on removal
Sage Weil [Tue, 16 Mar 2021 16:58:52 +0000 (12:58 -0400)]
mgr/cephadm: rgw: clean up config and config-key values on removal

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

4 years agomgr/cephadm: rgw: drop .crt extension when storing cert in config-key
Sage Weil [Tue, 16 Mar 2021 16:58:03 +0000 (12:58 -0400)]
mgr/cephadm: rgw: drop .crt extension when storing cert in config-key

This will no affect upgrades since we will run the config() method before
prepare_create() any time we deploy a new daemon on this service, which
means we'll re-store the cert in the new key location before we generate
a new rgw_frontends option that references it.

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

4 years agomgr/cephadm/services: allow beast/civetweb to bind to a particular IP
Sage Weil [Thu, 11 Mar 2021 23:42:33 +0000 (18:42 -0500)]
mgr/cephadm/services: allow beast/civetweb to bind to a particular IP

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

4 years agopython-common: add 'networks' property to ServiceSpec
Sage Weil [Tue, 16 Mar 2021 22:59:56 +0000 (18:59 -0400)]
python-common: add 'networks' property to ServiceSpec

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

4 years agomgr/cephadm/schedule: match placement ip only combination with port
Sage Weil [Thu, 11 Mar 2021 23:40:22 +0000 (18:40 -0500)]
mgr/cephadm/schedule: match placement ip only combination with port

1- We only have an IP to bind to if we also have a port, and
2- If we do, we want an exact match: if the DaemonPlacement has ip of
   None, then the DaemonDescription should have None too.

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

4 years agomgr/cephadm: less noise about refreshing hosts
Sage Weil [Mon, 15 Mar 2021 18:47:39 +0000 (13:47 -0500)]
mgr/cephadm: less noise about refreshing hosts

These happen every ~10 minutes and will obscure any real messages of
interest.

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

4 years agomgr/cephadm: fall back to service spec port if none on DaemonDescription
Sage Weil [Mon, 15 Mar 2021 22:58:15 +0000 (18:58 -0400)]
mgr/cephadm: fall back to service spec port if none on DaemonDescription

For an RGW instance that is deployed in an older version, we won't have
IP or port metadata in the DaemonDescription.  In that case, fall back
to the port in the ServiceSpec.  This should be safe since any such
instance will only have 1 daemon per host.

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

4 years agomgr/cephadm: fix redeploy when daemons have ip:port
Sage Weil [Mon, 15 Mar 2021 19:34:13 +0000 (15:34 -0400)]
mgr/cephadm: fix redeploy when daemons have ip:port

The _daemon_action() method can be called directly by upgrade and by
the 'orch daemon <action> <name>' commands.  When this happens, construct
a CephadmDaemonDeploySpec from the DaemonDescription that incldes the
metadata we assigned when teh service was created: the IP and port(s).
This fixes upgrade and the CLI.

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

4 years agomgr/cephadm/schedule: add test case
Sage Weil [Thu, 11 Mar 2021 18:47:37 +0000 (13:47 -0500)]
mgr/cephadm/schedule: add test case

Matches wonky cephadm.py placement (+1 on the count).

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

4 years agoqa/suites/rados/cephadm/smoke-roleless: add rgw test on many ports
Sage Weil [Wed, 10 Mar 2021 21:54:28 +0000 (16:54 -0500)]
qa/suites/rados/cephadm/smoke-roleless: add rgw test on many ports

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

4 years agodoc/cephadm/rgw: update docs to show count-per-host
Sage Weil [Wed, 10 Mar 2021 21:48:58 +0000 (16:48 -0500)]
doc/cephadm/rgw: update docs to show count-per-host

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

4 years agomgr/cephadm: add support for rgw_frontend_type (beast or civetweb)
Sage Weil [Wed, 10 Mar 2021 22:51:49 +0000 (17:51 -0500)]
mgr/cephadm: add support for rgw_frontend_type (beast or civetweb)

Previously we were assuming beast.

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

4 years agomgr/cephadm: remove ssl_frontend_ssl_key from RGWSpec
Sage Weil [Wed, 10 Mar 2021 19:58:09 +0000 (14:58 -0500)]
mgr/cephadm: remove ssl_frontend_ssl_key from RGWSpec

Since this didn't work anyway, stop collecting and passing through the
private key portion of the certificate.  Instead, users should include
both in the first option.  This is simpler, and provides consistency
across civetweb and beast rgw backends (for whatever that is worth).

NOTE: dashboard changes are not included here.

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

4 years agomgr/cephadm: fix beast private key config option
Sage Weil [Wed, 10 Mar 2021 19:50:30 +0000 (14:50 -0500)]
mgr/cephadm: fix beast private key config option

This has always been broken.  However, beast SSL will also accept a pem
(cert + key) via the ssl_certificate option, so any existing non-broken
users (if they exist) must be using that.

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

4 years agomgr/cephadm: fix rgw ssl cert/key config-key path
Sage Weil [Wed, 10 Mar 2021 22:50:22 +0000 (17:50 -0500)]
mgr/cephadm: fix rgw ssl cert/key config-key path

I broke this when making the realm and zone optional.

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

4 years agomgr/cephadm/schedule: dynamically assign ports for rgw
Sage Weil [Wed, 10 Mar 2021 19:25:23 +0000 (14:25 -0500)]
mgr/cephadm/schedule: dynamically assign ports for rgw

Dynamically number ports for RGW instances, with the start port being
the one configured on the service (or the default of 80 or 443).

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

4 years agomgr/cephadm/schedule: only 1 port in DaemonPlacement
Sage Weil [Wed, 10 Mar 2021 18:59:18 +0000 (13:59 -0500)]
mgr/cephadm/schedule: only 1 port in DaemonPlacement

It would be weird to dynamically number multiple ports (although doable).
But until we have plans to support something like that, no need to handle
it here.

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

4 years agomgr/cephadm: move rgw frontend logic into RgwService
Sage Weil [Wed, 10 Mar 2021 18:48:10 +0000 (13:48 -0500)]
mgr/cephadm: move rgw frontend logic into RgwService

This doesn't belong in the ServiceSpec/RGWSpec

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

4 years agomgr/cephadm/schedule: return DaemonPlacement instead of HostPlacementSpec
Sage Weil [Wed, 10 Mar 2021 17:24:32 +0000 (12:24 -0500)]
mgr/cephadm/schedule: return DaemonPlacement instead of HostPlacementSpec

Create a new type for the result of scheduling/place().  Include new fields
like ip:port.  Introduce a matches_daemon() to see whether an existing
daemon matches a scheduling slot.

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

4 years agomgr/cephadm/schedule: remove unused methods
Sage Weil [Wed, 10 Mar 2021 16:00:04 +0000 (11:00 -0500)]
mgr/cephadm/schedule: remove unused methods

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

4 years agomgr/cephadm: propagate ip:port from CephadmDaemoNDeploySpec to deployment
Sage Weil [Mon, 8 Mar 2021 21:07:20 +0000 (16:07 -0500)]
mgr/cephadm: propagate ip:port from CephadmDaemoNDeploySpec to deployment

Pass the port through to the CephadmDaemonDeploySpec, and unit.meta.

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

4 years agocephadm: populate ports if known and not included in unit.meta
Sage Weil [Mon, 8 Mar 2021 19:18:04 +0000 (14:18 -0500)]
cephadm: populate ports if known and not included in unit.meta

This is only helpful for daemons deployed by older versions of cephadm
that have known ports based on their type.

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

4 years agomgr/cephadm: gather and report ports in 'orch ps' output
Sage Weil [Mon, 8 Mar 2021 19:14:49 +0000 (14:14 -0500)]
mgr/cephadm: gather and report ports in 'orch ps' output

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

4 years agoqa/suites/rados/cephadm/orchestrator_cli: random-distro$ -> 0-random-distro$
Sage Weil [Wed, 17 Mar 2021 14:40:32 +0000 (10:40 -0400)]
qa/suites/rados/cephadm/orchestrator_cli: random-distro$ -> 0-random-distro$

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

4 years agoqa/suites/rados/cephadm/smoke-roleless: distro -> 0-distro
Sage Weil [Wed, 17 Mar 2021 00:51:23 +0000 (20:51 -0400)]
qa/suites/rados/cephadm/smoke-roleless: distro -> 0-distro

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

4 years agoqa/distros/podman: install kubic once per host, in parallel
Sage Weil [Tue, 16 Mar 2021 17:17:11 +0000 (13:17 -0400)]
qa/distros/podman: install kubic once per host, in parallel

- exec "all:" means all *roles*, not *hosts*
- pexec "all:" means all hosts (yay), and also works in parallel

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

4 years agoqa/suites/fs/multiclient: use clients: not all: for pexec
Sage Weil [Tue, 16 Mar 2021 17:12:07 +0000 (13:12 -0400)]
qa/suites/fs/multiclient: use clients: not all: for pexec

This matches the setup work we are trying to tear down.

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

4 years agomgr/cephadm: add info to 'ceph orch upgrade status' in cephadm
Adam King [Fri, 5 Mar 2021 22:01:12 +0000 (17:01 -0500)]
mgr/cephadm: add info to 'ceph orch upgrade status' in cephadm

properly fills in 'services_complete' field, adds info messages to 'message' field
such as what daemon type is being upgraded or if we're pulling an image and adds
'progress' field that shows how many daemons have been upgraded so far.

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

4 years agoMerge pull request #39973 from singuliere/wip-49686-pacific
Venky Shankar [Wed, 17 Mar 2021 13:47:47 +0000 (19:17 +0530)]
Merge pull request #39973 from singuliere/wip-49686-pacific

pacific: cephfs-mirror: register mirror daemon as service daemon

4 years agoMerge pull request #39810 from vshankar/wip-49432
Venky Shankar [Wed, 17 Mar 2021 13:46:27 +0000 (19:16 +0530)]
Merge pull request #39810 from vshankar/wip-49432

pacific: tools/cephfs-mirror: fix a dangling pointer

4 years agoMerge PR #40107 into pacific
Patrick Donnelly [Wed, 17 Mar 2021 13:44:13 +0000 (06:44 -0700)]
Merge PR #40107 into pacific

* refs/pull/40107/head:
qa: use tcmalloc with valgrind in fs:valgrind

Reviewed-by: Rishabh Dave <ridave@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
4 years agoMerge pull request #40131 from cbodley/wip-qa-rgw-ignore-pg-avail-pacific
Casey Bodley [Wed, 17 Mar 2021 13:35:06 +0000 (09:35 -0400)]
Merge pull request #40131 from cbodley/wip-qa-rgw-ignore-pg-avail-pacific

pacific: qa/rgw: put PG_AVAILABILITY ignorelist override in its own file

Reviewed-by: Neha Ojha <nojha@redhat.com>
4 years agoMerge pull request #40134 from cbodley/wip-49814
Casey Bodley [Wed, 17 Mar 2021 13:34:23 +0000 (09:34 -0400)]
Merge pull request #40134 from cbodley/wip-49814

pacific: rgw: rgw::sal::RGWBucket initializes creation_time

Reviewed-by: Daniel Gryniewicz <dang@redhat.com>
4 years agoMerge PR #40135 into pacific
Sage Weil [Tue, 16 Mar 2021 20:14:19 +0000 (15:14 -0500)]
Merge PR #40135 into pacific

* refs/pull/40135/head:
pybind/mgr: correct a MgrModule annotation
mgr/ceph_module: add type annotation to BaseMgrModule
mgr/prometheus: fix warning of possibly unbound variables
mgr/prometheus: flake8 cleanups
mgr/prometheus: fix import failure (flake8)
mgr/prometheus: add type annotations
mgr/prometheus: raise at seeing unknown status
mgr/prometheus: implement command using CLIReadCommand
mgr/{prometheus,telemetry}: appease mypy
mgr/prometheus: add prometheus to flake8 test
mgr/prometheus: escape special chars using r-string
pybind/mgr/prometheus: PEP8 cleanups
pybind/mgr/prometheus: add typing annotations
mgr/prometheus: introduce metric for collection time
mgr/cephadm: fix 'auth caps' fallback
mgr/cephadm: ensure mgr metadata is not none
qa/suites/rados/cephadm: add back centos+rhel with kubic podman
qa/suites/rados/cephadm/upgrade: deploy a legacy r.z-style rgw
qa/suites/rados/cephadm/upgrade: start at 15.2.9 to test iscsi upgrade
qa/tasks/cephadm.py: don't set mgr count to +1
doc/cephadm: add note about deprecation of NFSv3
doc/cephadm: remove step to restart the mgr
doc/cephadm: use `reconfig` instead of `redeploy`
doc/cephadm: update custom j2 config-key name
doc/cephadm: use 'apt' to install cephadm on Ubuntu
mgr/cephadm: remove duplicate labels when adding a host
mgr/cephadm: tolerate failure to update daemon caps
mgr/cephadm: fix get_keyring_with_caps
python-common: fix PlacementSpec target size method
python-common: count-per-host must be combined with label or hosts or host_pattern
mgr/cephadm: handle bare 'count-per-host:NNN', fix comments
mgr/cephadm/schedule: remove Scheduler abstraction (for now at least)
mgr/cephadm/schedule: calculate additions/removals in place()
mgr/cephadm/schedule: allow colocation of certain daemon types
mgr/cephadm/schedule: shuffle candidates, not final placements
mgr/cephadm/schedule: pass per-type allow_colo to the scheduler
mgr/cephadm/services/cephadmservice: fix typo
mgr/cephadm/schedule: pass daemons, not get_daemons_func
mgr/cephadm: use local var
mgr/cephadm/schedule: move host filtering into get_candidates()
python-common/ceph/deployment/service_spec: disallow max-per-host + explicit placement
mgr/cephadm/schedule: respect count-per-host
mgr/cephadm: adjust deployment logic to allow multiple daemons per host
python-common: add count-per-host to PlacementSpec
mgr/cephadm: do not worry about even # of monitors
mgr/cephadm: add iscsi and nfs to upgrade
mgr/cephadm: update caps if necessary when getting keyring
mgr/cephadm: add cephfs-mirror to CEPH_UPGRADE_ORDER
cephadm: Add cephfs-mirror
qa/cephadm: Add cephfs-mirror test
qa/tasks: some type annotations
mgr/orch: Add cephfs-mirror to enum
mgr/cephadm: Add CephfsMirrorService
mgr/orch: replace def add_{type}(...) with generic add_daemon()
mgr/cephadm: drop `create_func` arg from _add_daemon
mgr/cephadm: move CephadmExporter to new module
mgr/cephadm: fix CephadmExporter deployment
cephadm: exporter: use os.path.realpath(__file__)
mgr/cephadm: root mode: call (and deploy) cephadm binary
cephadm: Get rid of injected_argv
cephadm: Make path to cephadm binary unique
python-common: continue to allow RGWSpec(realm=r,zone=z)
PendingReleaseNodes: note changes in cephadm rgw behavior
qa/tasks/cephadm: drop realm.zone convention for rgw
doc: update docs
doc/cephadm: rewrite "adoption process"
doc/cephadm: rewrite "preparation" in adoption.rst
doc/cephadm: add prompts to adoption.rst
doc/cephadm: rewrite part of adoption.rst
python-common/ceph/deployment: RGWSpec: accept (and drop) subcluster arg
mgr/orchestrator: drop $realm.$zone naming convention
mgr/cephadm: rgw: do not mess with realm configuration
mgr/cephadm:Document the cephadm config-check feature
mgr/cephadm:fix to resolve mypy issue
mgr/cephadm:add unit test for the lookup_check helper
mgr/cephadm:Drop active healthcheck during a disable request
mgr/cephadm:Added helper function to return a specific healthcheck
mgr/cephadm:unit test added for nics better than most
mgr/cephadm:skip an alert if the linkspeed is better than most
mgr/cephadm:fix mypy warning
mgr/cephadm:Remove check from ceph metadata gathering
mgr/cephadm:Add unit test for hosts without public network NIC
mgr/cephadm:Minor updates to address review comments
mgr/cephadm:Added CLI interface for the configuration checker
mgr/cephadm:Multiple updates related to the addition of the CLI
mgr/cephadm:Moved 'ownership' of the checker to cephadm
mgr/cephadm:Unit tests updated to account for upgrades
mgr/cephadm:Updates to CephadmConfigChecks class
mgr/cephadm:Adds unit tests for the CephadmConfigChecks class
mgr/cephadm:add module option to enable configuration checks
mgr/cephadm:added ceph version consistency check
mgr/cephadm: added config checker to main serve loop
mgr/cephadm: adding check logic
mgr/cephadm: resolve rebase conflicts
mgr/cephadm:Document the intergration with libstoragemgmt
mgr/cephadm:Enable cephadm device scan to use LSM
mgr/cephadm: prevent traceback when invalid osd id passed to 'orch osd rm stop'
mgr/cephadm: do not prime service cache on reconfig
mgr/cephadm/osd: PEP-8 fix
mgr/cephadm: Activate existing OSDs
mgr/cephadm: osd: Use _run_cephadm_json()
mgr/cephadm: document ok_to_stop output argument for clarity
mgr/DaemonServer: make warning language a bit friendlier
mgr/cephadm/upgrade: improve language a bit
mgr/cephadm/upgrade: restart multiple osds at once
mgr/cephadm: gather other osds that are safe to stop
mgr/cephadm: optional pass 'known' through to ok_to_stop
mgr/cephadm/upgrade: log start/stop/pause/resume
mgr/cephadm: add CEPHADM_STRAY_DAEMON unittest
mgr/cephadm: alias rgw-nfs -> nfs
qa/tasks/cephadm: remove mirror code
cephadm: fixup `alrady` -> `already`
cephadm: Change outer quotes to avoid escaping inner quotes (Q003)
cephadm: Remove bad quotes from multiline string (Q001)
cephadm: Remove bad quotes (Q000)
cephadm: introduce flake8-quotes
cephadm: line break after binary operator (W504)
cephadm: blank line contains whitespace (W293)
cephadm: trailing whitespace (W291)
cephadm: local variable 'e' is assigned to but never used (F841)
cephadm: 'select' imported but unused (F401)
cephadm: ambiguous variable name 'l' (E741)
cephadm: do not use bare 'except' (E722)
cephadm: statement ends with a semicolon (E703)
cephadm: module level import not at top of file (E402)
cephadm: expected 1 blank line before a nested definition (E306)
cephadm: expected 2 blank lines after end of function or class (E305)
cephadm: too many blank lines (E303)
cephadm: expected 2 blank lines, found 1 (E302)
cephadm: expected 1 blank line, found 0 (E301)
cephadm: too many leading '#' for block comment (E266)
cephadm: block comment should start with '# ' (E265)
cephadm: at least two spaces before inline comment (E261)
cephadm: unexpected spaces around keyword / parameter equals (E251)
cephadm: multiple spaces after ',' (E241)
cephadm: missing whitespace after ':' (E231)
cephadm: missing whitespace around arithmetic operator (E226)
cephadm: missing whitespace around operator (E225)
cephadm: whitespace before ':' (E203)
cephadm: whitespace after '{' (E201)
cephadm: continuation line unaligned for hanging indent (E131)
cephadm: continuation line under-indented for visual indent (E128)
cephadm: continuation line over-indented for visual indent (E127)
cephadm: continuation line over-indented for hanging indent (E126)
cephadm: continuation line with same indent as next logical line (E125)
cephadm: closing bracket does not match visual indentation (E124)
cephadm: ... does not match indentation of opening bracket's line (E123)
cephadm: continuation line missing indentation or outdented (E122)
cephadm: continuation line under-indented for hanging indent (E121)
cephadm: over-indented (E117)
cephadm: introduce flake8

Reviewed-by: Juan Miguel Olmo <jolmomar@redhat.com>
4 years agopybind/mgr: correct a MgrModule annotation 40135/head
Kefu Chai [Fri, 29 Jan 2021 03:25:31 +0000 (11:25 +0800)]
pybind/mgr: correct a MgrModule annotation

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

4 years agomgr/ceph_module: add type annotation to BaseMgrModule
Kefu Chai [Mon, 22 Feb 2021 05:45:31 +0000 (13:45 +0800)]
mgr/ceph_module: add type annotation to BaseMgrModule

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

4 years agomgr/prometheus: fix warning of possibly unbound variables
Patrick Seidensal [Mon, 22 Feb 2021 14:52:56 +0000 (15:52 +0100)]
mgr/prometheus: fix warning of possibly unbound variables

Signed-off-by: Patrick Seidensal <pseidensal@suse.com>
(cherry picked from commit 0fdbdb45dcec57e6e108edfdbea6e6a661f34a7a)

4 years agomgr/prometheus: flake8 cleanups
Kefu Chai [Fri, 26 Feb 2021 09:57:32 +0000 (17:57 +0800)]
mgr/prometheus: flake8 cleanups

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

4 years agomgr/prometheus: fix import failure (flake8)
Patrick Seidensal [Mon, 22 Feb 2021 15:45:40 +0000 (16:45 +0100)]
mgr/prometheus: fix import failure (flake8)

Signed-off-by: Patrick Seidensal <pseidensal@suse.com>
(cherry picked from commit 806ef8a1c513a52f50604ba223434d36a654eb81)

4 years agomgr/prometheus: add type annotations
Sage Weil [Tue, 16 Mar 2021 13:05:51 +0000 (08:05 -0500)]
mgr/prometheus: add type annotations

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

# Conflicts:
# src/mypy.ini
  - surrounding modules are in master but not pacific

4 years agomgr/prometheus: raise at seeing unknown status
Kefu Chai [Fri, 26 Feb 2021 04:15:03 +0000 (12:15 +0800)]
mgr/prometheus: raise at seeing unknown status

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

4 years agomgr/prometheus: implement command using CLIReadCommand
Kefu Chai [Fri, 26 Feb 2021 03:47:11 +0000 (11:47 +0800)]
mgr/prometheus: implement command using CLIReadCommand

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

4 years agomgr/{prometheus,telemetry}: appease mypy
Sage Weil [Tue, 16 Mar 2021 13:01:46 +0000 (08:01 -0500)]
mgr/{prometheus,telemetry}: appease mypy

update to adapt the type annotation of MgrModule.list_servers()

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

# Conflicts:
# src/pybind/mgr/telemetry/module.py
  - drop telemetry portion

4 years agomgr/prometheus: add prometheus to flake8 test
Kefu Chai [Wed, 10 Feb 2021 07:49:03 +0000 (15:49 +0800)]
mgr/prometheus: add prometheus to flake8 test

for the explanation why we should add a line break before a binary
operator. see
https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator

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

4 years agomgr/prometheus: escape special chars using r-string
Kefu Chai [Wed, 10 Feb 2021 07:47:31 +0000 (15:47 +0800)]
mgr/prometheus: escape special chars using r-string

so we don't need to worry about escaping the backslash anymore.

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

4 years agopybind/mgr/prometheus: PEP8 cleanups
Sage Weil [Tue, 16 Mar 2021 13:00:42 +0000 (08:00 -0500)]
pybind/mgr/prometheus: PEP8 cleanups

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

# Conflicts:
# src/pybind/mgr/tox.ini
  - pacific telemetry not in tox.ini

4 years agopybind/mgr/prometheus: add typing annotations
Kefu Chai [Mon, 15 Mar 2021 11:35:16 +0000 (19:35 +0800)]
pybind/mgr/prometheus: add typing annotations

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

4 years agomgr/prometheus: introduce metric for collection time
Patrick Seidensal [Fri, 24 Jul 2020 17:11:35 +0000 (19:11 +0200)]
mgr/prometheus: introduce metric for collection time

Introduces metric `prometheus_collect_duration_seconds` for the time it
takes the Prometheus manager module to collect all the metrics.

```
ceph_prometheus_collect_duration_seconds_sum{method="get_health"} 0.0002613067626953125
ceph_prometheus_collect_duration_seconds_sum{method="get_pool_stats"} 0.0018298625946044922
ceph_prometheus_collect_duration_seconds_sum{method="get_df"} 0.0005767345428466797
ceph_prometheus_collect_duration_seconds_sum{method="get_fs"} 0.0010402202606201172
ceph_prometheus_collect_duration_seconds_sum{method="get_quorum_status"} 0.0007524490356445312
ceph_prometheus_collect_duration_seconds_sum{method="get_mgr_status"} 0.0035364627838134766
ceph_prometheus_collect_duration_seconds_sum{method="get_pg_status"} 0.00021266937255859375
ceph_prometheus_collect_duration_seconds_sum{method="get_osd_stats"} 0.0018737316131591797
ceph_prometheus_collect_duration_seconds_sum{method="get_metadata_and_osd_status"} 0.0032796859741210938
ceph_prometheus_collect_duration_seconds_sum{method="get_num_objects"} 0.00011086463928222656
ceph_prometheus_collect_duration_seconds_sum{method="get_rbd_stats"} 0.00036144256591796875
ceph_prometheus_collect_duration_seconds_count{method="get_health"} 1.0
ceph_prometheus_collect_duration_seconds_count{method="get_pool_stats"} 1.0
ceph_prometheus_collect_duration_seconds_count{method="get_df"} 1.0
ceph_prometheus_collect_duration_seconds_count{method="get_fs"} 1.0
ceph_prometheus_collect_duration_seconds_count{method="get_quorum_status"} 1.0
ceph_prometheus_collect_duration_seconds_count{method="get_mgr_status"} 1.0
ceph_prometheus_collect_duration_seconds_count{method="get_pg_status"} 1.0
ceph_prometheus_collect_duration_seconds_count{method="get_osd_stats"} 1.0
ceph_prometheus_collect_duration_seconds_count{method="get_metadata_and_osd_status"} 1.0
ceph_prometheus_collect_duration_seconds_count{method="get_num_objects"} 1.0
ceph_prometheus_collect_duration_seconds_count{method="get_rbd_stats"} 1.0
```

Fixes: https://tracker.ceph.com/issues/46703
Signed-off-by: Patrick Seidensal <pseidensal@suse.com>
(cherry picked from commit 801d3f670330499fb9cd5f8674678908f2115fe8)

4 years agomgr/cephadm: fix 'auth caps' fallback
Sage Weil [Mon, 15 Mar 2021 22:34:57 +0000 (17:34 -0500)]
mgr/cephadm: fix 'auth caps' fallback

The first get-or-create attempt also needs to tolerate failure.

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

4 years agomgr/cephadm: ensure mgr metadata is not none
Sage Weil [Mon, 15 Mar 2021 22:20:25 +0000 (17:20 -0500)]
mgr/cephadm: ensure mgr metadata is not none

This hunk is from aca45d7d08fd8c3f32849331eba4620e2726282a, a much
larger change in master that added type annotations all over the place.
It just brings src/pybind/mgr/cephadm fully in sync with master.

Signed-off-by: Sage Weil <sage@newdream.net>
4 years agoqa/suites/rados/cephadm: add back centos+rhel with kubic podman
Sage Weil [Thu, 11 Mar 2021 19:46:23 +0000 (13:46 -0600)]
qa/suites/rados/cephadm: add back centos+rhel with kubic podman

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

4 years agoqa/suites/rados/cephadm/upgrade: deploy a legacy r.z-style rgw
Sage Weil [Wed, 10 Mar 2021 13:20:45 +0000 (08:20 -0500)]
qa/suites/rados/cephadm/upgrade: deploy a legacy r.z-style rgw

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

4 years agoqa/suites/rados/cephadm/upgrade: start at 15.2.9 to test iscsi upgrade
Sage Weil [Thu, 11 Mar 2021 03:58:33 +0000 (22:58 -0500)]
qa/suites/rados/cephadm/upgrade: start at 15.2.9 to test iscsi upgrade

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

4 years agoqa/tasks/cephadm.py: don't set mgr count to +1
Sage Weil [Thu, 11 Mar 2021 16:58:15 +0000 (11:58 -0500)]
qa/tasks/cephadm.py: don't set mgr count to +1

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

4 years agodoc/cephadm: add note about deprecation of NFSv3
Michael Fritch [Wed, 10 Mar 2021 17:28:11 +0000 (10:28 -0700)]
doc/cephadm: add note about deprecation of NFSv3

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

4 years agodoc/cephadm: remove step to restart the mgr
Michael Fritch [Wed, 10 Mar 2021 04:06:27 +0000 (21:06 -0700)]
doc/cephadm: remove step to restart the mgr

a restart of the mgr does not appear to be necessary
after a `ceph config-key set ...`

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

4 years agodoc/cephadm: use `reconfig` instead of `redeploy`
Michael Fritch [Wed, 10 Mar 2021 04:06:20 +0000 (21:06 -0700)]
doc/cephadm: use `reconfig` instead of `redeploy`

`reconfig` can be used to apply a change to either
the tls/ssl cert or a custom configuration file (j2)

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

4 years agodoc/cephadm: update custom j2 config-key name
Michael Fritch [Wed, 10 Mar 2021 04:06:12 +0000 (21:06 -0700)]
doc/cephadm: update custom j2 config-key name

introduced by:
cd79c9912ab35ee6296d613edc7830410a141e05

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

4 years agodoc/cephadm: use 'apt' to install cephadm on Ubuntu
Josh [Sun, 7 Mar 2021 03:59:46 +0000 (21:59 -0600)]
doc/cephadm: use 'apt' to install cephadm on Ubuntu

Adjusted so Ubuntu command uses 'apt' and added Fedora since that uses 'dnf'.

(cherry picked from commit ffc08b930b32fa34e4d22164feda04719a34dd6b)

4 years agomgr/cephadm: remove duplicate labels when adding a host
Adam King [Fri, 5 Mar 2021 15:10:25 +0000 (10:10 -0500)]
mgr/cephadm: remove duplicate labels when adding a host

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

4 years agomgr/cephadm: tolerate failure to update daemon caps
Sage Weil [Mon, 15 Mar 2021 16:55:36 +0000 (11:55 -0500)]
mgr/cephadm: tolerate failure to update daemon caps

If we're upgrading from 15.2.0, we may fail to update caps.  Instead of
failing the upgrade hard, warn to the log and continue.  This is less
than ideal, but the caps will get corrected the next time the daemon is
redeployed on the next upgrade, and most likely the previous caps will
continue to work (given they were presumably working before the upgrade).

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

4 years agomgr/cephadm: fix get_keyring_with_caps
Sage Weil [Fri, 12 Mar 2021 16:15:35 +0000 (10:15 -0600)]
mgr/cephadm: fix get_keyring_with_caps

1- Pass caps to 'auth get-or-create'
2- Only try 'auth caps' if the get-or-create failed

Note that the 'auth caps' step can fail if upgrading from 15.2.0 since
'profile mgr' didn't include 'auth caps' until 15.2.1.  We're not
addressing that for now...

Fixes: 7c0d532f3a4839f4199a13773fb5fa8b6fb3f183
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 6127d7f20bc8a6ad02d8ea144584eaf2bfc9590e)

4 years agopython-common: fix PlacementSpec target size method
Sage Weil [Wed, 10 Mar 2021 22:27:28 +0000 (17:27 -0500)]
python-common: fix PlacementSpec target size method

- Rename get_host_selection_size() to get_target_size() since the host
  part of the name was a bit misleading
- Take count-per-host into consideration.

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

4 years agopython-common: count-per-host must be combined with label or hosts or host_pattern
Sage Weil [Wed, 10 Mar 2021 22:31:31 +0000 (17:31 -0500)]
python-common: count-per-host must be combined with label or hosts or host_pattern

I think this is better for the same reason we made PlacementSpec() not
mean 'all hosts' by default.  If you really want N daemons for every host
in the cluster, be specific with 'count-per-host:2 *'.

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

4 years agomgr/cephadm: handle bare 'count-per-host:NNN', fix comments
Sage Weil [Wed, 10 Mar 2021 13:32:11 +0000 (08:32 -0500)]
mgr/cephadm: handle bare 'count-per-host:NNN', fix comments

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

4 years agomgr/cephadm/schedule: remove Scheduler abstraction (for now at least)
Sage Weil [Wed, 10 Mar 2021 13:28:20 +0000 (08:28 -0500)]
mgr/cephadm/schedule: remove Scheduler abstraction (for now at least)

It no longer does anything except slice the array.

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

4 years agomgr/cephadm/schedule: calculate additions/removals in place()
Sage Weil [Wed, 10 Mar 2021 00:01:39 +0000 (19:01 -0500)]
mgr/cephadm/schedule: calculate additions/removals in place()

We already have to examine existing daemons to choose the placements.
There is no reason to make the caller call another method to (re)calculate
what the net additions and removals are.

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

4 years agomgr/cephadm/schedule: allow colocation of certain daemon types
Sage Weil [Tue, 9 Mar 2021 23:49:51 +0000 (18:49 -0500)]
mgr/cephadm/schedule: allow colocation of certain daemon types

For certain daemon types, we can deploy more than one per host (mds,
rbd-mirror, rgw).

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

4 years agomgr/cephadm/schedule: shuffle candidates, not final placements
Sage Weil [Tue, 9 Mar 2021 23:47:34 +0000 (18:47 -0500)]
mgr/cephadm/schedule: shuffle candidates, not final placements

Otherwise we may end out randomly doubling up on some hosts and none on
others (when we have more than one placement per host).

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

4 years agomgr/cephadm/schedule: pass per-type allow_colo to the scheduler
Sage Weil [Tue, 9 Mar 2021 23:26:43 +0000 (18:26 -0500)]
mgr/cephadm/schedule: pass per-type allow_colo to the scheduler

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

4 years agomgr/cephadm/services/cephadmservice: fix typo
Sage Weil [Tue, 9 Mar 2021 23:19:35 +0000 (18:19 -0500)]
mgr/cephadm/services/cephadmservice: fix typo

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

4 years agomgr/cephadm/schedule: pass daemons, not get_daemons_func
Sage Weil [Tue, 9 Mar 2021 23:17:49 +0000 (18:17 -0500)]
mgr/cephadm/schedule: pass daemons, not get_daemons_func

- simpler
- many/most callers already have the daemon list, so we save ourselves
duplicated effort

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

4 years agomgr/cephadm: use local var
Sage Weil [Tue, 9 Mar 2021 23:15:25 +0000 (18:15 -0500)]
mgr/cephadm: use local var

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

4 years agomgr/cephadm/schedule: move host filtering into get_candidates()
Sage Weil [Tue, 9 Mar 2021 21:12:21 +0000 (16:12 -0500)]
mgr/cephadm/schedule: move host filtering into get_candidates()

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

4 years agopython-common/ceph/deployment/service_spec: disallow max-per-host + explicit placement
Sage Weil [Tue, 9 Mar 2021 21:09:12 +0000 (16:09 -0500)]
python-common/ceph/deployment/service_spec: disallow max-per-host + explicit placement

At least for now we don't have a reasonable way to stamp out N placements
when we're also constraining the name/network/ip--not in the general case.

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

4 years agomgr/cephadm/schedule: respect count-per-host
Sage Weil [Sat, 6 Mar 2021 15:10:42 +0000 (10:10 -0500)]
mgr/cephadm/schedule: respect count-per-host

In the no-count cases, our job is simple: we have a set of hosts specified
via some other means (label, filter, explicit list) and simply need to
do N instances for each of those hosts.

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

4 years agomgr/cephadm: adjust deployment logic to allow multiple daemons per host
Sage Weil [Sat, 6 Mar 2021 15:09:31 +0000 (10:09 -0500)]
mgr/cephadm: adjust deployment logic to allow multiple daemons per host

If we are told to deploy multiple instances on a host, do it.

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

4 years agopython-common: add count-per-host to PlacementSpec
Sage Weil [Thu, 4 Mar 2021 13:45:45 +0000 (08:45 -0500)]
python-common: add count-per-host to PlacementSpec

Cannot be combined with 'count'.

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

4 years agomgr/cephadm: do not worry about even # of monitors
Sage Weil [Thu, 4 Mar 2021 23:30:35 +0000 (18:30 -0500)]
mgr/cephadm: do not worry about even # of monitors

Ceph works just fine with an even number of monitors.

Upside: more copies of critical cluster data
Downside: we can tolerate the same number of down mons as N-1, and now
 we are slightly more likely to have a failing mon because we have 1 more
 that might fail.

On balance it's not clear that have one fewer mon is any better, so avoid
the confusion and complexity of second-guessing ourselves.

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

4 years agomgr/cephadm: add iscsi and nfs to upgrade
Adam King [Wed, 24 Feb 2021 21:44:57 +0000 (16:44 -0500)]
mgr/cephadm: add iscsi and nfs to upgrade

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

4 years agomgr/cephadm: update caps if necessary when getting keyring
Adam King [Wed, 24 Feb 2021 21:13:01 +0000 (16:13 -0500)]
mgr/cephadm: update caps if necessary when getting keyring

If the caps change from the old version to the new one it causes
issues in the upgrade. This allows the caps to be updated. Currently
only seeing this with iscsi but changing it for other as a precaution

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

4 years agomgr/cephadm: add cephfs-mirror to CEPH_UPGRADE_ORDER
Sebastian Wagner [Fri, 26 Feb 2021 12:34:52 +0000 (13:34 +0100)]
mgr/cephadm: add cephfs-mirror to CEPH_UPGRADE_ORDER

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

4 years agocephadm: Add cephfs-mirror
Sebastian Wagner [Tue, 23 Feb 2021 15:06:56 +0000 (16:06 +0100)]
cephadm: Add cephfs-mirror

Fixes: https://tracker.ceph.com/issues/47261
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit 8fa941b35d89db6a40f7d2912b69eadf40c5004c)

4 years agoqa/cephadm: Add cephfs-mirror test
Sebastian Wagner [Tue, 23 Feb 2021 15:05:47 +0000 (16:05 +0100)]
qa/cephadm: Add cephfs-mirror test

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

4 years agoqa/tasks: some type annotations
Sebastian Wagner [Tue, 23 Feb 2021 15:05:22 +0000 (16:05 +0100)]
qa/tasks: some type annotations

Mostly for making my IDE aware of things

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

4 years agomgr/orch: Add cephfs-mirror to enum
Sebastian Wagner [Tue, 23 Feb 2021 14:48:29 +0000 (15:48 +0100)]
mgr/orch: Add cephfs-mirror to enum

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

4 years agomgr/cephadm: Add CephfsMirrorService
Sebastian Wagner [Tue, 23 Feb 2021 13:45:02 +0000 (14:45 +0100)]
mgr/cephadm: Add CephfsMirrorService

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

4 years agomgr/orch: replace def add_{type}(...) with generic add_daemon()
Sebastian Wagner [Tue, 23 Feb 2021 14:42:01 +0000 (15:42 +0100)]
mgr/orch: replace def add_{type}(...) with generic add_daemon()

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

4 years agomgr/cephadm: drop `create_func` arg from _add_daemon
Sebastian Wagner [Tue, 23 Feb 2021 13:42:38 +0000 (14:42 +0100)]
mgr/cephadm: drop `create_func` arg from _add_daemon

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

4 years agomgr/cephadm: move CephadmExporter to new module
Sebastian Wagner [Tue, 23 Feb 2021 12:50:12 +0000 (13:50 +0100)]
mgr/cephadm: move CephadmExporter to new module

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

4 years agomgr/cephadm: fix CephadmExporter deployment
Sebastian Wagner [Tue, 16 Feb 2021 12:17:13 +0000 (13:17 +0100)]
mgr/cephadm: fix CephadmExporter deployment

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

4 years agocephadm: exporter: use os.path.realpath(__file__)
Sebastian Wagner [Fri, 26 Feb 2021 10:20:35 +0000 (11:20 +0100)]
cephadm: exporter: use os.path.realpath(__file__)

Because we now always have a script on the remote hosts.

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

4 years agomgr/cephadm: root mode: call (and deploy) cephadm binary
Sebastian Wagner [Mon, 22 Feb 2021 15:30:42 +0000 (16:30 +0100)]
mgr/cephadm: root mode: call (and deploy) cephadm binary

Avoid copying cephadm all the time.

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

4 years agocephadm: Get rid of injected_argv
Sebastian Wagner [Mon, 22 Feb 2021 14:12:39 +0000 (15:12 +0100)]
cephadm: Get rid of injected_argv

Removed the injected_argv parameter and the injection of code in the cephadm
script we send to hosts.
Now the script is copied and after that we execute the cephadm command.
I would like to copy it only one time (when adding new hosts) but this will be
part of a future PR, together with other prs to:

- Introduce cephadm version
- Get rid of packaged/root mode
- Use pex or eggs

Signed-off-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit 2142dcfc2bac3159b7a24f92ae75df2a14599377)