Redhat OpenStack Platform OpenStack 7,8,9 (Kilo, Liberty, Mitaka) setup note


@File Create by Benjamin Lu, the cloud architect at Cephswift, if anyone has questions regarding the doc, please send mail to benlu369@yahoo.com.
@The Red Hat build doc is based on “Red Hat Enterprise Linux OpenStack Platform 7,8,9 Director Installation and Usage”.

Notes on Red Hat OpenStack Platform 7 build-up:

1. Build-up Red Hat OpenStack Undercloud :
1.1 Setup Undercloud ( on a pre-installed RHEL7 server)
[root@director ~]# useradd stack
[root@director ~]# passwd stack # specify a password
[root@director ~]# echo “stack ALL=(root) NOPASSWD:ALL” | tee -a /etc/sudoers.d/stack
[root@director ~]# chmod 0440 /etc/sudoers.d/stack
[root@director ~]# su – stack
$ mkdir ~/images
$ mkdir ~/templates

$ hostname # Checks the base hostname
$ hostname -f # Checks the long hostname (FQDN) ### use this command to setup host name for undercloud installator
## example to setup host name for undercloud installator:
$ sudo hostnamectl set-hostname manager.example.com #### we may use < OSP7_director.cephswift.com> here as:
$ sudo hostnamectl set-hostname OSP7_director.cephswif.com
$ sudo hostnamectl set-hostname –transient manager.example.com #### we may use < OSP7_director.cephswift.com> here as:
$ sudo hostnamectl set-hostname –transient OSP7_director1.cephswift.com

1.2 Registering the setup with Red Hat Subscription Manager, to have a full repo pkg access to download, install, update your OS, openstack software for your setup:

$ sudo subscription-manager register userid=, password= $ sudo subscription-mamnger list –availble –all
$ sudo subscription-manager repos –disable=*
$ sudo subscription-manager repos \
–enable=rhel-7-server-rpms \
–enable=rhel-7-server-optional-rpms \
–enable=rhel-7-server-extras- rpms \
–enable=rhel-7-server-openstack-7.0-rpms \
–enable=rhel-7- server-openstack-7.0-director-rpms
$ sudo yum install yum-plugin-priorities

$ sudo yum install yum-utils
$ sudo yum-config-manager –enable reponame — setopt=”reponame.priority=1″

$ sudo yum update -y
$ reboot

1.3 Installing the Direct or Packages
[stack@director ~]$ sudo yum install -y python-rdomanager-oscplugin

1.4. Configuring & Install Director ( In undercloud)
$ cp /usr/share/instack-undercloud/undercloud.conf.sample ~/undercloud.conf
$ vi ~/undercloud.conf ### to setup all IPs you are planning for your openstack environment, refer Red Hat doc for details.
$ openstack undercloud install ### this will install everything for undercloud for your configuration along with repos you registerted, it talk sometime.
$ source ~/stackrc ### go your undercloud Env

2. Build-up Red Hat OpenStack Overcloud :

2.1 Get images for Overcloud nodes:
$ cd ~/images
wget URL:
Obtain these images from the Red Hat Enterprise Linux OpenStack Platform downloads page on the Red Hat Customer Portal at https://access.redhat.com/downloads/content/191/ver=7/rhel—
7/7/x86_64/product-downloads. This location on the Customer Portal contains the images in TAR. Customer login is needed to on Redhat Site.
archives.
$ for tarfile in *.tar; do tar -xf $tarfile; done;

2.2 Upload image from download into director in underclod:
$ openstack overcloud image upload –image-path /home/stack/images/

2.3 Verify image list and PXE, httpboot

$ openstack image list
$ ls /httpboot -l

2.4 setup nameserver and Neutron Subnet
$ neutron subnet-list
$ neutron subnet-update [subnet-uuid] –dns-nameserver [nameserver-ip]
$ neutron subnet-show [subnet-uuid] ### verify

2.5 Planning Overcloud ### check details on Redhat Docs according your Env

2.6 Check default Direct Plants for Heat templates collections:
$ openstack management plan list

$ openstack management plan show [UUID]
This collection is stored in /usr/share/openstack-tripleo-heat-templates.

[stack@osp7-director ~]$ ls -l /usr/share/openstack-tripleo-heat-templates
total 296
-rw-r–r–. 1 root root 2434 Jun 4 2015 all-nodes-config.yaml
-rw-r–r–. 1 root root 808 Oct 1 07:30 all-nodes-validation.yaml
-rw-r–r–. 1 root root 1968 Jun 4 2015 base.yaml
-rw-r–r–. 1 root root 583 Oct 1 07:30 bootstrap-config.yaml
-rw-r–r–. 1 root root 1731 Oct 1 07:30 ceph-cluster-config.yaml
-rw-r–r–. 1 root root 618 Oct 1 07:30 ceph-storage-post.yaml
-rw-r–r–. 1 root root 4914 Oct 1 07:30 ceph-storage.yaml
-rw-r–r–. 1 root root 626 Oct 1 07:30 cinder-storage-post.yaml
-rw-r–r–. 1 root root 7432 Oct 1 07:30 cinder-storage.yaml
-rw-r–r–. 1 root root 614 Oct 1 07:30 compute-post.yaml
-rw-r–r–. 1 root root 19901 Oct 1 07:30 compute.yaml
-rw-r–r–. 1 root root 615 Oct 1 07:30 controller-post.yaml
-rw-r–r–. 1 root root 42811 Oct 1 07:30 controller.yaml
-rw-r–r–. 1 root root 1004 Jun 4 2015 debian-mirror.yaml
drwxr-xr-x. 2 root root 4096 Dec 3 14:53 environments
drwxr-xr-x. 6 root root 69 Dec 3 14:53 extraconfig
drwxr-xr-x. 2 root root 92 Dec 3 14:53 firstboot
-rw-r–r–. 1 root root 4362 Jun 4 2015 nagios3.yaml
-rw-r–r–. 1 root root 1980 Oct 1 07:30 net-config-bond.yaml
-rw-r–r–. 1 root root 1779 Oct 1 07:30 net-config-bridge.yaml
-rw-r–r–. 1 root root 1128 Oct 1 07:30 net-config-noop.yaml
-rw-r–r–. 1 root root 2462 Oct 1 07:30 net-config-static-bridge.yaml
drwxr-xr-x. 4 root root 4096 Dec 3 14:53 network
-rw-r–r–. 1 root root 5566 Oct 1 07:30 overcloud-resource-registry-puppet.yaml
-rw-r–r–. 1 root root 4577 Oct 1 07:30 overcloud-resource-registry.yaml
-rw-r–r–. 1 root root 58973 Oct 1 07:30 overcloud-without-mergepy.yaml
drwxr-xr-x. 5 root root 4096 Dec 3 14:53 puppet
-rw-r–r–. 1 root root 999 Jun 4 2015 swift-devices-and-proxy-config.yaml
-rw-r–r–. 1 root root 619 Oct 1 07:30 swift-storage-post.yaml
-rw-r–r–. 1 root root 6639 Oct 1 07:30 swift-storage.yaml
-rw-r–r–. 1 root root 979 Jun 4 2015 undercloud-bm-nova-config.yaml
-rw-r–r–. 1 root root 1303 Jun 4 2015 undercloud-bm-nova-deploy.yaml
-rw-r–r–. 1 root root 13389 Oct 1 07:30 undercloud-source.yaml
-rw-r–r–. 1 root root 1381 Jun 4 2015 undercloud-vlan-port.yaml
-rw-r–r–. 1 root root 1078 Jun 4 2015 undercloud-vm-ironic-config.yaml
-rw-r–r–. 1 root root 1575 Jun 4 2015 undercloud-vm-ironic-deploy.yaml
-rw-r–r–. 1 root root 1161 Jun 4 2015 undercloud-vm-nova-config.yaml
-rw-r–r–. 1 root root 1847 Jun 4 2015 undercloud-vm-nova-deploy.yaml
drwxr-xr-x. 2 root root 25 Dec 3 14:53 validation-scripts
-rw-r–r–. 1 root root 363 Oct 1 07:30 vip-config.yaml

3 Installing the Overcloud:
3.1 Registering Nodes for the Basic Overcloud

Create a node definition template. This file (instackenv.json )
vi /home/stack/instackenv.json ### see details on redhat docs

$ openstack baremetal import –json ~/instackenv.json ### import it into the director.
$ openstack baremetal configure boot ### Assign the kernel and ramdisk images to all nodes:
$ opestack baremetal list ### use Cli to verify nodes has been registered for Openstack installation

3.2 Inspecting the Hardware of Nodes
$ openstack baremetal introspection bulk start
$ sudo journalctl -l -u openstack-ironic-discoverd -u openstack-ironic- discoverd-dnsmasq -u openstack-ironic-conductor -f
$ ironic node-set-maintenance [NODE UUID] true
$ openstack baremetal introspection start [NODE UUID]
$ ironic node-set-maintenance [NODE UUID] false

3.3 Manually Tagging the Nodes

$ ironic node-update 58c3d07e-24f2-48a7-bbb6-6843f0e8ee13 add properties/capabilities=’profile:compute,boot_option:local’
$ ironic node-update 1a4e30da-b6dc-499d-ba87-0bd8a3819bc0 add properties/capabilities=’profile:control,boot_option:local’
The addition of the profile:compute and profile:control options tag the two nodes into each respective profiles.

3.4 Creating Flavors for the Basic Scenario
$ openstack flavor create –id auto –ram 6144 –disk 40 –vcpus 4 control
$ openstack flavor create –id auto –ram 6144 –disk 40 –vcpus 4 compute

$ openstack flavor set –property “cpu_arch”=”x86_64” –property “capabilities:boot_option”=”local” –property “capabilities:profile”=”compute” compute
$ openstack flavor set –property “cpu_arch”=”x86_64” –property “capabilities:boot_option”=”local” –property “capabilities:profile”=”control” control
$ openstack flavor create –id auto –ram 4096 –disk 40 –vcpus 1 baremetal

3.5 Configuring NFS Storage
$ cp /usr/share/openstack-tripleo-heat-templates/environments/storage- environment.yaml

3.6 Isolating the External Network ### see Red Hat docs for details

3.7 Creating Custom Interface Templates
$ cp -r /usr/share/openstack-tripleo-heat- templates/network/config/single-nic-vlans ~/templates/nic-configs

3.8 Creating a Basic Overcloud Network Environment Template
vi /home/stack/templ ates/netwo rk-envi ro nment. yaml

3.9 Creating the Basic Overcloud
$ openstack overcloud deploy –templates -e /usr/share/openstack-tripleo- heat-templates/environments/network-isolation.yaml -e /home/stack/templates/network-environment.yaml -e \
/home/stack/templates/storage-environment.yaml –control-flavor control – -compute-flavor compute –ntp-server pool.ntp.org –neutron-network-type vxlan –neutron-tunnel-types vxlan

Example:
$ openstack overcloud deploy –templates -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml -e /home/stack/templates/network-environment.yaml -e /home/stack/templates/haproxy/post_haproxy.yaml –control-scale 3 –compute-scale 11 –control-flavor control –compute-flavor compute –ntp-

$ openstack help overcloud deploy ### for full list of options about deploy

$ source ~/stackrc ### Initializes the stack ussrs to use the Cli commands

$ heat stack-list –show-nested

3.10 Accessing the Basic Overcloud :

The director generates a file to configure and authenticate interactions with your Overcloud from the Undercloud.
The director saves this file, overcloudrc, in your stack user’s home directory.

Run the following command to use this file:
$ source ~/overcloudrc

This loads the necessary environment variables to interact with your Overcloud from the director host’s CLI.
To return to interacting with the director’s host, run the following command:
$ source ~/stackrc