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 --state_path=/var/lib/nova --lock_path=/var/lock/nova --state_path=/var/lib/nova --verbose --s3_host=10.10.10.2 --rabbit_host=10.10.10.2 --cc_host=10.10.10.2 --nova_url=http://10.10.10.2:8774/v1.1/ --fixed_range=192.168.0.0/16 --network_size=8 --routing_source_ip=10.10.10.2 --sql_connection=mysql://novadbadmin:novasecret@10.10.10.2/nova --glance_api_servers=192.168.3.2:9292 --image_service=nova.image.glance.GlanceImageService --iscsi_ip_prefix=192.168. --vlan_interface=br100 --public_interface=eth0
For configuring with PostgreSQL change the line with --sql_connection to:
--sql_connection=postgresql://novadbadmin:novasecret@10.10.10.2/nova
For configuring with SQLite change the line with --sql_connection to:
--sql_connection=sqlite:////var/lib/nova/nova.sqlite
Install iscsitarget
sudo apt-get -y install iscsitarget iscsitarget-dkms
Enable iscsitarget.
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
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 restart libvirt-bin; 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
Provide a range of IPs to be attached to the instances.
sudo nova-manage network create private 192.168.4.0/24 1 256
Allocate 32 pubic IP addresses for use with the instances starting from 10.10.10.225.
sudo nova-manage floating create --ip_range=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
Restart all the nova related services.
sudo restart libvirt-bin; 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 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.
In Diablo, by default novarc file contains EC2_ACCESS_KEY in a format that is not usable by euca-* commands. To fix this:
sudo nova-manage user exports novaadmin
The output will be something like:
export EC2_ACCESS_KEY=c043916c-9a0c-4f91-ad6c-4b30908b6c77 export EC2_SECRET_KEY=d0ac688e-02f3-48f3-b758-96d886461ace
Open the novarc file and replace the line
export EC2_ACCESS_KEY="novaadmin:proj"
with
export EC2_ACCESS_KEY="c043916c-9a0c-4f91-ad6c-4b30908b6c77:proj"
source /home/localadmin/creds/novarc
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-09-29 07:26:04 AVAILABILITYZONE | |- nova-scheduler enabled :-) 2011-09-29 07:26:04 AVAILABILITYZONE | |- nova-network enabled :-) 2011-09-29 07:26:07 AVAILABILITYZONE | |- nova-volume enabled :-) 2011-09-29 07:26:06
