IBM Cloud Docs
Attaching Google Cloud Platform (GCP) hosts

Attaching Google Cloud Platform (GCP) hosts

Learn how attach Google Cloud Platform (GCP) virtual instances to your IBM Cloud Satellite location.

To attach Red Hat CoreOS (RHCOS) hosts, your location must be enabled for Red Hat CoreOS. For more information, see Is my location enabled for Red Hat CoreOS?. 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 create host machines that meet the minimum hardware requirements in your on-prem data center, in IBM Cloud, or in public cloud providers.

After you attach a host to your location, Satellite 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 Satellite location.

Manually adding hosts to Satellite in the GCP console

You can create your Satellite location by using hosts that you added from Google Cloud Platform (GCP).

If you want to use Red Hat CoreOS (RHCOS) hosts in your location, provide your RHCOS image file to your Google account. For more information, see Creating custom images. To find RHCOS images, see the list of available images. Note that you must use at least version 4.9.

Before you begin, create a Satellite location.

  1. From the Satellite console, select the location where you want to add GCP hosts.

  2. Retrieve the host registration script that you must run on your hosts to make them visible to your IBM Cloud Satellite location.

    1. From the Hosts tab, click Attach host.
    2. Optional: Enter any host labels that are used later to automatically assign hosts to Satellite-enabled IBM Cloud services in the location. Labels must be provided as key-value pairs, and must match the request from the service. For example, you might have host labels such as env=prod or service=database. By default, your hosts get a cpu label, but you might want to add more to control the auto assignment, such as env=prod or service=database.
    3. Enter a file name for your script or use the name that is generated for you.
    4. 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.
  3. RHEL hosts only Open the registration script. After the API_URL line, add a section to pull the required RHEL packages with the subscription manager.

    # Enable GCP RHEL package updates
    yum update --disablerepo=* --enablerepo="*" -y
    yum repolist all
    yum install container-selinux -y
    yum install subscription-manager -y
    
  4. From the GCP main menu, navigate to the Compute Engine dashboard and select Instance templates.

  5. Click Create instance template.

  6. Enter the details for your instance template as follows.

    For an overview of available options when creating an instance template, see the GCP documentation.

    1. Enter a name for your instance template.
    2. In the Machine configuration section, select the Series and Machine type that you want to use. You can select any series that you want, but make sure that the machine type meets the minimum host requirements for CPU and memory.
    3. In the Boot disk section, click Change to change the default operating system and boot disk size. Make sure to select Red Hat Enterprise Linux 8 as your operating system for Red Hat Enterprise Linux or the Red Hat CoreOS image that you provided earlier and to change your boot disk size to a minimum of 100 GB.
    4. Optional: If you want your machines to allow HTTP and HTTPS traffic, select Allow HTTP traffic and Allow HTTPS traffic from the Firewall section of your instance template.
    5. Click Management, security, disks, networking, sole tenancy to view additional networking and security settings.
    6. In the Management tab, locate the Startup script field and enter the registration script that you modified earlier.
    7. In the Networking tab, choose the network that you want your instances to be connected to. This network must allow access to IBM Cloud Satellite as described in Firewall settings. You can check and change the firewall settings for your network in the next step.
    8. Click Create to save your instance template.
  7. Optional: Update the firewall settings for the network that you assigned to your instance template. 9. From the GCP main menu, navigate to the VPC Network dashboard and select Firewall. 10. Verify that your network allows access as describe in the Network firewall settings. Make changes as necessary.

  8. From the GCP Compute Engine dashboard, select Instance templates and find the instance template that you created.

  9. From the actions menu, click Create VM to create an instance from your template. You can alternatively click Create Instance Group to create an instance group to add multiple instances at the same time. Make sure that you spread your instances across multiple zones for higher availability.

  10. Wait for the instance to create. During the creation of your instance, the registration script runs automatically. This process takes a few minutes to complete. You can monitor the progress of the script by reviewing the logs for your instance. Check that your hosts are shown in the Hosts tab of your Satellite console. All hosts show a Health status of Ready when a connection to the machine can be established, and a Status of Unassigned as the hosts are not yet assigned to your Satellite location control plane or a Red Hat OpenShift on IBM Cloud cluster.

  11. Assign your GCP hosts to the Satellite location control plane or a Red Hat OpenShift on IBM Cloud cluster.

Manually ordering hosts with the gcloud CLI

When you order your instances, pass the --metadata-from-file user-data option and include your attach script. For more information, see the gcloud compute instances create command reference.

Example command to order and attach GCP VMs to your Satellite location.

gcloud compute instances create INSTANCE-1 INSTANCE-2 INSTANCE-3 --machine-type=n2-standard-8 --source-instance-template INSTANCE-TEMPLATE --metadata-from-file user-data=ATTACH-SCRIPT-LOCATION --zone ZONE --image-family=IMAGE-FAMILY --image-project=IMAGE-PROJECT

Network firewall settings

As described in the host networking requirements, your GCP hosts must have access to connect to IBM Cloud Satellite. You might find that you need to update your firewall settings in GCP, similar to the following example.

Network default

Priority 1000

Direction Ingress

Action on match Allow

Targets
Target tags
satellite

Source filters
IP ranges
0.0.0.0/0

Protocols and ports
tcp:80
tcp:443
tcp:30000-32767
udp:30000-32767

For more information, see VPC firewall rules overview in the Google Cloud Platform documentation.

I added hosts to my location, what's next?

Now that you added hosts to your location, you can assign them to your location control plane or to your IBM Cloud services.

  1. Assign hosts to the location control plane or to your IBM Cloud services.
  2. Create a Satellite-enabled IBM Cloud service, such as a Red Hat OpenShift cluster. You can even register existing Red Hat OpenShift clusters to your location to use as deployment targets.
  3. Manage your applications with Satellite Config.
  4. Create Satellite cluster storage templates.
  5. Learn more about the Satellite Link component and how you can use endpoints to manage the network traffic between your location and IBM Cloud.

Need help? Check out Getting support where you can find information about cloud status, issues, and logging; contacting support; and setting your email notification preferences for IBM Cloud platform-related items.