Manage content host cloud instances on Google Compute Platform by using Red Hat Satellite.
This section is optional.
You can go through the section if you are interested in provisioning cloud instances in Google Compute Engine.
Google Compute Engine (GCE) is a web service that provides a public cloud platform. Satellite interacts with GCE to create virtual machines and to control their power management states. GCE supports only image-based provisioning for creating hosts.
To prepare your on-premise Satellite Server to manage GCE instances, synchronize the appropriate content repositories for Red Hat Enterprise Linux and custom products.
Create activation keys for host registrations by configuring each key with subscriptions, a lifecycle environment, content view, repositories, and host collection membership to support the content host's applications.
In your GCE project, configure a service account with the necessary Identity and Access Management (IAM) Compute role, and set the enable-oslogin parameter to false.
Then, associate a finish or user-data provisioning template with the operating system to use.
To create a GCE connection, first generate a service account key in JSON format in GCE.
Then, copy the key to the /usr/share/foreman directory on Satellite Server.
Change the key owner to the foreman user, set the appropriate permissions, and restore the SELinux context.
[root@satellite ~]#chown foreman /usr/share/foreman/[root@satellite ~]#keyname.jsonchmod 600 /usr/share/foreman/[root@satellite ~]#keyname.jsonrestorecon /usr/share/foreman/keyname.json
In the Satellite web UI, navigate to → , click , and enter a name for the compute resource. From the list, select Google. Use the field to enter information to recognize the resource later.
Enter the GCE project ID in the field. Complete the field. In the field, select the previously generated service account key. Click to populate the list, and select the GCE zone to use for this connection. Finally, click .
You can also use the hammer command for the same task.
[root@satellite ~]#hammer compute-resource create --name"gce_resource"\--provider"gce"--project"gce_project_id"\--key-path"key.json"--zone"us-east-1"\"gce@email.com"
GCE uses image-based provisioning to create hosts. Load your Cloud Access-enabled images to GCE. Alternatively, Red Hat provides Gold Google Machine Images for Red Hat Cloud Access clients to use.
Google gold images are not preconfigured to use the Red Hat Update Infrastructure (RHUI). To maintain the cloud instances that are deployed from the gold images, use the Red Hat Subscription Management or Red Hat Satellite.
To add image details for your uploaded or existing Google images to the Satellite Server, including access details and image location, navigate to → and select a GCE connection. Then, click .
Supply a name to identify the image for future use.
Select the operating system and architecture that corresponds with the image.
Enter the username and password for an account that is already configured on that image that allows access for post-configuration and ongoing management.
Specify a user other than the root user, because the root user cannot connect to a GCE instance by using SSH keys.
Select an image from the GCE compute resource in the list.
If your image supports user data input, then select the checkbox.
For user-data input, you must build the image with the cloud-init tool or similar configuration tooling.
Click to save the image details.
You can use the hammer command for the same task:
[root@satellite ~]#hammer compute-resource image create --name"gce_image"\--operatingsystem"RHEL 7.7"--architecture"x86_64"--username admin \--user-data true --uuid"my_uuid"--compute-resource"gce_resource"
You can add GCE hardware settings to a compute profile, so that when you create a host by using the compute profile, the settings are automatically populated.
To add hardware settings to a compute profile, navigate to → and select a GCE compute profile. Select the values for the , , and lists. Finally, enter the storage size to create on the host in the field. Click to save the image details.
You can use the hammer command for the same task.
Enter the --compute-attributes option as a long, single line.
[root@satellite ~]#hammer compute-resource values create \--compute-profile"gce_profile"--compute-resource"gce_resource"\--volume"size_gb=30"--architecture"x86_64"--username root \--compute-attributes="machine_type=f1-micro,associate_external_ip=true, network=default"
The GCE provisioning process creates hosts from existing images on the GCE server.
To deploy a new host, navigate to → . After entering a name for the new host, select a host group from the list to populate most of the new host's fields. Select a GCE connection and compute profile to automatically populate the virtual-machine-based settings.
On the tab, verify that the host's interface information is already populated with values. Satellite Server automatically selects an IP address and set the , , and options for the first interface on the host. Leave the field blank, for the cloud provider to autogenerate it.
Verify that the fields on the and tabs are populated with values. On the tab, ensure that a parameter exists that provides an activation key. If the parameter does not exist, then add an activation key. Click to save your host entry, which immediately triggers the GCE service to create the instance, by using the specified image as the new host's boot volume.
You can also use the hammer command for the same task.
Enter the --compute-attributes option as a long, single line.
[root@satellite ~]#hammer host create --name"gce-test1"\--organization"Finance"--location"Boston"--hostgroup"Base"\--compute-resource"gce_resource"--provision-method image \--image"gec_image"--root-passwordroot_password\--interface"managed=true,primary=true,provision=true,domain_id=1"\--puppet-environment-id 1 --puppet-ca-proxy-id 1 --puppet-proxy-id 1 \--architecture x86_64 --operatingsystem "RHEL 7.7"
For more information about Red Hat in the public cloud, see https://access.redhat.com/public-cloud
For more information, see the Provisioning Cloud Instances on Google Compute Engine section in the Provisioning Guide at https://access.redhat.com/documentation/en-us/red_hat_satellite/6.11/html-single/provisioning_hosts/index#Provisioning_Cloud_Instances_on_Google_Compute_Engine_provisioning