How to Deploy OpenShift Enterprise on Red Hat OpenStack


Here’s a 12 minute demo that shows you how to deploy OpenShift Enterprise 2.0 on Red Hat’s distribution of OpenStack (RHOS 4). The demo environment already has RHOS 4 installed (I’ve used packstack —allinone), and is configured with OpenStack Neutron networking (I’ve configured Neutron networking to have a public and private network). Additionally, this demo shows all tools being run on a Red Hat Enterprise Linux 6.5 host system and all Nova instances are running Red Hat Enterprise Linux 6.5.

Configuring OpenStack Neutron networking

There are many ways in which you can configure OpenStack and it’s associated Neutron networking. I’ve set up my installation to run all services one server with one network interface card. After installing RHEL 6.5 and RHOS 4.0, you can use the following commands and configuration to help you replicate the demo environment.

Modify your /etc/neutron/plugins.ini with the following

[OVS]
enable_tunneling=False
integration_bridge=br-int
tenant_network_type=local
bridge_mappings=default:virbr0
#vibr0 is the name of my linux bridge

Modify your /etc/neutron/l3_agent.ini, leave the key but remove the value of the following external_network_bridge =

After you have modified the configuration files and restarted the neutron-l3-agent and neutron-server services, configure the neutron nets, subnets, and router.

service neutron-l3-agent restart
service neutron-server restart
 
neutron net-create  --provider:physical_network=default --provider:network_type=flat public
neutron net-create private
#change your ip addresses to suit your local network environment
neutron subnet-create public --allocation-pool start=10.13.129.241,end=10.13.129.246 --gateway 10.13.129.254 --enable_dhcp=False 10.13.129.0/24 --name pub-sub
neutron subnet-create private --gateway 192.168.0.1 192.168.0.0/24 --name priv-sub
neutron router-gateway-set router1 public

At this point you should be able to use the network uids as Heat template parameters, more on that in a bit.

OpenStack Diskimage and Heat

The tools in use here are OpenStack’s Diskimage-builder , and OpenStack’s Heat, both tools are bundled with RHOS 4.

Diskimage-builder will be used to download a KVM qcow2 image that has been created ahead of time. After the image is copied locally, the image will be modified using Diskimage-builder elements; an element is a particular set of code that alters how the image is built, or runs within a chroot to prepare the image.

Heat will be used to create Nova instances using the images Diskimage-builder generates. Once the Nova instances are running they will be wired up with all the necessary networking. Once all the OpenStack infrastructure is instantiated, the Nova instances will be bootstrapped using the OpenShift Enterprise installer.

There are a couple different schools of thought on how to manage your images, one is that you keep very few, very generic images that you can reuse and then do most configuration and package installation at boot-time. The contrasting approach is to build very specific images with all the contextually applicable packages and configuration you can so that at boot-time, there is very little left to do. The benefit of the first approach is that you have less image maintenance with the trade-off of a slow boot-time speed. The benefit to the second approach is the inverse, you can bring instances on-line more quicky with the trade-off that you have to maintain the images. This demonstration will use the second approach.

git clone https://github.com/openstack/heat-templates.git
 
DIB_IMAGE_SIZE=10 ELEMENTS_PATH=./heat-templates/elements:./heat-templates/openshift-enterprise/dib/elements DIB_RHSM_USER=[RHN user] DIB_RHSM_PASSWORD=[RHN password] DIB_CLOUD_IMAGES=[location of RHEL image] DIB_CONF_INSTALL_METHOD=rhsm DIB_RHSM_POOL=[OSE subscription id for RHEL bits] DIB_RHSM_OSE_POOL=[OSE subscription id for OSE bits (probably the same as the DIB_RHSM_POOL] DIB_OSE_VERSION=2.0 DIB_YUM_VALIDATOR_VERSION=2.0 TMP_DIR=$HOME/tmp disk-image-create --no-tmpfs -a amd64 vm rhel openshift-enterprise-node -o RHEL64-x86_64-node
 
DIB_IMAGE_SIZE=5 ELEMENTS_PATH=./heat-templates/elements:./heat-templates/openshift-enterprise/dib/elements DIB_RHSM_USER=[RHN user] DIB_RHSM_PASSWORD=[RHN password] DIB_CLOUD_IMAGES=[location of RHEL image] DIB_CONF_INSTALL_METHOD=rhsm DIB_RHSM_POOL=[OSE subscription id for RHEL bits] DIB_RHSM_OSE_POOL=[OSE subscription id for OSE bits (probably the same as the DIB_RHSM_POOL] DIB_OSE_VERSION=2.0 DIB_YUM_VALIDATOR_VERSION=2.0 TMP_DIR=$HOME/tmp disk-image-create --no-tmpfs -a amd64 vm rhel openshift-enterprise-broker -o RHEL64-x86_64-broker

Register images with Glance

Once those have two Diskimage-builder commands have been completed, you’ll have two images ready to be registered with OpenStack’s Glance. You’ll need to register them with Glance because Heat will pull the image name reference from the Heat Template and then look the image details up via the Glance API.

glance add name=RHEL64-x86_64-broker is_public=true disk_format=qcow2 container_format=bare < RHEL64-x86_64-broker
glance add name=RHEL64-x86_64-node is_public=true disk_format=qcow2 container_format=bare < RHEL64-x86_64-node

Now that the images are registered with Glance a simple invocation of Heat will create a stack running all the OpenShift Enterprise 2.0 infrastructure needed to begin deploying your applications. You can invoke a Heat stack creation via the OpenStack Horizon management application, or you can use the command line interface. You’ve already cloned the heat-templates git repository, so I’ll show you how to use the command line interface.

First get the network uids for use as Heat parameter values:

neutron net-list
neutron subnet-list

Then create the Heat stack:

heat create openshift --template-file=./heat-templates/openshift-enterprise/heat/neutron/OpenShift-1B1N-neutron.yaml --parameters="key_name=${USER}_key;prefix=novalocal;BrokerHostname=openshift.brokerinstance.novalocal;NodeHostname=openshift.nodeinstance.novalocal;ConfInstallMethod=rhsm;ConfSMRegName=[RHN user];ConfSMRegPass=[RHN password];ConfSMRegPool=[OSE subscription id for OSE bits];private_net_id=[neutron private network uid];public_net_id=[neutron public network uid];private_subnet_id=[neutron private subnet];yum_validator_version=2.0:ose_version=2.0"

Monitoring Heat

You can monitor the output of the Heat stack creation using the Horizon stacks dashboard, or you can use heat event-list openshift. Once the node_wait_condition resource has the status of CREATE_COMPLETE, you’re ready to point your OpenShift rhc client to the broker public ip address and begin using OpenShift Enterprise 2.0.

Next Steps

Hi,

Iam trying the same approach,I have sucessfully deployed the RHOS 4.0 opestack. But am s trucking with disk image builder,where iam passing the RHEL 6.5 KVM url IN DIB_CLOUD_IMAGES,it is not downloading the Images.

the url iam using here is https://rhn.redhat.com/rhn/software/channel/downloads/Download.do?cid=16952 and also i pointed tha image downlaoding location but not helped.. weather iam passing the correct url? or any changes? Please Help me on this..i already spent couple of days on it

Thanks in advance

regarding "/etc/neutron/plugins.ini" <-- 's/plugins/plugin/'

More from this author