Adding topological labels to a host

Use topological labels in multi-rack environments to help cephadm be aware of the topological layout of the hosts in the cluster. Topological labels enable upgrade operations on specific hosts.

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

Add topological labels either with the command-line interface or with the host specification file.

Adding topological labels with the command-line interface

Add topological labels with the cephadm shell with either the host add or set-topological-labels commands.

About this task

Labels are written in the following format: hardware_identifier=user_label. Hardware identifiers can be data center or rack. Multiple labels can be used with a comma separator.

Procedure

Use one of the following commands to add topological labels to a host:
  • Use the host add command with the --topological-labels option.
    ceph orch host add HOSTNAME IP_ADDRESS --topological-labels TOPOLOGICAL_LABEL1,TOPOLOGICAL_LABEL2
    For example,
    [root@host01] # ceph orch host add host02 10.10.128.69 --topological-labels datacenter=A,rack=3
  • Use the set-topological-labels command.
    Important: The set-topological-labels command overwrites any existing topological labels. Running the command with no labels specified clears all labels for the host. Running the command with labels replaces existing labels on the host. Labels used while running this command does not add to existing labels.
    ceph orch host set-topological-labels HOSTNAME TOPOLOGICAL_LABEL1,TOPOLOGICAL_LABEL2
    For example,
    [root@host01] # ceph orch host set-topological-labels host02 datacenter=A,rack=3

Adding topological labels with a service specification file

Set topological labels from within the host specification file.

Procedure

Add topical labels to the host service specification file.
service_type: host
hostname: HOSTNAME
addr: IP_ADDRESS
toplogical_labels:
  HARDWARE_IDENTIFIER1: USER_LABEL1
  HARDWARE_IDENTIFIER2: USER_LABEL2
For example,
service_type: host
hostname: host02
addr: 10.10.128.69
toplogical_labels:
  datacenter: A
  rack: 3

What to do next

Find existing topological labels for a host by using the ceph orch host ls -f yaml command.