Installing Openstack Kilo on Centos 7
In a previous article I wrote about how to install Openstack Icehouse on CentOS 6.5 in great detail. In this article, I am going to keep verbosity to a minimum and just give you the commands ! I am hoping this will be refreshing for my audience. If you are curious however, about the what, when and why please read my previous article.
Pre-requisites
- You need a machine with x86_64 architecture with at least 4 GB of memory & 2 NIC’s.
- On this machine you need to install CentOS 7 as a minimal install
- You should create a user with admin privileges (i.e. wheel, in my case ‘tuxninja’ was created)
- Disable SELinux
- vi /etc/sysconfig/selinux
- SELINUX=disabled
- save changes
Jumping Right In
Here are the commands you need to run.
- sudo yum update -y
- sudo yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-kilo/rdo-release-kilo-1.noarch.rpm
- sudo yum install epel-release
- sudo yum install -y openstack-packstack
Now at this point if you ran ‘packstack’ you would run into a bug with this message
ERROR : Error appeared during Puppet run: 192.168.1.10_prescript.pp Error: Could not find data item CONFIG_USE_SUBNETS in any Hiera data file and no default supplied at /var/tmp/packstack/053c9a3614de4404b906141268c08f0a/manifests/192.168.1.10_prescript.pp:2 on node diamond.tuxlabs.com
The workaround for this bug is as follows
- sudo rpm -e puppet
- sudo rpm rpm -e hiera
- curl -O https://yum.puppetlabs.com/el/7/products/x86_64/hiera-1.3.4-1.el7.noarch.rpm
- sudo rpm -ivh hiera-1.3.4-1.el7.noarch.rpm
- vi /etc/yum.repos.d/epel.repo
- At the bottom of the [epel] section, after the gpgkey add a newline with: exclude=hiera*
- Save the file
- sud0 yum install -y puppet-3.6.2-3.el7.noarch
- reboot
- sudo rm /etc/puppet/hiera.yaml
- sudo packstack –allinone
This should successfully install. Godspeed.
Networking
Now that Openstack is setup, we still have to setup our network with private & public routed networks, so we can turn this into a real multi-node setup and ssh to our hosts and let them reach the internet etc. To do this, much like my previous post you need to modify your /etc/sysconfig/network-scripts/ files to reflect this.
[tuxninja@diamond network-scripts]$ cat ifcfg-enp4s0f0 NAME="enp4s0f0" UUID="e0c3929c-1f9b-44d1-9c59-6c8872f603bd" DEVICE="enp4s0f0" TYPE="OVSPort" NM_CONTROLLED="no" DEVICETYPE="ovs" OVS_BRIDGE="br-ex" BOOTPROTO="none" ONBOOT="yes" [tuxninja@diamond network-scripts]$ cat ifcfg-enp4s0f1 NAME=enp4s0f1 UUID=ed50b4b6-2c29-4307-bbb0-f3c923f6552a DEVICE=enp4s0f1 ONBOOT=yes NM_CONTROLLED=no BOOTPROTO=none NETWORK=10.0.0.0 IPADDR=10.0.0.1 NETMASK=255.255.255.0 [tuxninja@diamond network-scripts]$ cat ifcfg-br-ex DEVICE=br-ex DEVICETYPE=ovs TYPE=OVSBridge BOOTPROTO=static IPADDR=192.168.1.10 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 DNS1=8.8.8.8 DNS2=8.8.4.4 DNS3=192.168.1.1 ONBOOT=yes [tuxninja@diamond network-scripts]$
Note: I deleted all the IPV6 crap, I think it messes some stuff up. When your done making the changes with your favorite editor, restart networking : sudo /etc/init.d/network restart or sudo systemctl restart network
Next go into in the Horizon Dashboard GUI and delete the demo project. See my previous article for details on how.
Back On the All-In-One Node Console
[root@diamond ~]# source keystonerc_admin [root@diamond ~(keystone_admin)]# neutron router-create router1 [root@diamond ~(keystone_admin)]# neutron net-create private [root@diamond ~(keystone_admin)]# neutron subnet-create private 10.0.0.0/24 --name private_subnet [root@diamond ~(keystone_admin)]# neutron router-interface-add router1 private_subnet [root@diamond ~(keystone_admin)]# neutron net-create public --router:external [root@diamond ~(keystone_admin)]# neutron subnet-create public 192.168.1.0/24 --name public_subnet --enable_dhcp=False --allocation-pool start=192.168.1.51,end=192.168.1.99 --gateway=192.168.1.1 [root@diamond ~(keystone_admin)]# neutron router-gateway-set router1 public
Next ‘reboot’ or restart all openstack services :
for service in `openstack-service list`; do openstack-service restart $service; done
Note: it appears the –full-restart flag is gone, used to work !
When logging into your dashboard located at http://192.168.1.10/dashboard at some point you might hit a bug that prevent you from logging into the Horizon dashboard see : https://bugzilla.redhat.com/show_bug.cgi?id=1218894 … the work-around for this is to clear your browser cookies.
You’re Done
That’s it. Next steps would be to create a project & new admin user, re-create the required network mappings in openstack using the above commands (modify the names to make them unique) and create your ssh key, import it, download some images, import them using glance, and create some VM’s. Also I like to delete the demo project (you can also prevent this from being created with a flag on the packstack command). Make sure you delete all default security rules and add back ICMP, TCP, and UDP allow ingress / egress rules for 0.0.0.0 aka any/any, again you can see my article on CentOS 6.5 with more specifics on how to do this. Additionally, I have an article on how to add additional compute nodes as well.
As always I can be reached for assistance @ tuxninja [at] tuxlabs.com
Happying Stacking !
Installing Openstack Kilo on Centos 7 Read More »