Installing a Red Hat Enterprise Linux OpenStack Platform 7 (RHELOSP7) demo environment on your laptop

 

openstack-cloud-software-vertical-web

I will be showing you how you can install a Red Hat Enterprise Linux Openstack Platform 7 (RHELOSP7) demo environment on your laptop. I will be using Fedora 23 as my operating system and Virtual Machine Manager (QEMU/KVM) as the virtualization tool.

My setup will consist of 3 OpenStack nodes in total. 1 node will be the Controller node (Keystone, Horizon, etc.), 1 node will be the Network node (Neutron services), 1 node will be the Compute/Hypervisor node (Nova services). I will be utilizing Packstack to perform the installation of all these components.


I created 3 virtual machine with Virtual Machine Manager on my Fedora 23 Laptop and installed a base install of Red Hat Enterprise Linux (RHEL) 7.2.

RHELOSP-Compute on QEMU-KVM_029

I gave my VM’s the following hostnames:

controller.beingopen.org
network.beingopen.org
compute.beingopen.org

For ease of access, I’ve added these hosts with the IP’s I gave them to my /etc/hosts file on my laptop.

Selection_027

One important note is that since we will be using nested kvm virtualization for the compute node, we need to enable the CPU specs that will allow to do so. You can do this from the CPU tab of the VM settings page and select Copy host CPU configuration.

RHELOSP-Compute on QEMU-KVM_028


 

I have two separate networks on my Virtual Machine Manager setup.

One is the default network 192.168.122.0/24 that comes with the default setup. I will use this one for communication between the nodes and also management.

QEMU-KVM Connection Details_030

The other is network2 192.168.222.0/24 which I created for the Network Node to be able to communicate with the outside world (for a real world scenario). Remember to attach an extra network adapter to the Network Node to this network2 subnet.

QEMU-KVM Connection Details_031


When your VM’s are all up and running, do the following on all of them:

Register your RHEL’s with Red Hat Subscription Manager:

subscription-manager register

Search for your subscription pool ID:

subscription-manager list --available --all

Attach your subscription pool ID:

subscription-manager attach --pool=pool-id

First we need to disable all repos that came when attaching this pool (we do this to keep a clean repo list to access only what we need):

subscription-manager repos --disable=*

Enable the RHEL7 and RHELOSP7 repos:

subscription-manager repos --enable=rhel-7-server-rpms --enable=rhel-7-server-openstack-7.0-rpms

Perform a system update:

yum -y update

Disable the Network Manager (NetworkManager):

systemctl disable NetworkManager

Reboot the VM’s (since most likely you will have kernel updates):

reboot

Now do the following only on the Controller node:

Install the packstack packages:

yum install -y openstack-packstack

Generate the packstack answer file:

packstack --gen-answer-file=openstack-answers.txt

We will be using this answer file to configure all aspects of our installation.

Change the following lines in your openstack-answers.txt file:


CONFIG_HEAT_INSTALL=y          
# If you want to enable heat orchestration

CONFIG_CONTROLLER_HOST=192.168.122.131 
# By default this should be correct and point to your Controller Node VM IP

CONFIG_COMPUTE_HOSTS=192.168.122.133 
# Change this to your Compute Node VM IP

CONFIG_NETWORK_HOSTS=192.168.122.132 
# Change this to your Network Node VM IP on the default subnet

CONFIG_KEYSTONE_ADMIN_PW=password 
# Change the admin user password to something you can remember

CONFIG_NEUTRON_L3_EXT_BRIDGE=provider
# Set the L3 provider network

CONFIG_NEUTRON_ML2_TYPE_DRIVERS=vxlan,flat
# Set the network types for vxlan and flat

CONFIG_NEUTRON_ML2_VLAN_RANGES=physnet-external
# Configure vlan

CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet-external:br-ex
# Configure bridge to vlan

CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:eth1
# Bridge the network2 interface on Neutron Node

CONFIG_NEUTRON_OVS_TUNNEL_IF=eth1
# Configure external tunnel to network2 interface on Neutron Node

CONFIG_PROVISION_DEMO=n
# Disable the demo provisioning setup

Run packstack with our answer file to start the setup:

packstack --answer-file=openstack-answers.txt

It will start by asking for the root password of all nodes to perform a key exchange to manage the whole setup:

root@controller:~_034

At the end of the setup you need to configure your network and routing settings and the easiest way to do that is with the following script network-setup.sh:

#!/bin/sh

# We need to source the admin user info for authentication
source /root/keystonerc_admin

# Configure the parameters to fit your environment

EXTERNAL_NETWORK_NAME="External"
EXTERNAL_SUBNET_NAME="External_Network"
EXTERNAL_NETWORK="192.168.222.0/24"
EXTERNAL_GATEWAY=192.168.222.1
EXTERNAL_IP_START=192.168.222.20
EXTERNAL_IP_END=192.168.222.50
INTERNAL_NETWORK_NAME="Internal"
INTERNAL_SUBNET_NAME="Internal_Network"
INTERNAL_NETWORK="192.168.122.0/24"
INTERNAL_GATEWAY=192.168.122.1
INTERNAL_IP_START=192.168.122.20
INTERNAL_IP_END=192.168.122.50
ROUTER_NAME=Router
ADMIN_TENANT_ID=xxxxx #Change this by finding your admin tenant ID
PHYSICAL_NETWORK=physnet-external

neutron net-create $EXTERNAL_NETWORK_NAME --tenant-id $ADMIN_TENANT_ID --provider:network_type flat --provider:physical_network $PHYSICAL_NETWORK --router:external=True --shared
neutron subnet-create $EXTERNAL_NETWORK_NAME $EXTERNAL_NETWORK --name $EXTERNAL_SUBNET_NAME --enable_dhcp=False --allocation-pool start=$EXTERNAL_IP_START,end=$EXTERNAL_IP_END --gateway=$EXTERNAL_GATEWAY
neutron net-create $INTERNAL_NETWORK_NAME
neutron subnet-create $INTERNAL_NETWORK_NAME $INTERNAL_NETWORK --name $INTERNAL_SUBNET_NAME --allocation-pool start=$INTERNAL_IP_START,end=$INTERNAL_IP_END --gateway=$INTERNAL_GATEWAY
neutron router-create $ROUTER_NAME
neutron router-interface-add $ROUTER_NAME $INTERNAL_SUBNET_NAME
neutron router-gateway-set $ROUTER_NAME $EXTERNAL_NETWORK_NAME

# Restart all your nodes

You should now have a complete 3 node RHELOSP7 OpenStack setup for your testing needs.

About the author

kaandemircan

View all posts

Leave a Reply

Your email address will not be published. Required fields are marked *