Author: Alessandro Pilotti
Source: Planet OpenStack
There are plenty of online resources about Puppet and OpenStack, but after a quick search I noticed that none of them was actually providing what people might actually be looking for: a simple manifest to deploy the latest and greatest OpenStack (Kilo at the time of this writing). This post is meant to solve this precise request starting with the easiest scenario: an “all in one” deployment (AiO).
All in One OpenStack on Ubuntu Server 14.04 LTS
OpenStack has a very modular architecture, with a lot of individual projects dealing with different aspects of a cloud, for example Keystone (identity), Nova (compute), Neutron (networking), Cinder (block storage) and so on. All in one simply means that all those components are deployed on a single host.
A detailed description of the OpenStack architecture goes beyond the scope of this post, but you can find all the documentation you need to get you started on the OpenStack foundation’s site.
The OpenStack community provides also official OpenStack Puppet modules:
- https://github.com/openstack/puppet-keystone
- https://github.com/openstack/puppet-nova
- https://github.com/openstack/puppet-neutron
- https://github.com/openstack/puppet-glance
- https://github.com/openstack/puppet-cinder
- …and a lot more!
What are missing are some samples showing how to bring all the pieces together and, to complicate things for the neophyte, there are tons of other Puppet modules available on Stackforge or on the Puppet forge with similar aims. The result is that getting lost when looking for a simple quickstart is very easy!
To put things straight, this post is not planning to showcase yet another Puppet module, but it’s rather focused on making good use of the existing official ones with a simple manifest, targeting the Kilo release and one of the most popular Linux OS choices: Ubuntu Server 14.04 LTS.
Let’s get started. Use git to clone your copy of the manifest:
git clone https://github.com/cloudbase/openstack-puppet-samples/tree/master/kilo cd openstack-puppet-samples/kilo
Install all the dependencies (note that version 6 of the OpenStack Puppet modules refer to the Kilo release):
sudo apt-get install puppet -y sudo puppet module install openstack/keystone --version ">=6.0.0 <7.0.0" sudo puppet module install openstack/glance --version ">=6.0.0 <7.0.0" sudo puppet module install openstack/cinder --version ">=6.0.0 <7.0.0" sudo puppet module install openstack/nova --version ">=6.0.0 <7.0.0" sudo puppet module install openstack/neutron --version ">=6.0.0 <7.0.0" sudo puppet module install example42/network sudo puppet module install saz/memcached
Now, just edit openstack-aio-ubuntu-single-nic.pp and replace the following variable values based on your environment, in particular $public_subnet_gateway and $public_subnet_allocation_pools if you want to have external network access from your OpenStack instances:
$interface = 'eth0' $ext_bridge_interface = 'br-ex' $dns_nameservers = ['8.8.8.8', '8.8.4.4'] # This is the network to assign to your instances $private_subnet_cidr = '10.0.0.0/24' # This must match a network to which the host is connected $public_subnet_cidr = '192.168.209.0/24' # The gateway must be in the range defined in $public_subnet_cidr $public_subnet_gateway = '192.168.209.2' # Must be a subset of the $public_subnet_cidr range $public_subnet_allocation_pools = ['start=192.168.209.30,end=192.168.209.50']
Next, if you have a host with a single network adapter and configured with DHCP, the manifest will get the IP address from eth0 and do all the work for you, assigning a static address based on the discovered networking information (you may want to exclude this IP from your DHCP lease range afterwards), alternatively just assign the following variables:
$local_ip = "your host ip" $gateway = "your gateway"
Note: this manifest expects that virtualization support is available and enabled on your host and KVM will be used as the hypervisor option in Nova. Although not recommended, this can be changed by setting “libvirt_virt_type” to “qemu“.
The basic configuration is done, let’s get started with the deployment:
sudo puppet apply --verbose openstack-aio-ubuntu-single-nic.pp
Access your OpenStack deployment
Your OpenStack dashboard is now accessible at http://<openstack_host>/horizon.
Yopu can login using one of the predefined users created by the manifest: admin or demo. All passwords are set to Passw0rd (this can be changed in the manifest of course).
Alternatively, using the shell just source one of the following files to access your admin or demo environments:
source /root/keystonerc_demo source /root/keystonerc_admin
Create a keypair if you don’t have one already:
test -d ~/.ssh || mkdir ~/.ssh nova keypair-add key1 > ~/.ssh/id_rsa_key1 chmod 600 ~/.ssh/id_rsa_key1
You can now boot an instance:
NETID=`neutron net-show private | awk '{if (NR == 5) {print $4}}'` nova boot --flavor m1.tiny --image "cirros-0.3.4-x86_64" --key-name key1 --nic net-id=$NETID vm1
What’s next?
This is the first post in a series about Puppet and OpenStack. Expect to see more complex multi-node configurations and how to add Hyper-V compute nodes to work side by side with KVM!
The post How to easily deploy OpenStack Kilo with Puppet – Part 1 appeared first on Cloudbase Solutions.
Powered by WPeMatico