Chapter 8. Assigning roles to hosts You can assign roles to your discovered hosts. These roles define the function of the host within the cluster. The roles can be one of the standard Kubernetes types: control plane (master) or worker . The host must meet the minimum requirements for the role you selected. You can find the hardware requirements by referring to the Prerequisites section of this document or using the preflight requirement API. If you do not select a role, the system selects one for you. You can change the role at any time before installation starts. 8.1. Selecting a role by using the web console You can select a role after the host finishes its discovery. Procedure Go to the Host Discovery tab and scroll down to the Host Inventory table. Select the Auto-assign drop-down for the required host. Select Control plane node to assign this host a control plane role. Select Worker to assign this host a worker role. Check the validation status. 8.2. Selecting a role by using the API You can select a role for the host by using the /v2/infra-envs/{infra_env_id}/hosts/{host_id} endpoint. A host can have one of the following roles: master : A host with the master role operates as a control plane node. worker : A host with the worker role operates as a worker node. By default, the Assisted Installer sets a host to auto-assign , which means the Assisted Installer will determine whether the host is a master or worker role automatically. Use this procedure to set the host's role. Prerequisites You have added hosts to the cluster. Procedure Refresh the API token: USD source refresh-token Get the host IDs: USD curl -s -X GET "https://api.openshift.com/api/assisted-install/v2/clusters/USDCLUSTER_ID" \ --header "Content-Type: application/json" \ -H "Authorization: Bearer USDAPI_TOKEN" \ | jq '.host_networks[].host_ids' Example output [ "1062663e-7989-8b2d-7fbb-e6f4d5bb28e5" ] Modify the host_role setting: USD curl https://api.openshift.com/api/assisted-install/v2/infra-envs/USD{INFRA_ENV_ID}/hosts/<host_id> \ -X PATCH \ -H "Authorization: Bearer USD{API_TOKEN}" \ -H "Content-Type: application/json" \ -d ' { "host_role":"worker" } ' | jq Replace <host_id> with the ID of the host. 8.3. Auto-assigning roles Assisted Installer selects a role automatically for hosts if you do not assign a role yourself. The role selection mechanism factors the host's memory, CPU, and disk space. It aims to assign a control plane role to the weakest hosts that meet the minimum requirements for control plane nodes. The number of control planes you specify in the cluster definition determines the number of control plane nodes that the Assisted Installer assigns. For details, see Setting the cluster details . All other hosts default to worker nodes. The goal is to provide enough resources to run the control plane and reserve the more capacity-intensive hosts for running the actual workloads. You can override the auto-assign decision at any time before installation. The validations make sure that the auto selection is a valid one. 8.4. Additional resources Prerequisites

Commands:
source refresh-token
curl -s -X GET "https://api.openshift.com/api/assisted-install/v2/clusters/USDCLUSTER_ID" --header "Content-Type: application/json" -H "Authorization: Bearer USDAPI_TOKEN" | jq '.host_networks[].host_ids'
1062663e-7989-8b2d-7fbb-e6f4d5bb28e5
curl https://api.openshift.com/api/assisted-install/v2/infra-envs/USD{INFRA_ENV_ID}/hosts/<host_id> -X PATCH -H "Authorization: Bearer USD{API_TOKEN}" -H "Content-Type: application/json" -d ' { "host_role":"worker" } ' | jq