Ubuntu Cloud Infrastructure
Introduction
|
Ubuntu Cloud Infrastructure is a ready to deploy Infrastructure-as-a-Service (IaaS) based on OpenStack. These instructions apply to Ubuntu 12.04 LTS (Precise Pangolin) to deploy OpenStack Essex release.
See UbuntuCloudInfrastructure11.10 for install steps on Ubuntu 11.10.
Installation
There are multiple ways to install Ubuntu Cloud Infrastructure.
- Ubuntu Cloud Live Image: a single node all in one cloud booting from USB
- Ubuntu Cloud Infrastructure with MAAS and Juju: our recommended method
- Install Ubuntu Cloud Infrastructure from packages: the hard way
Ubuntu Cloud Live Image
Download the image from http://cdimage.ubuntu.com/ubuntu-cloud-live/releases/12.04/
Create a USB stick using USB Creator or some other tools as described here
- Boot from the created USB stick
- apt-get install juju
- open the file /home/ubuntu/Desktop/GettingStarted.txt and follow the instructions for final configuration.
Your Ubuntu Cloud Infrastructure is ready to be used. See the section Use your cloud for more details.
Ubuntu Cloud Infrastructure with MAAS and Juju
This install is done in 3 steps:
- Install the MAAS server
- Install Juju
- Deploy Ubuntu Cloud Infrastructure with Juju
Which are described below.
Requirements
It's assumed the user has sufficient number of nodes available in MAAS. If you don't intend to use the helper application, juju-jitsu and its deploy-to option allowing you to co-locate services, then the minimum deployment outlined below requires a minimum of 10 machines including the juju bootstrap node and MAAS server.
Installing the MAAS server
Follow the steps provided at http://maas.ubuntu.com/docs/install.html
Add enough nodes to support your OpenStack deployment as described at http://maas.ubuntu.com/docs/nodes.html
If using juju-jitsu, the minimum recommended number of machines is 6.
Install Juju
This can be done on the same server you have deployed MAAS onto.
1. Create SSH keys
Juju requires SSH keys to be able to access the deployed nodes. In case those keys do not exist, then we have to create them before we bootstrap our environment:
ssh-keygen -t rsa
2. Deploy juju
Follow the steps described at https://maas.ubuntu.com/docs/juju-quick-start.html
Deploying Ubuntu Cloud Infrastructure with Juju
1. Create a configuration file
Create a *minimal* deployment config. There are more options for each, look at each respective charm's config.yaml. We'll name this file openstack.cfg and will use it afterward by specifying "--config=openstack.cfg" in "juju deploy" commands.
keystone: # Set this here for testing only, otherwise randomly # generated and stored on-disk on keystone node admin-password: "openstack" nova-cloud-controller: network-manager: "FlatDHCPManager" nova-volume: # This must be a free block device that is writable on the nova-volume host. # Or use a file path and size as follows: # block-device: "/var/lib/nova-volumes/vol1.img|2G" block-device: "xvdb" overwrite: "true"
2. Deploy from local branches of charms (optional)
Starting with Ubuntu 12.04 LTS By default, Juju now deploys charms directly from its central charm repository if no --repository option is provided. You may wish to modify the default charms that we are providing. In this case you will need to first checkout the charms from bzr using the following script:
mkdir -p precise cd precise for i in glance keystone nova-cloud-controller nova-compute nova-volume openstack-dashboard rabbitmq-server ; do bzr branch lp:~charmers/charms/precise/$i/trunk $i done bzr branch lp:charms/mysql mysql bzr branch lp:charms/rabbitmq rabbitmq cd ..
You will then need to modify each one of the juju deploy command to add "--repository=. local:<charm-name>". For example, the line
juju deploy mysql
would be replaced by
juju deploy --repository=. local:mysql
3. Deploy the various services
Deploy each service, specifying configs where necessary
juju deploy mysql juju deploy rabbitmq-server juju deploy --config=openstack.cfg keystone juju deploy --config=openstack.cfg nova-cloud-controller juju deploy --config=openstack.cfg nova-volume juju deploy nova-compute juju deploy glance juju deploy openstack-dashboard
If you choose to co-locate services on the same machine, then it is suggested that you deploy this way:
juju deploy mysql juju deploy --config=openstack.cfg keystone juju deploy --config=openstack.cfg nova-cloud-controller juju deploy --config=openstack.cfg nova-volume juju deploy nova-compute
(wait for all services to start)
juju deploy glance --to [machine # of keystone] juju deploy rabbitmq-server --to [machine # of mysql]
(wait for glance to show as started)
juju deploy openstack-dashboard --to [machine # of keystone]
4. Establish relation between services
When all services are started, begin adding relations with Keystone and the database (this needs to happen first), then between the other services.
juju add-relation keystone mysql juju add-relation nova-cloud-controller mysql juju add-relation nova-cloud-controller rabbitmq-server juju add-relation nova-cloud-controller glance juju add-relation nova-cloud-controller keystone juju add-relation nova-volume nova-cloud-controller juju add-relation nova-volume mysql juju add-relation nova-volume rabbitmq-server juju add-relation nova-compute mysql juju add-relation nova-compute rabbitmq-server juju add-relation nova-compute glance juju add-relation nova-compute nova-cloud-controller juju add-relation glance mysql juju add-relation glance keystone juju add-relation openstack-dashboard keystone
5. Expose the services you want (optional)
If you are using this to deploy OpenStack on a IaaS for testing purposes, the last step is to expose the services that should be made available to outside requests, opening the required firewall ports in the security group. This is obviously not needed when deploying using MAAS.
juju expose openstack-dashboard juju expose nova-cloud-controller
Use Your Cloud
At this point, the Openstack cloud has been deployed and should be functioning.
Point your browser to the public address of the openstack-dashboard node, "http://node-address:70/horizon" or "https://node-address:433/horizon", login using admin/openstack (passwd defined in cfg above) and you can begin using the cloud, adding users, etc. Use the command "juju status openstack-dashboard" to get its IP address.
NOTE: If you are running the node from the Live Image and have followed the configuration steps in the GettingStarted.txt file as mentioned above, the dashboard username/password will be ubuntu/ubuntu123, NOT admin/openstack.
After you've logged into the dashboard, you can add new users from the "Users" panel of the Admin toolbar. Once logged in as a new user, you can export your EC2 and Nova credentials as well as a Juju environments.yaml configuration from the 'Settings' section of the dashboard (linked from the upper-right)
EC2 API
To begin using the EC2 API, select Settings-> EC2 Credentials -> Download EC2 Credentials in the Openstack dashboard. Save the file (eg, /home/adam/openstack/"). We can then unzip these and begin using our cloud:
cd /home/adam/openstack unzip 247e0c5de9dc415a8e411da643308eb6d-x509.zip . ec2rc.sh wget http://uec-images.ubuntu.com/server/server/releases/oneiric/beta-1/ubuntu-11.10-beta1-server-cloudimg-amd64.tar.gz uec-publish-tarball ./ubuntu-11.10-beta1-server-cloudimg-amd64.tar.gz images euca-add-keypair adam >adam.pk euca-run-instances -k adam ami-00000002
Juju
You can also begin using Juju to deploy services into your new cloud. To generate a Juju environments.yaml entry suitable for use against the new Openstack cluster, select Settings -> Juju Environment Config -> Download Juju Environment Config in the Openstack dashboard. Note that you'll need to update the 'default-image-id' in this file to match the AMI id of an Ubuntu cloud image that you've published (eg, ami-00000002 from above).
Scaling
If we still have extra machines, they can easily be added, for example, as a compute node through Juju to increase our resources:
juju add-unit nova-compute