copyright | lastupdated | keywords | subcollection | ||
---|---|---|---|---|---|
|
2023-07-07 |
satellite, hybrid, attaching hosts, hosts, attach hosts, attach hosts to location |
satellite |
{{site.data.keyword.attribute-definition-list}}
{: #attach-hosts}
After you create the location in {{site.data.keyword.satellitelong}}, add compute capacity to your location so that you can set up {{site.data.keyword.redhat_openshift_notm}} clusters or interact with other {{site.data.keyword.satelliteshort}}-enabled {{site.data.keyword.cloud_notm}} services. {: shortdesc}
To attach Red Hat CoreOS (RHCOS) hosts, your location must be enabled for Red Hat CoreOS. For more information, see Creating a location. Note that you can still attach Red Hat Enterprise Linux hosts to a location that is enabled for Red Hat CoreOS.
Before you begin, make sure that you have created host machines that meet the minimum hardware requirements in your on-prem data center, in {{site.data.keyword.cloud_notm}}, or in public cloud providers. For more information about how to configure hosts in public cloud providers to meet these minimum requirements, see Cloud infrastructure providers.
After you attach a host to your location, {{site.data.keyword.satelliteshort}} disables the ability to log in to the host as root with SSH for security purposes. You might see error messages if you try to SSH as root into a host that is attached successfully to a location. To restore the ability to SSH into the machine, you can remove the host and reload the operating system.
Not sure how many hosts to attach to your location? See Sizing your {{site.data.keyword.satelliteshort}} location. {: tip}
{: #host-attach-download}
To attach hosts to your location, you must download a host attachment script. After you download the script, you can run it on your hosts to attach them to your location. You can get the attachment script from the console or by running the sat host attach
command. Note that for CoreOS hosts, the attachment script is an ignition (.ign
) file. For RHEL hosts, the attachment script is a Shell script.
-
Download the host attachment script.
-
To get the host attachment script from the console:
- Navigate to the Locations dashboard{: external}, select the location where you want to attach hosts.
- From the Hosts tab, click Attach host.
- Optional: Enter any labels that you want to add to your hosts so that you can identify your hosts more easily later. Labels must be provided as key-value pairs. For example, you can use
use=satcp
oruse=satcluster
to show that you want to use these hosts for your {{site.data.keyword.satelliteshort}} control plane or a {{site.data.keyword.redhat_openshift_notm}} cluster. By default, your hosts get acpu
, anos
, and amemory
label, but you might want to add more to control the auto assignment, such asenv=prod
orservice=database
. Note that the default value foros
isrhel
. - Enter a file name for your script or use the name that is generated for you.
- Select RHEL or RHCOS to download the host script for your host system.
- Click Download script to generate the host script and download the script to your local machine. Note that the token in the script is an API key, which should be treated and protected as sensitive information.
-
To get the host attachment script from the CLI:
-
Generate a script to run on your machines to attach them to your location by using the
sat host attach
command and specify the host operating system by using the--operating-system
command option. When you run the command to generate the script, you might also want to include labels to identify the purpose of the hosts, such asuse:satloc
. Your hosts are automatically assigned labels for the CPU and memory size if these values can be detected on the machine.Example
host attach
command for a RHCOS host.ibmcloud sat host attach --location <location_name> [-hl "use=satloc"] --operating-system RHCOS
{: pre}
Example
host attach
command for a RHEL host.ibmcloud sat host attach --location <location_name> [-hl "use=satloc"] --operating-system RHEL
{: pre}
Example output
Creating host registration script... OK The script to attach hosts to Satellite location 'mylocation' was downloaded to the following location: <filepath_to_script>/register-host_mylocation_attach_hypershift.ign
{: screen}
-
-
-
Optional: If your hosts are RHEL hosts, you need to update the required packages on your hosts before you can run the script. If your hosts are running the latest Red Hat CoreOS images, you do not need to update the packages.
-
Attach your hosts to your location by running the attachment script.
- If your hosts are in another cloud provider, follow the provider-specific steps to run the script and attach your host.
- If your hosts are in an on-premises data center, see Attaching on-premises RHCOS hosts or Attaching on-premises RHEL hosts.
After you attach a host to your location, {{site.data.keyword.satelliteshort}} disables the ability to log in to the host via SSH for security purposes. You might see error messages if you try to SSH into a host that has been successfully attached to a location. To restore the ability to SSH into the machine, you can remove the host and reload the operating system. {: note}
{: #attach-rhel-hosts}
To attach RHEL hosts that reside in your on-premises data center to your location, follow these general steps to run the host attachment script.
-
Download the host script for your location.
-
Retrieve the public IP address of your host, or if your host has only a private network interface, the private IP address of your host.
-
Copy the script from your local machine to your host.
scp -i <filepath_to_key_file> <filepath_to_script> <username>@<IP_address>:/tmp/attach.sh
{: pre}
-
Log in to your host.
ssh -i <filepath_to_key_file> <username>@<IP_address>
{: pre}
-
Update your host to have the required RHEL packages. For more information about how to install these package, see the Red Hat documentation{: external}.
-
Run the script.
sudo nohup bash /tmp/attach.sh &
{: pre}
-
Check the progress of the registration script.
journalctl -f -u ibm-host-attach
{: pre}
-
As you run the scripts on each machine, check that your hosts are shown in the Hosts tab of your location dashboard. This process might take a few minutes to complete. All hosts show a Health status of
Ready
when a heartbeat for the machine can be detected, and a Status ofUnassigned
as the hosts are not yet assigned to your {{site.data.keyword.satelliteshort}} control plane or a {{site.data.keyword.redhat_openshift_notm}} cluster. -
After you have attached your hosts, assign them to the {{site.data.keyword.satelliteshort}} control plane or use them to create a {{site.data.keyword.openshiftlong_notm}} cluster.
If your host is not attaching to your location, you can log in to the host to debug it. For more information, see Logging in to a RHEL host machine to debug. {: tip}
After you attach a host to your location, {{site.data.keyword.satelliteshort}} disables the ability to log in to the host as root with SSH for security purposes. You might see error messages if you try to SSH as root into a host that is attached successfully to a location. To restore the ability to SSH into the machine, you can remove the host and reload the operating system. {: note}
{: #attach-rhcos-hosts}
To attach Red Hat CoreOS (RHCOS) hosts that reside in your on-premises data center to your location, follow these general steps to run the host attachment script.
- Download the host script for your location. Note that for RHCOS hosts, the attachment script is a Red Hat CoreOS ignition (
.ign
) file. - Boot your RHCOS host and include the file path to the ignition script as the
--user-data
. This command varies, depending on the type of host that you are adding. For example, if your hosts are Amazon Web Services (AWS) cloud hosts, then you add--user-data file:///tmp/attach_hypershift.ign
to your launch template{: external}. Consult your provider documentation for more information about how to boot your host and include a file path to the ignition script. - As you run the scripts on each machine, check that your hosts are shown in the Hosts tab of your location dashboard. This process might take a few minutes to complete. All hosts show a Health status of
Ready
when a heartbeat for the machine can be detected, and a Status ofUnassigned
as the hosts are not yet assigned to your {{site.data.keyword.satelliteshort}} control plane or a {{site.data.keyword.redhat_openshift_notm}} cluster. - Assign your hosts to the {{site.data.keyword.satelliteshort}} control plane or a {{site.data.keyword.openshiftlong_notm}} cluster.
If your host is not attaching to your location, you can log in to the host to debug it. For more information, see Logging in to a RHCOS host machine to debug. {: tip}
After you attach a host to your location, {{site.data.keyword.satelliteshort}} disables the ability to log in to the host as root with SSH for security purposes. You might see error messages if you try to SSH as root into a host that is attached successfully to a location. To restore the ability to SSH into the machine, you can remove the host and reload the operating system. {: note}