Chapter 10. Provisioning Cloud Instances in Red Hat OpenStack Platform

Red Hat OpenStack Platform provides the foundation to build a private or public Infrastructure-as-a-Service (IaaS) cloud on Red Hat Enterprise Linux. It offers a massively scalable, fault-tolerant platform for the development of cloud-enabled workloads. Red Hat Satellite 6 can interact with Red Hat OpenStack Platforms REST API to create new cloud instances and control their power management states. In this chapter, the aim is to add a connection to ACME’s Red Hat OpenStack Platform environment and provision a cloud instance.

10.1. Defining Requirements for Red Hat OpenStack Platform Provisioning

The requirements for Red Hat OpenStack Platform provisioning include:

10.2. Adding a Red Hat OpenStack Platform Connection to the Satellite Server

This process adds the Red Hat OpenStack Platform connection in the Satellite Server’s compute resources.

For Web UI Users

Navigate to Infrastructure > Compute resource and click New Compute Resource. The UI provides a set of fields for the compute resource:

  • Name - A plain text name for the resource. For example, ACME's OpenStack.
  • Provider - A field for selecting the compute resource provider. Select RHEL OpenStack Platform and a new set of fields appear.
  • Description - A plain text description for the resource. For example, ACME's OpenStack environment at openstack.example.com.
  • URL - A URL pointing to the OpenStack Authentication (keystone) service’s API at the tokens resource. For example: http://openstack.example.com:5000/v2.0/tokens
  • Username and Password - The authentication user and password for Satellite to access the environment.
  • Tenant - The tenant or project for the Satellite Server to manage.
  • Allow external network as main network - Select to allow external networks for use as primary networks for hosts.

The Locations and Organizations tabs are automatically set to your current context. Add additional contexts to these tabs.

Click Submit to save the Red Hat OpenStack Platform connection.

For CLI Users

Create the connection with the hammer compute-resource create command:

# hammer compute-resource create --name "ACME's OpenStack" \
--provider "OpenStack" \
--description "ACME's OpenStack environment at openstack.example.com" \
--url "http://openstack.example.com:5000/v2.0/tokens" --user "admin" \
--password "p@55w0rd!" --tenant "openstack" --locations "New York" \
--organizations "ACME"

10.3. Adding Red Hat OpenStack Platform Images on the Satellite Server

Red Hat OpenStack Platform uses image-based provisioning to create new hosts. This means you need to add image details to your Satellite Server. This includes access details and image location.

For Web UI Users

Navigate to Infrastructure > Compute resource and click the name of your Red Hat OpenStack Platform connection. The UI displays information about the connection, including an Images tab. This tab contains no images for new providers but you can add new ones. Click New Image and the UI provides a set of fields for the Red Hat OpenStack Platform image:

  • Name - A plain text name for the image. For example, Test OpenStack Image.
  • Operatingsystem - A field for selecting the image’s base operating system. For example, RedHat 7.2.
  • Architecture - A field for selecting the operating system architecture. For example, x86_64.
  • Username - The SSH user name for image access. This is normally the root user.
  • Password - The SSH password for image access.
  • Image - The image in OpenStack Image Storage.
  • User data - To set if images support user data input, such as cloud-init data.

Click Submit to save the image details.

For CLI Users

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 "Test OpenStack Image" \
--operatingsystem "RedHat 7.2" --architecture "x86_64" \
--username root --user-data true \
--compute-resource "ACME's OpenStack Platform"

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

You can predefine certain hardware settings for instances on Red Hat OpenStack Platform. You achieve this through adding these hardware settings to a compute profile. For this example, the aim is to include some basic hardware settings to the 4-Example profile.

For Web UI Users

Navigate to Infrastructure > Compute profiles and click the name of your profile. For example, use the 4-Example profile you previously created. The UI displays a list of your compute resources. Click on the OpenStack Platform connection.

The UI provides a set of fields where you can input OpenStack-specific details for the profile. This includes:

  • Flavor - The hardware profile on OpenStack Platform to use for the host.
  • Availability zone - The target cluster to use within the OpenStack Platform environment.
  • Image - The image to use for image-based provisioning. For this example, use the Test OpenStack Image.
  • Tenant - The tenant or project for the OpenStack Platform instance.
  • Security Group - The cloud-based access rules for ports and IP addresses.
  • Internal network - The private networks for the host to join.
  • Floating IP network - The external networks for the host to join and assign a floating IP address.
  • Boot from volume - To set if a volume is created from the image. If not selected, the instance boots the image directly.
  • New boot volume size (GB) - The size of the new boot volume in GB.

Click Submit to save the compute profile.

For CLI Users

The compute profile CLI commands are not yet implemented in Red Hat Satellite 6.3. As an alternative, you can include the same settings directly during the host creation process.

10.5. Creating Image-Based Hosts on Red Hat OpenStack Platform

The Red Hat OpenStack Platform provisioning process creates new hosts from existing images on the Red Hat OpenStack Platform server.

For Web UI Users

Navigate to Hosts > New host. The UI provides a set of fields where you can input details for the host.

  • In the Host tab:

    • Enter the Name of the Host. This becomes the provisioned system’s host name. For this example, enter openstack-test1.
    • The provisioning context (Organization and Location) should automatically set to the current context. For this example: ACME and New York.
    • Select the Host Group. This should automatically populate most of the new host’s fields. For this example: Base.
    • In Deploy on, select the OpenStack Platform connection. For this example: ACME's OpenStack Platform. A new tab for virtual machines appears.
    • In Compute profile, select a profile to use to automatically populate cloud instance-based settings. For our example: 4-Example.
  • In the Interface tab:

    • Click Edit on the host’s interface.
    • Most of the fields should automatically contain values. Note in particular:

      • The Name from the Host tab becomes the DNS name.
      • The Satellite Server automatically assigns an IP address for the new host.
    • Leave the MAC address blank. The Red Hat OpenStack Platform server assigns one to the host.
    • The Satellite Server should automatically select the Managed, Primary, and Provision options for the first interface on the host. If not, select them.
  • In the Operating System tab:

    • All fields should automatically contain values. Confirm each aspect of the operating system.
    • The Image field contains the chosen image from your compute profile. This field also allows you to select a different image to base the new host’s root volume.
    • Click Resolve in Provisioning templates to check the new host can identify the right provisioning templates to use.
  • In the Virtual Machine tab:

    • These settings should be populated with details from the chosen host group and compute profile. Modify these settings to suit your needs.
  • In the Parameters tab:

    • Confirm the kt_activation_keys parameter exists and is using the example activation key.

Click Submit.

For CLI Users

Create the host with the hammer host create command and include --provision-method image to use image-based provisioning. For example:

# hammer host create --name "openstack-test1" --organization "ACME" \
--location "New York" --hostgroup "Base" \
--compute-resource "ACME's OpenStack Platform" --provision-method image \
--image "Test OpenStack Image" --enabled true --managed true \
--interface "managed=true,primary=true,provision=true" \
--compute-attributes="flavor_ref=m1.small,tenant_id=openstack,security_groups=default,network=mynetwork"
Note

See Appendix B, Additional Host Parameters for Hammer CLI for more information on additional host creation parameters for this compute resource.

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

10.6. Chapter Summary

This chapter showed how to configure Red Hat Satellite 6 to use a Red Hat OpenStack Platform server and how to provision new hosts through a Red Hat OpenStack Platform server. This included both network-based hosts and image-based hosts.

If you have no further compute resources to configure with Red Hat Satellite 6, see Chapter 13, Finalizing Provisioning for some final notes on provisioning.

The next chapter explores methods of provisioning from Amazon’s EC2 public cloud service.