Adding multiple hosts

Add multiple hosts at a time to the storage cluster, by using a YAML file.

Before you begin

Before you begin, make sure that you have the following prerequisites in place:
  • A storage cluster is installed and bootstrapped.
  • Root-level access to all nodes in the storage cluster.

About this task

Note: Be sure to create the hosts.yaml file within a host container, or create the file on the local host and then use the cephadm shell to mount the file within the container. The cephadm shell automatically places mounted files in /mnt. If you create the file directly on the local host and then apply the hosts.yaml file instead of mounting it, a File does not exist error message displays.

Procedure

  1. Copy the public ssh key to each of the hosts that you want to add.
  2. Use a text editor to create a hosts.yaml file.
  3. Add the host descriptions to the hosts.yaml file.
    Include the labels to identify placements for the daemons that you want to deploy on each host. Separate each host description with three dashes (---).
    service_type: host
    addr:
    hostname: host02
    labels:
    - mon
    - osd
    - mgr
    ---
    service_type: host
    addr:
    hostname: host03
    labels:
    - mon
    - osd
    - mgr
    ---
    service_type: host
    addr:
    hostname: host04
    labels:
    - mon
    - osd
  4. Mount the hosts.yaml file.
    • If you created the hosts.yaml file directly on the local host, use the cephadm shell to mount the file.
      cephadm shell --mount hosts.yaml -- ceph orch apply -i /mnt/hosts.yaml
      For example,
      [root@host01 ~]# cephadm shell --mount hosts.yaml -- ceph orch apply -i /mnt/hosts.yaml
    • If you created the hosts.yaml file within the host container, run the ceph orch apply command.
      For example,
      [ceph: root@host01 /]# ceph orch apply -i hosts.yaml
      Added host 'host02' with addr '10.10.128.69'
      Added host 'host03' with addr '10.10.128.70'
      Added host 'host04' with addr '10.10.128.71'
  5. View the list of hosts and their labels.
    [ceph: root@host01 /]# ceph orch host ls
    HOST      ADDR      LABELS          STATUS
    host02   host02    mon,osd,mgr
    host03   host03    mon,osd,mgr
    host04   host04    mon,osd
    Note: If a host is online and operating normally, its status is blank. An offline host shows a status of OFFLINE, and a host in maintenance mode shows a status of MAINTENANCE.