Install the messaging queue server, RabbitMQ and various nova components.
sudo apt-get install -y rabbitmq-server nova-common nova-doc python-nova nova-api nova-network nova-volume nova-objectstore nova-scheduler nova-compute
Install euca2ools package for command line tools to interact with nova.
sudo apt-get install -y euca2ools
Install unzip for extracting archives.
sudo apt-get install -y unzip
Edit the /etc/nova/nova.conf file to look like this.
--dhcpbridge_flagfile=/etc/nova/nova.conf --dhcpbridge=/usr/bin/nova-dhcpbridge --logdir=/var/log/nova --lock_path=/var/lock/nova --state_path=/var/lib/nova --verbose --s3_host=10.10.10.2 --rabbit_host=192.168.3.1 --cc_host=192.168.3.1 --ec2_url=http://10.10.10.2:8773/services/Cloud --fixed_range=192.168.0.0/16 --network_size=8 --FAKE_subdomain=ec2 --routing_source_ip=192.168.3.1 --sql_connection=mysql://root:mygreatsecret@10.10.10.2/nova --glance_host=192.168.3.1 --image_service=nova.image.glance.GlanceImageService --iscsi_ip_prefix=192.168.
Enable iscsi target.
sudo sed -i 's/false/true/g' /etc/default/iscsitarget
Restart the iscsitarget service
sudo service iscsitarget restart
Create a Physical Volume.
sudo pvcreate /dev/sda6
Create a Volume Group named nova-volumes.
sudo vgcreate nova-volumes /dev/sda6
Create a group called "nova".
sudo groupadd nova
Change the ownership of the /etc/nova folder and permissions for /etc/nova/nova.conf:
sudo chown -R root:nova /etc/nova sudo chmod 644 /etc/nova/nova.conf
Restart all the nova related services.
sudo /etc/init.d/libvirt-bin restart; sudo restart nova-network; sudo restart nova-compute; sudo restart nova-api; sudo restart nova-objectstore; sudo restart nova-scheduler; sudo restart nova-volume; sudo restart glance-api; sudo restart glance-registry
Create nova schema in the Mysql Database.
sudo nova-manage db sync
Create a list of Ips to be used from the network of fixed Ips set inside nova.conf.
sudo nova-manage network create 192.168.3.0/24 1 255
Allocate 32 Pubic IP addresses for use with the instances starting from 10.10.10.225.
sudo nova-manage floating create 10.10.10.2 10.10.10.224/27
Create a user with admin rights on nova.
sudo nova-manage user admin novaadmin
Create a project named proj.
sudo nova-manage project create proj novaadmin
Create a directory to download nova credentials and download the zip file.
mkdir /home/localadmin/creds
Generate and save credentials for accessing/managing the nova cloud.
sudo nova-manage project zipfile proj novaadmin /home/localadmin/creds/novacreds.zip
Contents of novacreds.zip are required to use euca2ools to manage the cloud infrastructure and you will need to transfer this zip file to any machine from where you want to run the commands from euca2ools. We will be using these credentials from client1 as well.
Navigate in to the folder created and extract the files and change their ownership.
cd /home/localadmin/creds unzip novacreds.zip sudo chown localadmin:localadmin /home/localadmin/creds/ -R
Here are the files extracted:
cacert.pem, cert.pem, novarc, pk.pem
novarc contains several environmental variables including your nova credentials to be set before you can use the commands from euca2ools such euca-describe-images, euca-describe-instances etc. these variables can be set by sourcing novarc file.
source /home/localadmin/creds/novarc
Restart all the nova related services.
sudo /etc/init.d/libvirt-bin restart; sudo restart nova-network; sudo restart nova-compute; sudo restart nova-api; sudo restart nova-objectstore; sudo restart nova-scheduler; sudo restart nova-volume; sudo restart glance-api; sudo restart glance-registry
Check if the credentials are working and if nova has been setup properly by running:
euca-describe-availability-zones verbose
If you see something like the following with all components happy, it means that the set up is ready to be used.
AVAILABILITYZONE nova available AVAILABILITYZONE |- server1 AVAILABILITYZONE | |- nova-compute enabled : -) 2011-04-03 07:48:50 AVAILABILITYZONE | |- nova-scheduler enabled : -) 2011-04-03 07:48:48 AVAILABILITYZONE | |- nova-network enabled : -) 2011-04-03 07:48:49 AVAILABILITYZONE | |- nova-volume enabled : -) 2011-04-03 07:48:49
