Jump to: navigation, search

Difference between revisions of "Heat/GettingStartedUsingMasterOnUbuntu"

Line 143: Line 143:
  
  
=== Modify /etc/heat/heat-api-cfn.conf, /etc/heat/heat-metadata.conf and /etc/heat/heat-engine.conf to contain: ===
+
=== Modify /etc/heat/heat-api-cfn.conf and /etc/heat/heat-engine.conf to contain: ===
  
 
<pre><nowiki>
 
<pre><nowiki>
Line 272: Line 272:
 
sudo heat-engine &
 
sudo heat-engine &
 
sudo heat-api-cfn &  
 
sudo heat-api-cfn &  
sudo heat-metadata &
+
sudo heat-api-cloudwatch &
 
</nowiki></pre>
 
</nowiki></pre>
  

Revision as of 11:14, 30 November 2012

Install Ubuntu on host

Download and install [Ubuntu 12.04](http://releases.ubuntu.com/precise/ubuntu-12.04-server-amd64.iso) selecting the following packages:

  • SSH packages
  • Virtual Machine Host

Note: tasksel can be used to select applications on an existing desktop installation.

Increase storage pool if necessary: (use uuid to generate) http://wiki.libvirt.org/page/Tips#Adding_an_alternative_storage_pool

Note: We recommend using a storage volume with format of raw, but Qed may be usable in the future.

Configure and upgrade Ubuntu

If you don't want to enter your password for each sudo step, configure sudo

sudo visudo
enter password


by replacing the line


%sudo ALL=(ALL:ALL) ALL


with


%sudo ALL=(ALL:ALL) NOPASSWD:ALL

Finish installing by running the commands

sudo apt-get upgrade  
sudo apt-get dist-upgrade 
sudo apt-get install git
sudo apt-get install build-essential devscripts debhelper python-all gdebi-core
sudo apt-get install python-setuptools python-prettytable python-lxml
sudo apt-get install libguestfs*
sudo apt-get autoremove 
sudo shutdown -r now   


Note: the build-essential sudo line is used to build an Oz .deb package.

Install DevStack

Download Devstack

git clone git://github.com/openstack-dev/devstack.git  


Configure the default catalog

Add the following to devstack/files/default_catalog.templates:


catalog.RegionOne.heat.publicURL = http://localhost:8000/v1  
catalog.RegionOne.heat.adminURL = http://localhost:8000/v1  
catalog.RegionOne.heat.internalURL = http://localhost:8000/v1  
catalog.RegionOne.heat.name = Heat Service  

Note: This step is mandatory because devstack uses a non-persistent file backend for the keystone catalog. Other keystone parameters are stored in a MySql database.

If running desktop edition configure resolve.conf

The server edition should take care to set resolv.conf properly, but the desktop may require modification. Add a namserver entry with the value 8.8.8.8 to /etc/resolvconf/resolv.conf.d/head. Adding an entry directly to /etc/resolv.conf will cause this to be lost after a reboot.

This will resolve nameservers using Google's global DNS servers after devstack reconfigures DNS.


echo 'nameserver 8.8.8.8' >> /etc/resolvconf/resolv.conf.d/head 
resolvconf -u


Install Devstack

cd devstack
./stack.sh  


Note: Occasionally devstack will fail to install. If this happens screen -x stack followed by screen ctrl-a \ followed by yes. Then restarting stack.sh seems to work properly.

Please set password during devstack setup for the following services:

  • MySQL
  • Rabbit
  • service token
  • service password
  • horizon/keystone

Note: These items will be identified by <password type> in this guide.

Create keystonerc

The keystonerc file contains security credentials for use with OpenStack.

Create keystonerc

export ADMIN_TOKEN=<admin token password>
export OS_USERNAME=admin  
export OS_PASSWORD=password  
export OS_TENANT_NAME=admin  
export OS_AUTH_URL=http://127.0.0.1:5000/v2.0/  
export OS_AUTH_STRATEGY=keystone  


Load keystonerc into your environment and verify evey thing is ok.

source keystonerc  
keystone user-list


Install Heat from master

{{ git clone git://github.com/heat-api/heat.git cd heat sudo ./install.sh </nowiki></pre>


Modify /etc/heat/heat-api-cfn.conf and /etc/heat/heat-engine.conf to contain:

rpc_backend=heat.openstack.common.rpc.impl_kombu
rabbit_password=<rabbit password>


Note: The editor used must be started with sudo.

Modify /etc/heat/heat-api-cfn-paste.ini to contain:

  
[filter:authtoken]  
admin_password=<admin password>

Note: The editor used must be started with sudo.

Create the MySQL Heat database:

sudo heat-db-setup deb -r <mysql password>


Create the keystone authentication parameters

sudo -E ./tools/heat-keystone-service-devstack


Install OZ from the upstream master location

git clone https://github.com/clalancette/oz.git  
cd oz
make deb
cd ..
sudo gdebi oz_0.8.0-1_all.deb  

Note: Select yes to "Create or update supermin appliance.". This will rebuild the guestfs appliance to work with latest updates of Ubuntu. Oz will not work properly without updating the guestfs appliance.

Note: We recommend cloning oz from the latest master. The debian packaging is broken in older versions and U10/U12 support is not available in Oz shipped with distros.

Install heat-jeos from master

The heat-jeos tool builds virtual machine images for use with Heat.


git clone git://github.com/heat-api/heat-jeos.git  
cd heat-jeos  
sudo python setup.py install  


Download ISO images for various distributions

If you just want to try a basic wordpress template, download [Ubuntu 10.04.4 Server](http://releases.ubuntu.com/10.04.4/ubuntu-10.04.4-server-amd64.iso)

If you want to try more templates, also download [Fedora 17](http://download.fedoraproject.org/pub/fedora/linux/releases/17/Fedora/x86_64/iso/Fedora-17-x86_64-DVD.iso)

After download completes, copy the iso image to the location heat-jeos expects:

sudo cp Downloads/ubuntu-10.04.4-server-amd64.iso /var/lib/libvirt/images  


Configure your host to work with Heat

Create SSH key and add it to the Nova sshkey list

ssh-keygen -t rsa  
nova keypair-add --pub_key ~/.ssh/id_rsa.pub ${USER}_key  


Note: If running in a VM, modify /etc/libvirt/qemu/networks/default.xml: change network to not conflict with host (default 192.168.122.x)

sudo service libvirt-bin restart


If dnsmasq is not running on the default network

sudo virsh net-destroy default
sudo virsh net-start default


Configure libguestfs (required by Oz) to work in latest Ubuntu 12

Some files shipped with Ubuntu 12 are incompatible with libguestfs used by the image creation software Oz. To allow heat-jeos to work properly, run the following commands:

sudo chmod 644 /boot/vmlinuz*
sudo update-guestfs-appliance

Note: For more details see: http://permalink.gmane.org/gmane.comp.emulators.guestfs/1382 and http://libguestfs.org/guestfs-faq.1.html

Note: If you want to create F17 images, you may need a new libguestfs binary of version 1.18.0 or later. Ubuntu Precise may not have this version yet.

You can use the Debian Wheezy version including the [guestfs shared library](http://packages.debian.org/wheezy/amd64/libguestfs0/download), the [tools](http://packages.debian.org/wheezy/amd64/libguestfs-tools/download) and the and the [python libraries](http://packages.debian.org/wheezy/amd64/python-guestfs/download).

Create the Heat JEOS image

sudo -E heat-jeos -y create U10-x86_64-cfntools --register-with-glance

Note: The -E option to sudo preserves the environment, specifically the keystone credentials, when heat-jeos is run as root.

Note: heat-jeos must be run as root in order to create the cfntools disk image.

Experiment with Heat

Execute the heat api services

sudo heat-engine &
sudo heat-api-cfn & 
sudo heat-api-cloudwatch &


Run the debian wordpress example

heat-cfn -d create wordpress --template-file=templates/WordPress_Single_Instance_deb.template --parameters="InstanceType=m1.xlarge;DBUsername=${USER};DBPassword=verybadpassword;KeyName=${USER}_key;LinuxDistribution=U10"


List stacks

heat-cfn list


List stack events

heat-cfn event-list wordpress


Describe the wordpress stack

heat-cfn describe wordpress

Note: After a few seconds, the StackStatus should change from IN_PROGRESS to CREATE_COMPLETE.

Verify instance creation

Because the software takes some time to install from the repository, it may be a few minutes before the Wordpress intance is in a running state.

Point a web browser at the location given by the WebsiteURL Output as shown by heat describe::


wget ${WebsiteURL}


Delete the instance when done

heat-cfn delete wordpress
heat-cfn list


Note: This operation will show no running stack.

Troubleshooting

If you encounter issues running heat, see if the solution to the issue is documented on the Troubleshooting wiki page. If not, let us know about the problem in the #heat IRC channel on freenode.