$ sudo git clone git://github.com/openstack/heat.git /opt/heat
$ cd /opt/heat && sudo git checkout -b grizzly origin/stable/grizzly
$ sudo pip install -r /opt/heat/tools/pip-requires
$ sudo ./install.sh
$ sudo cp -a /etc/heat /etc/heat_bak
共通設定
$ sudo vi heat-api-cfn.conf heat-api-cloudwatch.conf heat-engine.conf
rabbit_password=guest
↓変更
rabbit_host=stack01
rabbit_virtual_host=/nova
rabbit_userid=nova
rabbit_password=password
bind_host = 0.0.0.0
↓変更
bind_host = 192.168.10.50
rpc_backend=heat.openstack.common.rpc.impl_qpid
↓変更
rpc_backend=heat.openstack.common.rpc.impl_kombu
データベース設定の変更
$ sudo vi heat-engine.conf
sql_connection = mysql://heat:heat@localhost/heat
↓
sql_connection = mysql://heat:password@stack01/heat?charset=utf8
$ NOVA_CONTOLLER_HOSTNAME=stack01
$ sudo sed -i "s/verybadpass/heat/" /etc/heat/heat-api-cfn-paste.ini
$ sudo sed -i "s/verybadpass/heat/" /etc/heat/heat-api-cloudwatch-paste.ini
$ sudo sed -i "s/verybadpass/heat/" /etc/heat/heat-api-paste.ini
$ sudo sed -i "s/localhost/$NOVA_CONTOLLER_HOSTNAME/" /etc/heat/heat-api-cfn-paste.ini
$ sudo sed -i "s/localhost/$NOVA_CONTOLLER_HOSTNAME/" /etc/heat/heat-api-cloudwatch-paste.ini
$ sudo sed -i "s/localhost/$NOVA_CONTOLLER_HOSTNAME/" /etc/heat/heat-api-paste.ini
$ sudo sed -i "s/localhost/$NOVA_CONTOLLER_HOSTNAME/" /etc/heat/heat-engine.conf
$ sudo sed -i "s/127.0.0.1/$NOVA_CONTOLLER_HOSTNAME/" /etc/heat/heat-api-cfn-paste.ini
$ sudo sed -i "s/127.0.0.1/$NOVA_CONTOLLER_HOSTNAME/" /etc/heat/heat-api-cloudwatch-paste.ini
$ sudo sed -i "s/127.0.0.1/$NOVA_CONTOLLER_HOSTNAME/" /etc/heat/heat-api-paste.ini
$ sudo sed -i "s/127.0.0.1/$NOVA_CONTOLLER_HOSTNAME/" /etc/heat/heat-engine.conf
$ MYSQL_PASS_HEAT=password
$ NOVA_CONTOLLER_HOSTNAME=stack01
$ mysql -u root -pnova -e "drop database heat;"
$ mysql -u root -pnova -e "create database heat character set utf8;"
$ mysql -u root -pnova -e "grant all privileges on heat.* to 'heat'@'%' identified by '$MYSQL_PASS_HEAT';"
$ mysql -u root -pnova -e "grant all privileges on heat.* to 'heat'@'localhost' identified by '$MYSQL_PASS_HEAT';"
$ mysql -u root -pnova -e "grant all privileges on heat.* to 'heat'@'$NOVA_CONTOLLER_HOSTNAME' identified by '$MYSQL_PASS_HEAT';"
$ sudo heat-db-setup deb -r nova
Installing on a Debian system.
Verified connectivity to MySQL.
Creating 'heat' database.
/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py:703: SADeprecationWarning: The 'listeners' argument to Pool (and create_engine()) is deprecated. Use event.listen().
Pool.__init__(self, creator, **kw)
/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py:160: SADeprecationWarning: Pool.add_listener is deprecated. Use event.listen()
self.add_listener(l)
Complete!
$ sudo sed '1a\. ./home/stack/keystonerc' tools/nova_create_flavors.sh | more
$ sudo ./tools/nova_create_flavors.sh
環境変数を読み込ませていない場合は読み込ませます。
$ export ADMIN_TOKEN=ADMIN
$ export OS_USERNAME=admin
$ export OS_PASSWORD=secrete
$ export OS_TENANT_NAME=demo
$ export OS_AUTH_URL=http://stack01:5000/v2.0/
SERVICE_HOST=stack01
HEAT_API_CFN_HOST=8000 ; HEAT_ENGINE_PORT=8001 ; HEAT_API_CW_PORT=8003 ; HEAT_API_PORT=8004
function get_id () {
echo `"$@" | awk '/ id / { print $4 }'`
}
HEAT_USER=$(get_id keystone user-create --name=heat \
--pass="$SERVICE_PASSWORD" \
--tenant_id $SERVICE_TENANT \
--email=heat@example.com)
keystone user-role-add --tenant_id $SERVICE_TENANT \
--user_id $HEAT_USER \
--role_id $ADMIN_ROLE
keystone role-create --name heat_stack_user
HEAT_CFN_SERVICE=$(get_id keystone service-create \
--name=heat-cfn \
--type=cloudformation \
--description="Heat CloudFormation Service")
keystone endpoint-create \
--region RegionOne \
--service_id $HEAT_CFN_SERVICE \
--publicurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1" \
--adminurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1" \
--internalurl "http://$SERVICE_HOST:$HEAT_API_CFN_PORT/v1"
HEAT_SERVICE=$(get_id keystone service-create \
--name=heat \
--type=orchestration \
--description="Heat Service")
keystone endpoint-create \
--region RegionOne \
--service_id $HEAT_SERVICE \
--publicurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \
--adminurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s" \
--internalurl "http://$SERVICE_HOST:$HEAT_API_PORT/v1/\$(tenant_id)s"
OZはAiolusプロジェクトの中のOSイメージを作成するコンポーネントです。
$ sudo git clone https://github.com/clalancette/oz.git /opt/oz
$ cd /opt/oz
$ sudo apt-get install gcc build-essential devscripts debhelper python-all gdebi -y
$ sudo make deb
$ cd ..
$ sudo gdebi oz_0.10.0-1_all.deb --non-interactive
$ sudo git clone -q git://github.com/sdake/heat-jeos.git /opt/heat-jeos
$ cd /opt/heat-jeos
$ sudo python setup.py install
$ cd /var/lib/libvirt/images
$ sudo wget http://ftp.riken.go.jp/Linux/ubuntu-iso/CDs/10.04/ubuntu-10.04.4-server-amd64.iso
$ sudo wget http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F17-x86_64-cfntools.qcow2
OZの要件による設定変更
$ sudo chmod 644 /boot/vmlinuz*
$ sudo update-guestfs-appliance
heat-jeos list で利用できるイメージを確認できます。
# sudo -E heat-jeos list
+-------------------------------+----------+---------+--------------+
| Name | OS | Version | Architecture |
+-------------------------------+----------+---------+--------------+
| CentOS-6.3-x86_64-cfntools | CentOS-6 | 3 | x86_64 |
| F16-i386-cfntools | Fedora | 16 | i386 |
| F16-i386-gold | Fedora | 16 | i386 |
| F16-x86_64-cfntools-openshift | Fedora | 16 | x86_64 |
| F16-x86_64-cfntools | Fedora | 16 | x86_64 |
| F16-x86_64-gold | Fedora | 16 | x86_64 |
| F17-i386-cfntools | Fedora | 17 | i386 |
| F17-i386-gold | Fedora | 17 | i386 |
| F17-x86_64-cfntools | Fedora | 17 | x86_64 |
| F17-x86_64-gold | Fedora | 17 | x86_64 |
| U10-x86_64-cfntools | Ubuntu | 10.04 | x86_64 |
+-------------------------------+----------+---------+--------------+
$ sudo -E heat-jeos -y -v -d -H stack01 -A ADMIN -K password -T admin -S keystone create U10-x86_64-cfntools --register-with-glance
$ sudo heat-jeos list
# sudo heat-engine &
# sudo heat-api-cfn &
# sudo heat-metadata &
# sudo -E heat -y -v -d -H stack01 -A ADMIN -K password -T admin -S keystone list
$ USER=wpadmin
$ PASS=word01password
$ sudo -E heat -y -v -d create wordpress --template-file=/opt/heat/templates/WordPress_Single_Instance_deb.template --parameters="InstanceType=m1.tiny;DBUsername=${USER};DBPassword=${PASSWORD};KeyName=${USER}_key;LinuxDistribution=U10"