Commit Graph

102778 Commits

Author SHA1 Message Date
Sage Weil
f2e2cb1541 qa: add ceph-daemon
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
ae4bed49cf debian: ceph-daemon package, required by ceph-mgr-ssh
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
171fecc38a ceph.spec.in: ceph-daemon package, required by ceph-mgr
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
c253ffa302 common/options: cleanup whitespace
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
1fd58b318e mgr/ssh: simplify getting the cluster fsid
This never changes, so just stash it once.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
ac99fe7545 mgr/ssh: pipe ceph-daemon script to stdin of python3
This avoids any need for the script to be present on the remote host.

We introduce a config option to indicate where the script should be
read from, since the location varies between a vstart environment (source
dir) and a real install (/usr/sbin).

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
38ae16060f ceph-daemon: add support for args and/or stdin from top of script
Allow someone to run this script by prepending injected_{args,stdin} to
the top and then piping it all to a python3 binary.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
f3f28f500d ceph-daemon: make ceph-volume use get_config_and_keyring
This will always take the first config+keyring json branch.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
c84dfe84d4 ceph-daemon: ls: behave if /var/log/ceph doesn't exist
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
abdd56ad00 ceph-daemon: implement 'adopt' for legacy style daemons
Caveats:

 - this doesn't clean out /etc/ceph/*, since we don't know which is the
   last daemon to go, and/or whether the user wants to keep it around
   for using the ceph CLI on this host
 - leaves behind /var/lib/ceph/bootstrap-* keys, even after all daemons
   have been converted.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
8a740ec060 ceph-daemon: fix fsid detection for legacy osds
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
104f9b689d ceph-daemon: make rm-cluster clean up system-ceph*.slice too
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
486b46134d ceph-daemon: configure ssh orchestrator
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
208a6e5fe7 ceph-daemon: be more restrictive with file permissions
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
058fd7aa66 mgr/ssh: create osd with ceph-daemon
Three basic steps:

1- ceph-volume lvm prepare
2- ceph-volume lvm list
3- for each osd, ceph-daemon deploy (which calls c-v activate inside the
   new container)

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
9811a4242f mgr/ssh: pass daemon id separately to _create_daemon
Don't assume it is the hostname (with osds, it's not!).

Also, just pass arbitrary args down, instead of special-casing the
network option.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
2c7468e96d ceph-daemon: add --config-and-keyring to ceph-volume command
...to provide a ceph.conf and the bootstrap-osd key.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
ed09f97ddf ceph-daemon: create log path for shell (if needed)
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
e463475a41 mgr/ssh: use _run_ceph_daemon for _create_daemon
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
343741de6d mgr/ssh: factor _run_ceph_daemon out of _get_device_inventory
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
91a252dd43 mon/ConfigMonitor: allow entity type only for 'config get'
e.g., 'ceph config get osd debug_osd' to return the config value that
would apply to a generic OSD (either from the osd or global section of
the config).

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
a99d1a5fe8 ceph-daemon: add ceph-volume subcommand
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
1aea25d264 ceph-daemon: remove unused CephContainer dname property
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
947a1ac2ea ceph-daemon: drop useless uid/gid checks
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
f10e645c15 mgr/ssh: deploy new mgrs with ceph-daemon
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
b8bf523e9d mgr/ssh: factor _create_daemon out of create_mon
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
ede50f505b mon/MonCap: allow mgr to create new auth keys
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
123eb32576 mgr/ssh: run c-v with podman when getting inventory
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
24049fcda4 mgr/ssh: simplify ssh connection management
- Use a single instance of the config and identity files for the whole
module.  There's no need to create these for *every* connection--it just
pollutes /tmp.
- Drop the SSHConnection wrapper, since the temp files are tied to the
daemon lifecycle now.
- Prefix the tmp files so I can tell wtf is going on.
- Always connect to root@host, to avoid remoto's localhost detection
feature.  This ensures we have a consistent connection model and user.
(The daemon might be running as user ceph and try to connect to localhost,
but end up running the command as the wrong user and/or inside the
ceph-mgr container.)

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
636a0b2e6b mgr/ssh: use ceph-daemon for deploying mon
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
e2dbba4626 ceph-daemon: allow --mon-network for deploying new mon (vs specifying IP)
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
8709dbb6de ceph-daemon: --config-and-keyring (not key)
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
9b8f933f17 common/options: add 'image' config option
Defaults to 'ceph/daemon-base'.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
2ba80e73cb test_ceph_daemon: specify image name
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 20:33:35 -05:00
Sage Weil
f523a03044 vstart.sh: add --ssh to enable+configure ssh orchestrator
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 14:37:28 -05:00
Sage Weil
66835389c5 mgr/ssh: use ssh identity from config-key, if present
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 14:37:28 -05:00
Sage Weil
d0b950abdf mgr/ssh: hardcode default ssh_config
Use this unless either ssh_config or ssh_config_file are present.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 14:37:28 -05:00
Sage Weil
0b5284c414 ceph-daemon: store ssh identity in mon config-key store
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 14:37:28 -05:00
Sage Weil
68be44898b ceph-daemon: --privileged arg for 'exec'
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 14:37:28 -05:00
Sage Weil
5ce40e65db ceph-daemon: make deploy work for osd (do a c-v prepare)
This is sufficient to deploy an OSD that is based on ceph-volume lvm.
YMMV if it's not an lvm-based OSD.

Run the OSD container privileged so we can open the raw block device.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 14:37:28 -05:00
Sage Weil
cf30d49e43 ceph-daemon: make shell privileged
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 14:37:28 -05:00
Sage Weil
1fa7ef1613 ceph-daemon: move get_container_mounts to a helper
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 14:37:28 -05:00
Sage Weil
97d5a547f4 ceph-daemon: pass full path for entrypoint
Sometimes we run things in /usr/sbin...

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 14:37:28 -05:00
Sage Weil
be62368306 ceph-daemon: make id portion of 'shell' optional
This lets you start up a 'generic' container of a particular class,
without a data mount, but with the appropriate other mounts and privilege
levels.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 14:37:28 -05:00
Sage Weil
e6c578a2bc ceph-volume: accept --no-tmpfs argument for bluestore
When activating a bluestore inside a container, we want to (be able to)
make the osd dir metadata persistent inside the container.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 14:37:28 -05:00
Sage Weil
6924a8ea72 ceph-daemon: 'unit' command
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-04 14:37:28 -05:00
Sage Weil
3d8bbcf36e ceph-daemon: fix run command to use call(), not check_output()
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-02 07:11:12 -05:00
Sage Weil
dc5204f1e5 src/ceph-daemon: whitespace
Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-02 07:11:12 -05:00
Sage Weil
935e529564 ceph-daemon: add 'enter', 'exec' commands
'enter' is really just 'exec' + bash

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-02 07:11:12 -05:00
Sage Weil
c6545b194f ceph-daemon: bind config to default location
This is one less thing on the command line, and an easier time when inside
the container.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-02 07:11:12 -05:00