Appendix B. The cephadm commands

The cephadm is a command line tool to manage the local host for the Cephadm Orchestrator. It provides commands to investigate and modify the state of the current host.

Some of the commands are generally used for debugging.

Note

cephadm is not required on all hosts, however, it is useful when investigating a particular daemon. The cephadm-ansible preflight playbook installs cephadm on all hosts and the cephadm-ansible purge playbook requires cephadm be installed on all hosts to work properly.

add-repo
Description
Configure local package repository to also include the Ceph repository. This is mainly used for disconnected installation of Red Hat Ceph Storage.
Syntax
cephadm add-repo [--release RELEASE] [--version VERSION] [--repo-url REPO_URL]
Example
[root@host01 ~]# ./cephadm add-repo --version 15.2.1
[root@host01 ~]# ./cephadm add-repo --release pacific
adopt
Description
Convert an upgraded storage cluster daemon to run cephadm.
Syntax
cephadm adopt [-h] --name DAEMON_NAME --style STYLE [--cluster CLUSTER] --legacy-dir [LEGACY_DIR] --config-json CONFIG_JSON] [--skip-firewalld] [--skip-pull]
Example
[root@host01 ~]# cephadm adopt --style=legacy --name prometheus.host02
ceph-volume
Description
This command is used to list all the devices on the particular host. Run the ceph-volume command inside a container Deploys OSDs with different device technologies like lvm or physical disks using pluggable tools and follows a predictable, and robust way of preparing, activating, and starting OSDs.
Syntax
cephadm ceph-volume inventory/simple/raw/lvm [-h] [--fsid FSID] [--config-json CONFIG_JSON] [--config CONFIG, -c CONFIG] [--keyring KEYRING, -k KEYRING]
Example
[root@host01 ~]# cephadm ceph-volume inventory --fsid f64f341c-655d-11eb-8778-fa163e914bcc
check-host
Description
Check the host configuration that is suitable for a Ceph cluster.
Syntax
cephadm check-host [--expect-hostname HOSTNAME]
Example
[root@host01 ~]# cephadm check-host --expect-hostname host02
deploy
Description
Deploys a daemon on the local host.
Syntax
cephadm shell deploy DAEMON_TYPE [-h] [--name DAEMON_NAME] [--fsid FSID] [--config CONFIG, -c CONFIG] [--config-json CONFIG_JSON] [--keyring KEYRING] [--key KEY] [--osd-fsid OSD_FSID] [--skip-firewalld] [--tcp-ports TCP_PORTS] [--reconfig] [--allow-ptrace] [--memory-request MEMORY_REQUEST] [--memory-limit MEMORY_LIMIT] [--meta-json META_JSON]
Example
[root@host01 ~]# cephadm shell deploy mon --fsid f64f341c-655d-11eb-8778-fa163e914bcc
enter
Description
Run an interactive shell inside a running daemon container.
Syntax
cephadm enter [-h] [--fsid FSID] --name NAME [command [command …]]
Example
[root@host01 ~]# cephadm enter --name 52c611f2b1d9
help
Description
View all the commands supported by cephadm.
Syntax
cephadm help
Example
[root@host01 ~]# cephadm help
install
Description
Install the packages.
Syntax
cephadm install PACKAGES
Example
[root@host01 ~]# cephadm install ceph-common ceph-osd
inspect-image
Description
Inspect the local Ceph container image.
Syntax
cephadm --image IMAGE_ID inspect-image
Example
[root@host01 ~]# cephadm --image 13ea90216d0be03003d12d7869f72ad9de5cec9e54a27fd308e01e467c0d4a0a inspect-image
list-networks
Description
List the IP networks.
Syntax
cephadm list-networks
Example
[root@host01 ~]# cephadm list-networks
ls
Description
List daemon instances known to cephadm on the hosts. You can use --no-detail for the command to run faster, which gives details of the daemon name, fsid, style, and systemd unit per daemon. You can use --legacy-dir option to specify a legacy base directory to search for daemons.
Syntax
cephadm ls [--no-detail] [--legacy-dir LEGACY_DIR]
Example
[root@host01 ~]# cephadm ls --no-detail
logs
Description
Print journald logs for a daemon container. This is similar to the journalctl command.
Syntax
cephadm logs [--fsid FSID] --name DAEMON_NAME
cephadm logs [--fsid FSID] --name DAEMON_NAME -- -n NUMBER # Last N lines
cephadm logs [--fsid FSID] --name DAEMON_NAME -- -f # Follow the logs
Example
[root@host01 ~]# cephadm logs --fsid 57bddb48-ee04-11eb-9962-001a4a000672 --name osd.8
[root@host01 ~]# cephadm logs --fsid 57bddb48-ee04-11eb-9962-001a4a000672 --name osd.8 -- -n 20
[root@host01 ~]# cephadm logs --fsid 57bddb48-ee04-11eb-9962-001a4a000672 --name osd.8 -- -f
prepare-host
Description
Prepare a host for cephadm.
Syntax
cephadm prepare-host [--expect-hostname HOSTNAME]
Example
[root@host01 ~]# cephadm prepare-host
[root@host01 ~]# cephadm prepare-host --expect-hostname host03
pull
Description
Pull the Ceph image.
Syntax
cephadm [-h] [--image IMAGE_ID] pull
Example
[root@host01 ~]# cephadm --image 13ea90216d0be03003d12d7869f72ad9de5cec9e54a27fd308e01e467c0d4a0a pull
registry-login
Description
Give cephadm login information for an authenticated registry. Cephadm attempts to log the calling host into that registry.
Syntax
cephadm registry-login --registry-url [REGISTRY_URL] --registry-username [USERNAME] --registry-password [PASSWORD] [--fsid FSID] [--registry-json JSON_FILE]
Example
[root@host01 ~]# cephadm registry-login --registry-url registry.redhat.io --registry-username myuser1 --registry-password mypassword1

You can also use a JSON registry file containing the login info formatted as:

Syntax
cat REGISTRY_FILE

{
 "url":"REGISTRY_URL",
 "username":"REGISTRY_USERNAME",
 "password":"REGISTRY_PASSWORD"
}
Example
[root@host01 ~]# cat registry_file

{
 "url":"registry.redhat.io",
 "username":"myuser",
 "password":"mypass"
}

[root@host01 ~]# cephadm registry-login -i registry_file
rm-daemon
Description
Remove a specific daemon instance. If you run the cephadm rm-daemon command on the host directly, although the command removes the daemon, the cephadm mgr module notices that the daemon is missing and redeploys it. This command is problematic and should be used only for experimental purpose and debugging.
Syntax
cephadm rm-daemon [--fsid FSID] [--name DAEMON_NAME] [--force ] [--force-delete-data]
Example
[root@host01 ~]# cephadm rm-daemon --fsid f64f341c-655d-11eb-8778-fa163e914bcc --name osd.8
rm-cluster
Description
Remove all the daemons from a storage cluster on that specific host where it is run. Similar to rm-daemon, if you remove a few daemons this way and the Ceph Orchestator is not paused and some of those daemons belong to services that are not unmanaged, the cephadm orchestrator just redeploys them there.
Syntax
cephadm rm-cluster [--fsid FSID] [--force]
Example
[root@host01 ~]# cephadm rm-cluster --fsid f64f341c-655d-11eb-8778-fa163e914bcc
rm-repo
Description
Remove a package repository configuration. This is mainly used for disconnected installation of Red Hat Ceph Storage.
Syntax
cephadm rm-repo [-h]
Example
[root@host01 ~]# cephadm rm-repo
run
Description
Run a Ceph daemon, in a container, in the foreground.
Syntax
cephadm run [--fsid FSID] --name DAEMON_NAME
Example
[root@host01 ~]# cephadm run --fsid f64f341c-655d-11eb-8778-fa163e914bcc --name osd.8
shell
Description
Run an interactive shell with access to Ceph commands over the inferred or specified Ceph cluster. You can enter the shell using cephadm shell command and run all the orchestrator commands within the shell.
Syntax
cephadm shell  [--fsid FSID] [--name DAEMON_NAME, -n DAEMON_NAME] [--config CONFIG, -c CONFIG] [--mount MOUNT, -m MOUNT] [--keyring KEYRING, -k KEYRING] [--env ENV, -e ENV]
Example
[root@host01 ~]# cephadm shell -- ceph orch ls
[root@host01 ~]# cephadm shell
unit
Description
Start, stop, restart, enable, and disable the daemons with this operation. This operates on the daemon’s systemd unit.
Syntax
cephadm unit [--fsid FSID] --name DAEMON_NAME start/stop/restart/enable/disable
Example
[root@host01 ~]# cephadm unit --fsid f64f341c-655d-11eb-8778-fa163e914bcc --name osd.8 start
version
Description
Provides the version of the storage cluster.
Syntax
cephadm version
Example
[root@host01 ~]# cephadm version