OpenShift Origin Heat Deployment Guide

From DocWiki

Revision as of 23:39, 5 March 2014 by Danehans (Talk | contribs)
Jump to: navigation, search

Background

This document provides users step-by-step instructions for deploying OpenShift Origin (OSO) v3.0 using OpenStack Heat. Heat is the main project in the OpenStack Orchestration program. It implements an orchestration engine to launch multiple composite cloud applications based on templates in the form of text files that can be treated like code. The current OSO Heat template supports deploying one Broker instance and one Node instance. The base OpenStack deployment was accomplished using Cisco's OpenStack Installer (COI) Havana release. However, the Heat deployment should work using any OpenStack distribution that uses Icehouse-2 or later. Although COI supports multiple OpenStack deployment scenarios, the only available scenario for use with the OSO Heat template is full_ha. This is because full_ha uses Neutron VLAN Provider Networking which do not require Floating IP address assignment to instances for external network connectivity. Please file a feature request if you require support for a different Neutron networking model.

Prepare the Images

Images must be created for the Broker and Node instance. The images will be used to deploy running Broker and Node instances using OpenStack Glance, Nova and Heat.

Log into a host that contains the following:

  • OpenStack client packages (i.e. python-novaclient)
  • Network connectivity to OpenStack API endpoints
  • OpenStack credential file. (i.e. openrc). Here is a reference to the contents of an authentication file.

Install git and download Heat Heat templates:

apt-get install -y git
git clone https://github.com/openstack/heat-templates.git

Perform the following steps in the parent directory of heat-templates to build the images using diskimage-builder:

Download the diskimage-builder software and dependencies:

git clone https://github.com/openstack/diskimage-builder.git
apt-get install -y qemu-utils kpartx policycoreutils

Create environmental variables for the Broker image:

mkdir $HOME/tmp
export DIB_RELEASE=19
export ELEMENTS_PATH=heat-templates/openshift-origin/F19/elements
export TMP_DIR=$HOME/tmp
export DIB_IMAGE_SIZE=5

Create the Broker image. Be patient as it takes several minutes to build the image:

diskimage-builder/bin/disk-image-create --no-tmpfs -a amd64 vm fedora openshift-origin-broker -o F19-x86_64-openshift-origin-broker

If you have not done so already, load your credential file.

source /root/openrc

Note: A credential file can be avoided by using the necessary Glance flags to specify the auth URL, username, password, etc..

Add the newly created Broker image to OpenStack Glance:

glance image-create --name F19-x86_64-openshift-origin-broker --is-public true --disk-format qcow2 --container-format bare < F19-x86_64-openshift-origin-broker.qcow2

Change the DIB_IMAGE_SIZE environmental variable for the Node image:

export DIB_IMAGE_SIZE=20

Create the Node image. Be patient as it may take several minutes to build the image:

diskimage-builder/bin/disk-image-create --no-tmpfs -a amd64 vm fedora openshift-origin-node -o F19-x86_64-openshift-origin-node

Add the newly created Node image to OpenStack Glance:

glance image-create --name F19-x86_64-openshift-origin-node --is-public true --disk-format qcow2 --container-format bare < F19-x86_64-openshift-origin-node.qcow2

Verify the Broker and Node images have been installed on Glance and has an active status:

glance image-list
+--------------------------------------+------------------------------------------+-------------+------------------+------------+--------+
| ID                                   | Name                                     | Disk Format | Container Format | Size       | Status |
+--------------------------------------+------------------------------------------+-------------+------------------+------------+--------+
| 102d07df-53e9-4499-b04d-32d9e217e2d1 | F19-x86_64-openshift-origin-broker       | qcow2       | bare             | 457444864  | active |
| 5a93c647-98c7-4b46-8461-ac17d3a1aee7 | F19-x86_64-openshift-origin-node         | qcow2       | bare             | 454047232  | active |
+--------------------------------------+------------------------------------------+-------------+------------------+------------+--------+

Follow the instructions in the SSH Key Injection Section of the Cisco Havana HA Manual Deployment Guide to create a Nova key-pair.

If Neutron networks have yet to be created, create your first tenant network now. Keep in mind this example uses Neutron Provider VLAN Networks which is the only supported networking model for the OSO Heat template. In our example, we use the admin tenant.  Create additional networks as needed. Note: The --tenant_id flag is not specified in the following commands because we previously sourced our credential file.

neutron net-create public223 --provider:network_type vlan --provider:physical_network physnet1 --provider:segmentation_id 223

Create your first tenant subnet and associate it to the network you created in the previous step. The example below uses .10-.250 for Instance IP addresses. Modify the allocation-pool and dns_nameservers based on your deployment needs. Create additional networks as needed.

neutron subnet-create --name 223-subnet --allocation-pool start=192.168.223.10,end=192.168.223.250 public223 192.168.223.0/24 --dns_nameservers list=true 192.168.26.186

Heat Deployment

Since the Icehouse release of Heat is required for the OSO template, Heat must be installed and configured. At the time of this writing the latest version of COI is Havana. If you have installed Havana Heat using COI, make sure to uninstall all Heat packages. Install Heat from source:

apt-get install -y git
git clone https://github.com/openstack/heat.git
cd heat
git checkout 2014.1.b1

Install Heat source dependencies:

apt-get install python-dev python-pip libxml2-dev libxslt1-dev libsasl2-dev libsqlite3-dev libssl-dev libldap2-dev libffi-dev

Install Heat:

pip install -r ~/heat/test-requirements.txt
python ~/heat/setup.py install

Create the Heat directories if they do not exist:

mkdir /etc/heat
mkdir /var/log/heat

Copy the Heat config files:

cp -R ~/heat/etc/heat/* /etc/heat/.

Edit the /etc/heat/heat.conf file to include the following. Replace <CONTROLLER_IP> with the IP address of the Controller. Note: All other information is based on COI full_ha scenario deployment parameters:

[DEFAULT]
heat_metadata_server_url=http://<CONTROLLER_IP>:8000
heat_waitcondition_server_url=http://<CONTROLLER_IP>:8000/v1/waitcondition
heat_watch_server_url=http://<CONTROLLER_IP>8003
heat_stack_user_role=heat_stack_user
log_dir=/var/log/heat
rabbit_hosts=control-server01:5672,control-server02:5672,control-server03:5672
rabbit_userid=openstack_rabbit_user
rabbit_ha_queues=True
rabbit_password=openstack_rabbit_password

[database]
connection = mysql://heat:heat@<CONTROLLER_IP>/heat
idle_timeout=30

[ec2authtoken]
http://<CONTROLLER_IP>:5000/v2.0/ec2tokens

[heat_api]
bind_host=<CONTROLLER_IP>

[heat_api_cfn]
bind_host=<CONTROLLER_IP>

[heat_api_cloudwatch]
bind_host=<CONTROLLER_IP>

[keystone_authtoken]
auth_host=<CONTROLLER_IP>
auth_protocol=http
auth_uri=http://<CONTROLLER_IP>:5000/v2.0/
admin_token=keystone_admin_token
admin_user=heat
admin_password=heat_pass
admin_tenant_name=services

Start the Heat services:

/usr/bin/python /usr/local/bin/heat-api --config-file=/etc/heat/heat.conf &
/usr/bin/python /usr/local/bin/heat-api-cfn --config-file=/etc/heat/heat.conf &
/usr/bin/python /usr/local/bin/heat-api-cloudwatch --config-file=/etc/heat/heat.conf &
/usr/bin/python /usr/local/bin/heat-engine --config-file=/etc/heat/heat.conf &

Rating: 0.0/5 (0 votes cast)

Personal tools