Skip to content
Search

OpenStack:RDO

lastmod 2018-08-17created 2015-07-1628 edits

Install introduce

  1. Install CentOS. (Use LVM.)
  2. On CentOS 7, a large amount of space is allocated to /home, so remove that LVM partition and reallocate it to root: see CentOS:ResizeLVM.
  3. Disable SELinux.
  4. If needed, install the NVIDIA driver.
  5. Generate the RDOProject Answer file.
  6. Install. (The installer tries to access the root account over ssh during installation. So you must check that root access over ssh is possible.)

How to install

In non-English locales, apply the locale settings below. /etc/environment

LANG=en_US.utf-8
LC_ALL=en_US.utf-8

Change the SELinux setting. Change enforcing to permissive in the /etc/sysconfig/selinux file.

Install the repository.

## On RHEL:
$ sudo yum install -y https://www.rdoproject.org/repos/rdo-release.rpm
## On CentOS:
$ sudo yum install -y centos-release-openstack-mitaka

## Add repository
$ sudo yum update -y
$ sudo yum install -y openstack-packstack

Stop the NetworkManager service, which changes network settings.

$ sudo systemctl disable NetworkManager
$ sudo systemctl enable network
$ sudo systemctl stop NetworkManager.service
$ sudo systemctl start network.service

The simple installation method is as follows. (Skip this if you want to use an external network.)

$ sudo packstack --allinone

Using external network

If you want to connect to an external network, install as below. (In the following, replace eth0 with the name of your own Ethernet device. e.g. on CentOS 7, something like enp0s31.)

$ sudo packstack --allinone --provision-demo=n --os-neutron-ovs-bridge-mappings=extnet:br-ex --os-neutron-ovs-bridge-interfaces=br-ex:eth0 --os-neutron-ml2-type-drivers=vxlan,flat

Above, extnet is the logical name for the external physical L2 segment. You will refer to this name later when defining the external network.

Also, the network type supported by the install command above is flat. This is needed when the Provider Network is a simple flat network. (the most common setup for PoCs). If you use a VLAN Segment for external connectivity, the type driver needs vlan.2

the command is currently broken for Mitaka

See: Bug 1316856 - packstack fails to configure ovs bridge for CentOS

If the command above does not work properly, remove the –os-neutron-ovs-bridge-interfaces=br-ex:eth0 argument3 and proceed with the steps below.

After completion, given a single machine with a current IP of 192.168.122.212/24 via DHCP with gateway of 192.168.122.1: Make /etc/sysconfig/network-scripts/ifcfg-br-ex resemble:

DEVICE=br-ex
DEVICETYPE=ovs
TYPE=OVSBridge
BOOTPROTO=static
IPADDR=192.168.122.212 # Old eth0 IP since we want the network restart to not 
                       # kill the connection, otherwise pick something outside your dhcp range
NETMASK=255.255.255.0  # your netmask
GATEWAY=192.168.122.1  # your gateway
DNS1=192.168.122.1     # your nameserver
ONBOOT=yes

The file above will move the network parameters from eth0 to br-ex.

Make /etc/sysconfig/network-scripts/ifcfg-eth0 resemble (no BOOTPROTO):

Note: if on Centos7, the file could be /etc/sysconfig/network-scripts/ifcfg-enp2s0

DEVICE=eth0
TYPE=OVSPort
DEVICETYPE=ovs
OVS_BRIDGE=br-ex
ONBOOT=yes

It is also possible to use a bond. In that case /etc/sysconfig/network-scripts/ifcfg-bond0 may look like this:

DEVICE=bond0
DEVICETYPE=ovs
TYPE=OVSPort
OVS_BRIDGE=br-ex
ONBOOT=yes
BONDING_MASTER=yes
BONDING_OPTS="mode=802.3ad"

This means, we will bring up the interface and plug it into br-ex OVS bridge as a port, providing the uplink connectivity.

Restart the network service

$ sudo service network restart

Create the external network with the Neutron command. (The extnet L2 segment name below was used as the argument to --os-neutron-ovs-bridge-mappings during the initial installation.)

$ . keystonerc_admin
$ neutron net-create external_network --provider:network_type flat --provider:physical_network extnet  --router:external

Create the subnet, paying attention to the /etc/sysconfig/network-scripts/ifcfg-br-ex settings.

$ neutron subnet-create --name public_subnet --enable_dhcp=False --allocation-pool=start=192.168.122.10,end=192.168.122.20 --gateway=192.168.122.1 external_network 192.168.122.0/24

Add CirrOS to Glance for the demo.

$ curl http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img | glance image-create --name='cirros image' --visibility=public --container-format=bare --disk-format=qcow2

This completes the minimum setup for administration.

Testing

Add a new user to test the external network. Detailed explanations of the commands are omitted.

$ openstack project create --enable internal
$ openstack user create --project internal --password foo --email [email protected] --enable internal

Now, let's switch to the newly created user:

# export OS_USERNAME=internal
# export OS_TENANT_NAME=internal
# export OS_PASSWORD=foo

Then create a router and set its gateway using the external network created by the admin in one of previous steps:

# neutron router-create router1
# neutron router-gateway-set router1 external_network

Now create a private network and a subnet in it, since demo provisioning has been disabled:

# neutron net-create private_network
# neutron subnet-create --name private_subnet private_network 192.168.100.0/24

Finally, connect your new private network to the public network through the router, which will provide floating IP addresses.

# neutron router-interface-add router1 private_subnet

Easiest way to the network and to launch instances is via horizon, which was set up by packstack.

Command

packstack --gen-answer-file=/answer/file/path
Generates an Answer file.
packstack --answer-file=/path/to/packstack_answers.txt
Reuse an answer file.
packstack --allinone
Shorthand for: --install-hosts=<local ipaddr>--novanetwork-pubif=<dev>--novacompute-privif=lo --novanetwork-privif=lo --os-swift-install=y --nagios--install=y
All in one command.

Configure

CONFIG_CINDER_VOLUMES_SIZE
how to resize cinder size
Sets the Cinder volume size.
Size of Block Storage volumes group. Actual volume size will be extended with 3% more space for VG metadata. Remember that the size of the volume group will restrict the amount of disk space that you can expose to Compute instances, and that the specified amount must be available on the device used for /var/lib/cinder.
CONFIG_PROVISION_DEMO
Recommand value: n
Command-line flag: --provision-demo=n
Whether to apply the settings for the test demo.
CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS
Recommand value: extnet: br-ex
Command-line flag: --os-neutron-ovs-bridge-mappings=extnet:br-ex
CONFIG_NEUTRON_OVS_BRIDGE_IFACES
Recommand value: br-ex:enp3s0
Command-line flag: --os-neutron-ovs-bridge-interfaces=br-ex:enp3s0
CONFIG_NEUTRON_ML2_TYPE_DRIVERS
Recommand value: vxlan,flat
Command-line flag: --os-neutron-ml2-type-drivers=vxlan,flat
CONFIG_HORIZON_SSL
Applies SSL to Horizon.

Horizon SSL

With the current (Oct. 2013) version of packstack the CONFIG_HORIZON_SSL=y fails for both grizzly and havana. Here is a guide to setting up ssl after the installation.

install the ssl module for apache

$ yum -y install mod_ssl

copy the certificate and key files to /etc/httpd/conf.d

update /etc/httpd/conf.d/ssl.conf

     SSLCertificateFile /etc/httpd/conf.d/mycert.crt
     SSLCertificateKeyFile /etc/httpd/conf.d/mycert.key

update /etc/httpd/conf.d/openstack-dashboard.conf

sed -i '1 i\
#these lines force an ssl connection\
RewriteEngine On\
RewriteCond %{HTTPS} !on\
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]\
'  /etc/httpd/conf.d/openstack-dashboard.conf

make a backup of the ssl.conf file (in case packstack is re-run)

$ tar cfz /etc/httpd/conf.d/ssl.tz /etc/httpd/conf.d/ssl.conf

restart the web service

$ service httpd restart

Troubleshooting

rdo cannot remove lib dracut hooks shutdown 30-dm-shutdown readonly file system

After installing RDO, the server may fail to shut down normally. See here.

Not working external network in VirtualBox

In VirtualBox, communication with the external network may fail through a network adapter configured as a bridged adapter. In this case, change that network adapter to promiscuous mode.

See also

Favorite site

Documentation

Guide

References


  1. If you want to rename enp0s3 to the eth0 style, see Ifconfig#CentOS7 : Change network interface name. ↩

  2. For reference, to modify the settings directly after installation, see here. ↩

  3. As an alternative, you can use packstack –allinone –provision-all-in-one-ovs-bridge=n, but this method is more complicated. ↩