Chapter 13. Provisioning Cloud Instances on Red Hat OpenStack Platform


Red Hat OpenStack Platform provides the foundation to build a private or public Infrastructure-as-a-Service (IaaS) cloud. It offers a massively scalable, fault-tolerant platform for the development of cloud-enabled workloads. In Satellite, you can interact with Red Hat OpenStack Platform REST API to create cloud instances and control their power management states.

Prerequisites

13.1. Adding the Red Hat OpenStack Platform Connection to Satellite Server

You can add Red Hat OpenStack Platform as a compute resource in Satellite. To use the CLI instead of the Satellite web UI, see the CLI procedure.

Procedure

  1. In the Satellite web UI, navigate to Infrastructure > Compute Resources.
  2. Click Create Compute Resource.
  3. In the Name field, enter a name for the new compute resource.
  4. From the Provider list, select RHEL OpenStack Platform.
  5. Optional: In the Description field, enter a description for the compute resource.
  6. In the URL field, enter the URL for the OpenStack Authentication keystone service’s API at the tokens resource, such as http://openstack.example.com:5000/v2.0/tokens or http://openstack.example.com:5000/v3/auth/tokens.
  7. In the Username and Password fields, enter the user authentication for Satellite to access the environment.
  8. Optional: In the Project (Tenant) name field, enter the name of your tenant (v2) or project (v3) for Satellite Server to manage.
  9. In the User domain field, enter the user domain for v3 authentication.
  10. In the Project domain name field, enter the project domain name for v3 authentication.
  11. In the Project domain ID field, enter the project domain ID for v3 authentication.
  12. Optional: Select Allow external network as main network to use external networks as primary networks for hosts.
  13. Optional: Click Test Connection to verify that Satellite can connect to your compute resource.
  14. Click the Locations and Organizations tabs and verify that the location and organization that you want to use are set to your current context. Add any additional contexts that you want to these tabs.
  15. Click Submit to save the Red Hat OpenStack Platform connection.

CLI procedure

  • To create a compute resource, enter the hammer compute-resource create command:

    # hammer compute-resource create --name "My_OpenStack" \
    --provider "OpenStack" \
    --description "My OpenStack environment at openstack.example.com" \
    --url "http://openstack.example.com:5000/v3/auth/tokens" \
    --user "My_Username" --password "My_Password" \
    --tenant "My_Openstack" --domain "My_User_Domain" \
    --project-domain-id "My_Project_Domain_ID" \
    --project-domain-name "My_Project_Domain_Name" \
    --locations "New York" --organizations "My_Organization"

13.2. Adding Red Hat OpenStack Platform Images to Satellite Server

To create hosts using image-based provisioning, you must add information about the image, such as access details and the image location, to your Satellite Server.

To use the CLI instead of the Satellite web UI, see the CLI procedure.

Procedure

  1. In the Satellite web UI, navigate to Infrastructure > Compute Resources and click the name of the Red Hat OpenStack Platform connection.
  2. Click Create Image.
  3. In the Name field, enter a name for the image.
  4. From the Operating System list, select the base operating system of the image.
  5. From the Architecture list, select the operating system architecture.
  6. In the Username field, enter the SSH user name for image access. This is normally the root user.
  7. In the Password field, enter the SSH password for image access.
  8. From the Image list, select an image from the Red Hat OpenStack Platform compute resource.
  9. Optional: Select the User Data checkbox if the image supports user data input, such as cloud-init data.
  10. Click Submit to save the image details.

CLI procedure

  • Create the image with the hammer compute-resource image create command. Use the --uuid field to store the full path of the image location on the Red Hat OpenStack Platform server.

    # hammer compute-resource image create \
    --name "OpenStack Image" \
    --compute-resource "My_OpenStack_Platform"
    --operatingsystem "RedHat version" \
    --architecture "x86_64" \
    --username root \
    --user-data true \
    --uuid "/path/to/OpenstackImage.qcow2"

13.3. Adding Red Hat OpenStack Platform Details to a Compute Profile

Use this procedure to add Red Hat OpenStack Platform hardware settings to a compute profile. When you create a host on Red Hat OpenStack Platform using this compute profile, these settings are automatically populated.

Procedure

  1. In the Satellite web UI, navigate to Infrastructure > Compute Profiles.
  2. In the Compute Profiles window, click the name of an existing compute profile, or click Create Compute Profile, enter a Name, and click Submit.
  3. Click the name of the Red Hat OpenStack Platform compute resource.
  4. From the Flavor list, select the hardware profile on Red Hat OpenStack Platform to use for the host.
  5. From the Availability zone list, select the target cluster to use within the Red Hat OpenStack Platform environment.
  6. From the Image list, select the image to use for image-based provisioning.
  7. From the Tenant list, select the tenant or project for the Red Hat OpenStack Platform instance.
  8. From the Security Group list, select the cloud-based access rules for ports and IP addresses.
  9. From the Internal network, select the private networks for the host to join.
  10. From the Floating IP network, select the external networks for the host to join and assign a floating IP address.
  11. From the Boot from volume, select whether a volume is created from the image. If not selected, the instance boots the image directly.
  12. In the New boot volume size (GB) field, enter the size, in GB, of the new boot volume.
  13. Click Submit to save the compute profile.

CLI procedure

  • Set Red Hat OpenStack Platform details to a compute profile:

    # hammer compute-profile values create
    --compute-resource "My_Laptop" \
    --compute-profile "My_Compute_Profile" \
    --compute-attributes "availability_zone=My_Zone,image_ref=My_Image,flavor_ref=m1.small,tenant_id=openstack,security_groups=default,network=My_Network,boot_from_volume=false"

13.4. Creating Image-based Hosts on Red Hat OpenStack Platform

In Satellite, you can use Red Hat OpenStack Platform provisioning to create hosts from an existing image. The new host entry triggers the Red Hat OpenStack Platform server to create the instance using the pre-existing image as a basis for the new volume.

To use the CLI instead of the Satellite web UI, see the CLI procedure.

Procedure

  1. In the Satellite web UI, navigate to Hosts > Create Host.
  2. In the Name field, enter a name for the host.
  3. Optional: Click the Organization tab and change the organization context to match your requirement.
  4. Optional: Click the Location tab and change the location context to match your requirement.
  5. From the Host Group list, select a host group that you want to assign your host to. That host group will populate the form.
  6. From the Deploy on list, select the Red Hat OpenStack Platform connection.
  7. From the Compute Profile list, select a profile to use to automatically populate virtual machine settings.
  8. From the Lifecycle Environment list, select the environment.
  9. Click the Interfaces tab, and on the interface of the host, click Edit.
  10. Verify that the fields are populated with values. Note in particular:

    • Satellite automatically assigns an IP address for the new host.
    • Ensure that the MAC address field is blank. Red Hat OpenStack Platform assigns a MAC address to the host during provisioning.
    • The Name from the Host tab becomes the DNS name.
    • Ensure that Satellite automatically selects the Managed, Primary, and Provision options for the first interface on the host. If not, select them.
  11. Click OK to save. To add another interface, click Add Interface. You can select only one interface for Provision and Primary.
  12. Click the Operating System tab, and confirm that all fields automatically contain values.
  13. If you want to change the image that populates automatically from your compute profile, from the Images list, select a different image to base the new host’s root volume on.
  14. Click Resolve in Provisioning templates to check the new host can identify the right provisioning templates to use.
  15. Click the Virtual Machine tab and confirm that these settings are populated with details from the host group and compute profile. Modify these settings to suit your needs.
  16. Click the Parameters tab, and ensure that a parameter exists that provides an activation key. If not, add an activation key.
  17. Click Submit to save the host entry.

CLI procedure

  • Create the host with the hammer host create command and include --provision-method image. Replace the values in the following example with the appropriate values for your environment.

    # hammer host create \
    --compute-attributes="flavor_ref=m1.small,tenant_id=openstack,security_groups=default,network=mynetwork" \
    --compute-resource "My_OpenStack_Platform" \
    --enabled true \
    --hostgroup "My_Host_Group" \
    --image "My_OpenStack_Image" \
    --interface "managed=true,primary=true,provision=true" \
    --location "My_Location" \
    --managed true \
    --name "My_Host_Name" \
    --organization "My_Organization" \
    --provision-method image

For more information about additional host creation parameters for this compute resource, enter the hammer host create --help command.

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.