Chapter 9. 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. In Red Hat Satellite 6, you can interact with Red Hat OpenStack Platforms REST API to create new cloud instances and control their power management states.
9.1. Prerequisites for Red Hat OpenStack Platform Provisioning:
Requirements for Red Hat OpenStack Platform Provisioning include:
- Synchronized content repositories for Red Hat Enterprise Linux 7. For more information, see Synchronizing Red Hat Repositories in the Content Management Guide.
- A Capsule Server managing a network in your OpenStack environment. For more information, see Chapter 4, Configuring Networking.
- An image added to OpenStack Image Storage (glance) service for image-based provisioning. For more information, see the Red Hat OpenStack Platform Instances and Images Guide.
- An activation key for host registration. For more information, see Creating An Activation Key in the Content Management guide.
9.2. Adding a Red Hat OpenStack Platform Connection to the Satellite Server
Use this procedure to add the Red Hat OpenStack Platform connection in the Satellite Server’s compute resources.
Procedure
To add a compute resource, use the following procedure:
- In the Satellite web UI, navigate to Infrastructure > Compute Resources and in the Compute Resources window, click Create Compute Resource.
- In the Name field, enter a name to identify the compute resource for future use.
- From the Provider list, select RHEL OpenStack Platform.
- In the Description field, enter a description for the resource.
-
In the URL field, enter a URL to point to the OpenStack Authentication keystone service’s API at the
tokens
resource. Use the following format:http://openstack.example.com:5000/v2.0/tokens
. - In the User and Password fields, enter the authentication user and password for Satellite to access the environment.
- In the Domain field, enter the domain for V3 authentication.
- From the Tenant list, select the tenant or project for Satellite Server to manage.
- To use external networks as primary networks for hosts, select the Allow external network as main network check box.
- 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.
- 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 "My_OpenStack" \ --provider "OpenStack" \ --description "My OpenStack environment at openstack.example.com" \ --url "http://openstack.example.com:5000/v2.0/tokens" --user "My_Username" \ --password "My_Password" --tenant "openstack" --locations "New York" \ --organizations "My_Organization"
9.3. Adding Red Hat OpenStack Platform Images to the Satellite Server
Red Hat OpenStack Platform uses image-based provisioning to create new hosts. You must add image details to your Satellite Server. This includes access details and image location.
Procedure
To add Red Hat OpenStack Platform images, complete the following steps:
- In the Satellite web UI, navigate to Infrastructure > Compute Resources and in the Computer Resources window, click the name of a Red Hat OpenStack Platform connection.
- In the Name field, enter a name that describes the image.
- From the Operatingsystem list, select the image’s base operating system.
- From the Architecture list, select the operating system architecture.
-
In the User field, enter the SSH user name for image access. This is normally the
root
user. - In the Password field, enter the SSH password for image access.
- From the Image list, select the image in OpenStack Image Storage.
-
From the User data list, select whether you want 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" \
--user root --user-data true \
--compute-resource "My_OpenStack_Platform"
9.4. Adding Red Hat OpenStack Platform Details to a Compute Profile
In Satellite, you can define certain hardware settings for instances on Red Hat OpenStack Platform. You can add these hardware settings to a compute profile.
Procedure
To add Red Hat OpenStack Platform details to a compute profile, complete the following steps:
- In the Satellite web UI, navigate to Infrastructure > Compute Profiles and in the Compute Profiles window, click the name of the profile you want to use.
- From the Flavor list, select the hardware profile on OpenStack Platform to use for the host.
- From the Availability zone list, selec the target cluster to use within the OpenStack Platform environment.
- From the Image list, select the image to use for image-based provisioning.
- From the Tenant list, select the tenant or project for the OpenStack Platform instance.
- From the Security Group list, select the cloud-based access rules for ports and IP addresses.
- From the Internal network, select the private networks for the host to join.
- From the Floating IP network, select the external networks for the host to join and assign a floating IP address.
- From the Boot from volume, select whether a volume is created from the image. If not selected, the instance boots the image directly.
- In the New boot volume size (GB) field, enter the size, in GB, of the new boot volume.
- Click Submit to save the compute profile.
For CLI Users
The compute profile CLI commands are not yet implemented in Red Hat Satellite 6.4. As an alternative, you can include the same settings directly during the host creation process.
9.5. Creating Image-Based Hosts on Red Hat OpenStack Platform
In Satellite, you can provision Red Hat OpenStack Platform hosts from existing images on the Red Hat OpenStack Platform server.
Procedure
To provision a host, complete the following steps:
- In the Satellite web UI, navigate to Hosts > New Host.
- In the Name field, enter the name that you want to assign to the provisioned system’s host.
- From the Host Group list, you can select a host group to populate the host fields.
- From the Deploy on lits, select the OpenStack Platform connection.
- From the Compute profile list, select a profile to use to automatically populate cloud instance-based settings.
- Click the Interface tab, and click Edit on the host’s interface. Verify that the Name from the Host tab becomes the DNS name, and that the Satellite Server automatically assigns an IP address for the new host.
- Ensure that the MAC address field is blank. The Red Hat OpenStack Platform server assigns a MAC address to the host.
- Verify that Satellite Server automatically selects the Managed, Primary, and Provision options for the first interface on the host. If not, select them.
- Click the Operating System tab, and confirm that each aspect of the operating system is populated.
- 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.
- Click Resolve in Provisioning Templates to verify that the new host can identify the right provisioning templates to use.
- Click the Virtual Machine tab, and verify that the settings are populated with details from the host groups and compute profile. Modify these settings to suit your needs.
- Click the Parameters tab and ensure that a parameter exists that provides an activation key. If not, add an activation key.
- Click Submit to save the changes.
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.
For CLI Users
Create the host with the hammer host create
command and include the --provision-method image
option to use image-based provisioning.
# hammer host create --name "openstack-test1" --organization "My_Organization" \ --location "New York" --hostgroup "Example_Hostgroup" \ --compute-resource "My_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"
For more information about additional host creation parameters for this compute resource, see Appendix B, Additional Host Parameters for Hammer CLI.