Chapter 13. Provisioning Cloud Instances in Google Compute Engine

Red Hat Satellite 6 can interact with Google Compute Engine (GCE), including creating new virtual machines and controlling their power management states. Only image-based provisioning is supported for creating GCE hosts.

13.1. Prerequisites for GCE Provisioning

Before you begin, ensure that the following conditions are met:

  • In your GCE project, configure a service account with the necessary IAM Compute role. For more information, see Compute Engine IAM roles in the GCE documentation.
  • In your GCE project-wise metadata, set the enable-oslogin to FALSE. For more information, see Enabling or disabling OS Login in the GCE documentation.
  • Optional: If you want to use Puppet with GCE hosts, navigate to Administer > Settings > Puppet and enable the Use UUID for certificates setting to configure Puppet to use consistent Puppet certificate IDs.
  • Based on your needs, associate a finish or user_data provisioning template with the operating system you want to use. For more information about provisioning templates, see Section 3.7.1, “Types of Provisioning Templates”.
  • Synchronize content repositories for the version of Red Hat Enterprise Linux that you want to use. For more information, see Synchronizing Red Hat Repositories in the Content Management Guide.
  • Create an activation key for host registration. For more information, see Creating An Activation Key in the Content Management guide.

13.2. Adding a GCE Connection to Satellite Server

Use this procedure to add a GCE connection to Satellite Server to be able to add images and provision hosts on GCE.


To add a connection, complete the following steps:

  1. In GCE, generate a service account key in JSON format and upload this file to the /usr/share/foreman/ directory on Satellite Server.
  2. On Satellite Server, configure permissions for the service account key to ensure that the file is readable by the foreman user:

    # chown foreman /usr/share/foreman/gce_key.json
    # chmod 0600 /usr/share/foreman/gce_key.json
    # restorecon -vv /usr/share/foreman/gce_key.json
  3. In the Satellite web UI, navigate to Infrastructure > Compute Resources and click Create Compute Resource.
  4. In the Name field, enter a name for the resource.
  5. From the Provider list, select Google.
  6. Optional: In the Description field, enter a description for the resource.
  7. In the Google Project ID field, enter the project ID.
  8. In the Client Email field, enter the client email.
  9. In the Certificate Path field, enter the path to the service account key. For example, /usr/share/foreman/gce_key.json.
  10. Click Load Zones to populate the list of zones from your GCE environment.
  11. From the Zone list, select the GCE zone to use.
  12. Click Submit.

13.3. Adding GCE Images to Satellite Server

GCE uses image-based provisioning to create hosts. You must add image details to your Satellite Server.


To add an image, complete the following steps:

  1. In the Satellite web UI, navigate to Infrastructure > Compute Resources and click the GCE connection.
  2. Click the Images tab.
  3. Click Create Image.
  4. In the Name field, enter a name for the image.
  5. From the Operating system list, select the base operating system for the image.
  6. From the Architecture list, select the operating system architecture.
  7. In the User field, enter the SSH user name for image access. Specify a user other than root, because the root user cannot connect to a GCE instance using SSH keys. The username must begin with a letter and consist of lowercase letters and numbers.
  8. From the Image list, select the GCE image.
  9. Optional: If the selected image supports cloud-init, select the User data check box to enable user data input.
  10. Click Submit to save the image details.

13.4. Adding GCE Details to a Compute Profile

You can add GCE details to a compute profile to automatically populate virtual machine-based settings on host creation.


To add details to a compute profile, complete the following steps:

  1. In the Satellite web UI, navigate to Infrastructure > Compute Profiles and click the name of your profile.
  2. Select a GCE connection.
  3. From the Machine Type list, select the machine type to use for provisioning.
  4. From the Image list, select the image to use for provisioning.
  5. From the Network list, select the GCE network to use for provisioning.
  6. Optional: Select the Associate Ephemeral External IP check box to assign a dynamic ephemeral IP address that Satellite uses to communicate with the host. This public IP address changes when you reboot the host. If you need a permanent IP address, reserve a static public IP address on GCE and attach it to the host.
  7. In the Size (GB) field, enter the size of the storage to create on the host.
  8. Click Submit to save the compute profile.

13.5. Creating Image-Based Hosts on GCE

The GCE provisioning process creates hosts from existing images on GCE.


To create a host on GCE, complete the following steps:

  1. In the Satellite web UI, navigate to Hosts > Create host.
  2. In the Name field, enter a name for the host.
  3. Click the Organization and Location tabs to ensure that the provisioning context is automatically set to the current context.
  4. Optional: From the Host Group list, you can select a host group to populate most of the new host’s fields.
  5. From the Deploy on list, select the GCE connection.
  6. From the Compute Profile list, select a profile to use to automatically populate virtual machine-based settings.
  7. Click the Interface tab and click Edit on the host’s interface.
  8. Verify that the fields are automatically populated with values, particularly the following items:

    • The Name from the Host tab becomes the DNS name.
    • The MAC address field is blank.
    • The Domain field is populated with the required domain.
    • The Managed, Primary, and Provision options are automatically selected for the first interface on the host. If not, select them.
  9. Click the Operating System tab, and select the operating system to install.
  10. Click Resolve in Provisioning templates to verify that the new host can identify the correct provisioning templates to use. You must select either a finish or user_data provisioning template.
  11. Click the Parameters tab and ensure that a parameter exists that provides an activation key. If not, add an activation key.
  12. Click Submit to save the host entry.