Skip to content

Latest commit

 

History

History
143 lines (102 loc) · 11.3 KB

attach-hosts.md

File metadata and controls

143 lines (102 loc) · 11.3 KB
copyright lastupdated keywords subcollection
years
2020, 2023
2023-07-07
satellite, hybrid, attaching hosts, hosts, attach hosts, attach hosts to location
satellite

{{site.data.keyword.attribute-definition-list}}

Attaching hosts to your location

{: #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}

Downloading the host attachment script for your location

{: #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.

  1. Download the host attachment script.

    • To get the host attachment script from the console:

      1. Navigate to the Locations dashboard{: external}, select the location where you want to attach hosts.
      2. From the Hosts tab, click Attach host.
      3. 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 or use=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 a cpu, an os, and a memory label, but you might want to add more to control the auto assignment, such as env=prod or service=database. Note that the default value for os is rhel.
      4. Enter a file name for your script or use the name that is generated for you.
      5. Select RHEL or RHCOS to download the host script for your host system.
      6. 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:

      1. 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 as use: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}

  2. 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.

  3. Attach your hosts to your location by running the attachment script.

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}

Attaching on-premises RHEL hosts to your location

{: #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.

  1. Download the host script for your location.

  2. 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.

  3. 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}

  4. Log in to your host.

    ssh -i <filepath_to_key_file> <username>@<IP_address>

    {: pre}

  5. Update your host to have the required RHEL packages. For more information about how to install these package, see the Red Hat documentation{: external}.

  6. Run the script.

    sudo nohup bash /tmp/attach.sh &

    {: pre}

  7. Check the progress of the registration script.

    journalctl -f -u ibm-host-attach

    {: pre}

  8. 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 of Unassigned as the hosts are not yet assigned to your {{site.data.keyword.satelliteshort}} control plane or a {{site.data.keyword.redhat_openshift_notm}} cluster.

  9. 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}

Attaching on-premises Red Hat CoreOS hosts to your location

{: #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.

  1. Download the host script for your location. Note that for RHCOS hosts, the attachment script is a Red Hat CoreOS ignition (.ign) file.
  2. 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.
  3. 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 of Unassigned as the hosts are not yet assigned to your {{site.data.keyword.satelliteshort}} control plane or a {{site.data.keyword.redhat_openshift_notm}} cluster.
  4. 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}