With the basics and theory behind us, it is time to get hands-on with Nova and install the code on a server. In this chapter, we will walk through the installation and configuration of Nova on a single node with both the StackOps distro and Ubuntu packages. You’ll get a feeling for the complexities of implementing your design choices in actual usage. While these installations will be only single nodes, they will contain the entire array of OpenStack software and features.
As we described back in StackOps, StackOps provides a distro for OpenStack with a bare metal installer. The bare metal installer automates most of the installation and configuration tasks, leaving very little command line or configuration file editing for the administrator. It will install an operating system, necessary software packages, and Nova configuration files for us.
Installing StackOps will overwrite any operating system on your server. It is not intended to overlay Nova onto already installed servers.
Since our purpose is to get some hands-on experience with Nova, we will be installing a single node that runs all the services. As StackOps is a full distribution, it makes many of the cloud design choices for us. The single node installation has made the following design choices:
nova-api supporting both the OpenStack API and EC2 API
nova-objectstore (instead of Glance) for an image service
nova-volume with iSCSI volumes
nova-network using FlatDHCP manager (configurable)
MySQL for our database
RabbitMQ for the messaging queue
nova-compute using KVM or UML for virtualization
MySQL database for authentication
nova-scheduler chance (default) scheduler
If you have any problems following along with the installation, you can find more detailed documentation at the StackOps Documentation Site.
StackOps has a very basic set of requirements for a minimal installation as you can see in Table 7-1. While these minimal requirements will get the system installed and running, you will be constrained in the number of virtual machines that you can launch. At the base 2GB of RAM, you might only be able to launch a single small instance.
Table 7-1. Minimal StackOps Configuration
| Component | Specification |
|---|---|
| CPU | Intel or AMD x64 |
| RAM | 2GB |
| Disk | 1 x 30GB Drive |
| NIC | 1 x 1GbE |
As you can see, this minimal configuration should be able to be satisfied by most desktops or servers bought within the last few years.
Of course, the minimal requirements are only useful for a proof of concept or experimental system, but it fits perfectly for our needs. A more appropriately configured system could be used as a production system. The baseline for this would be as shown in Table 7-2.
Table 7-2. Baseline StackOps Configuration
| Component | Specification |
|---|---|
| CPU | 2 x Intel/AMD x64 |
| RAM | 32GB |
| Disk | 2 x 2TB SATA RAID 1 Drives 2 x 32GB SAS/SSD/SATA RAID 1 Drives |
| NIC | 2 x 1GbE |
For the purposes of this book, we will be installing on a very small server system called an HP ProLiant MicroServer™. While the exact model is irrelevant, it does show that StackOps and Nova can be installed on relatively inexpensive and modestly configured hardware (The MicroServer retails for under $400 in the United States). The test server specifications are shown in Table 7-3.
The StackOps Distro is available free from their community website
at http://www.stackops.org/. It comes in several
versions and two formats (CD or USB stick image). For the purposes of
this book, we will be using version 0.2.1 -
Build 112 (stackops-0.2.1-b112-d20110517), which is based on
the Nova “Cactus” release. Once you have downloaded the software, burn
it to a CD or transfer it to your USB stick (depending on which image
you downloaded).
Now that we have our CD or USB stick ready, we will go ahead and install it on our server. As we decided earlier, we will be installing a single node system (everything running on one server) with basic network and iSCSI volumes. StackOps makes most of these configuration decisions easy for us with their predefined deployment scenarios. All together, they offer four deployment scenarios:
Single Node: All in one deployment.
Dual Node: One cloud controller node (everything but nova-compute) and one compute node. This is the smallest viable production configuration.
Multi-Node: A four node plus configuration with dedicated nova-network, nova-compute, and nova-volume nodes. This is a fairly advanced configuration that requires specialized networking.
Advanced Multi-Node: An upcoming configuration that adds monitoring and other options to create a larger scale production installation.
We’ll use the “Single Node” scenario for this exercise.
Your first step in installing your StackOps distro is the installation of the operation system, all the necessary prerequisite packages, OpenStack packages, and preconfigured nova components. In addition, it installs an agent that configures OpenStack for you. When you first boot your system with the CD or USB Stick, you’ll be greeted with the StackOps splash screen (as seen in Figure 7-1) that resembles most Linux distro installations.
After choosing the “Install StackOps Controller Node,” you’ll be led through a number of standard Linux installation screens. They will ask you about your language and keyboard layout before installing a number of basic components.
After it has completed the basic components installation, it will ask you to configure your network settings. Enter your IP address, management network IP, netmask, and default gateway address. It will then try and contact a public NTP (Network Time Protocol) server. If it fails, it will ask you to specify one manually.
StackOps requires that the nodes have static IP addresses, not DHCP provided ones.
Since I am putting this server on my home network, I have chosen 192.168.1.65 as my server node IP address. This is out of my home router’s DHCP block so that I won’t have any conflicts. I’ve set the gateway address to 192.168.1.254 (my DSL router) and used the normal 255.255.255.0 netmask.
Once the network has been configured, you will move on to disk partitioning. This shows standard Linux disk partitioning screens.
To complete this installation and use nova-volume, you need to have one extra empty partition. This can be an extra hard drive in your machine, an external hard drive, or extra partition. If you only have only one hard drive (like the machine in this example), you should create an unused partition in this step. If you don’t, you’ll need an external hard drive to complete the install. In my example, I simply plugged a 16GB flash drive into the USB port.
After the disk is partitioned and formatted, the base operating system and OpenStack packages will be installed. This will take a while. When it is finished, pop out the CD or USB stick and reboot the machine. It should boot to the command prompt, as shown in Figure 7-2.
Now that the machine is up and running, let’s test to make sure everything went all right before we move on to configuring our cloud. Login to the server as the “root” user with the password “stackops” to get a root user prompt. Check to make sure that the StackOps agent is running by checking its log file:
# more /var/log/nova/installer-agent.py.log 2011-07-04 11:28:14-0700 [-] Log opened. 2011-07-04 11:28:14-0700 [-] Starting server: 2011-07-04 11:28:14.515648 2011-07-04 11:28:14-0700 [-] twisted.web.server.Site starting on 8888
With the basic distro successfully installed, it is now time to configure the Nova software. StackOps has an agent-based “Smart Installer” that guides you through the configuration process, gives you intelligent defaults, and then applies the configuration to your newly installed server. While we are only using it for a simple single-node install here, it will also configure and apply to multiple servers according to their role in the deployment scenario.
The first step in running the Smart Installer is to connect a
web browser to the address shown in the banner of your server’s login
screen. This should be an address in the form of http://xxx.xxx.xxx.xxx:8888/, where xxx.xxx.xxx.xxx is your server’s IP address.
Once you connect to that address, you will be redirected to Smart
Installer login screen.
Your browser will need to have access to the Internet. It acts as a middleman between the two, gathering config data from your server and transferring to the configuration web application. Your server does not need access to the Internet.
The first screen of the Smart Installer will ask you to create an account and then login. While creating an account is not a necessity, it will allow you to save, edit, and redeploy your configurations later. Figure 7-3 shows the login screen.
Once registered and logged in, the Smart Installer will step you through a number of screens to configure your Nova deployment. The first screen is the most important: choosing your deployment scenario (Figure 7-4). We will be using the “single node” scenario.
Next, it will help you configure your controller functions (nova-api, networks, database, queue, etc.) of your installation. The first of these screens will review your hardware configuration, as shown in Figure 7-5.
Once you review the hardware configurations, you can advance to the software requirements screen. This is also a read-only screen, and after reviewing your server network configuration, you can go on to the next screen.
The next screen shows the configuration options for network topologies. Since we are using a single-interface test server, we don’t need to change anything (it should be preset to your eth0 interface). In more advanced deployment scenarios, this screen lets you assign separate service, storage, and public networks. Advance to the next screen.
The next screen is the most important screen of our configuration. It shows the global service options. This screen allows you to customize the configurations for:
Database
Queue
EC2 API
S3 repository
Authentication
Logging
Network
Of all these options, the only one that we must edit is the network section. Figure 7-6 shows the networking options.
Pay close attention these configurations. Misconfiguring this step will result in your instances not starting or being unable to be reached. Use the following guidelines for these options:
type: Choose your network manager. We will leave this at
nova.network.manager.FlatDHCPManager.
fixed_range: Choose your fixed (private) IP address range. It is fine to use the default 10.0.0.0/8 range as long as this does not conflict with your current network settings. As I use the 192.168.1.0/24 range on my internal network, I will leave the default.
network size: Choose the size of your fixed IP range. For this single node installation, this is not relevant, but we will make it smaller. My test server uses 8.
floating range: This is the most important entry. Enter the
range for your floating IPs (public addresses) that are available
on your network. Since my internal network uses the 192.168.1.0/24
range, I have configured my router to only give out IP addresses
in the 192.168.1.1 - 192.168.1.64 range. I decided to have my
instances use the addresses in the 192.168.1.129 - 192.168.1.134
range. Consulting my handy subnet calculator, I used 192.168.1.128/29 for this entry.
This is the most likely place that your installation will go wrong. Make sure that you carefully plan and review your entries here. If you are in doubt, consult your local network administrator.
When you are satisfied with your network options, move on to the
compute screen. All the options on this screen should be fine for our
test installation. The only option that you might want to review is
your libvirt type. This pull-down
menu lets you choose between QEMU and KVM virtualization. Unless you
do not have a KVM capable machine, you should leave it on KVM.
The final configuration screen for the Smart Installer is the
volume options. You may need to change the lvm_device option to the device path for
your empty partition that you created during the Install Operating System step.
As the screen says, “Choose a device that you are 100% sure is not already in use!” This device will be completely erased. I usually use a blank USB stick for this step and choose /dev/sdb1 from the pull-down menu.
With the volume configuration done, you are ready to install your configuration to your server, as shown in Figure 7-7.
Now that we have finished the installation and configuration, let’s make sure that everything is up and running. Log in into your Nova server as root with the ’stackops’ password. Once you’ve logged into the server, add the Nova binaries to your path.
# export PATH=$PATH:/var/lib/nova/bin/
Then check to make sure all the services are up and running with the nova-manage command.
# nova-manage service list nova-controller nova-compute enabled :-) 2011-07-07 06:53:05 nova-controller nova-network enabled :-) 2011-07-07 06:52:58 nova-controller nova-scheduler enabled :-) 2011-07-07 06:53:04 nova-controller nova-volume enabled :-) 2011-07-07 06:53:04
As you can see, we’ve used the nova-manage command with the service list arguments to query the database
and see which services are registered, enabled, and running. The
“smiley” field (the :-) between the ‘enabled’ and
last checked in fields) shows that each of the services are healthy. If
they hadn’t checked in with the database in a while, we would see ‘XXX’
in their listing. The nova-manage
command is covered more thoroughly in Chapter 9.