Remove all of the old tools/openstack related info from
the on_fedora docs - the best source of documentation for
Fedora is now the RDO docs (for Heat RPM package installs),
or the on_devstack guide for development installs.
Change-Id: Id33d94cc063361698eb87315a56ef7f720ecaa73
Partial-Bug: #1182428
@ -23,343 +23,17 @@ Getting Started With Heat on Fedora
To include code in the script that should not appear in the output, make it
a comment block.
..
#!/bin/bash
# Exit on error
set -e
Get Heat
--------
Clone the heat repository_ from GitHub at ``git://github.com/openstack/heat.git``. Note that OpenStack must be installed before heat.
Optionally, one may wish to install Heat via RPM. Creation instructions are in the readme in the heat-rpms_ repository at ``git://github.com/heat-api/heat-rpms.git``.
If you use this method, you will need to manually create a guest network. How this is done depends on your environment. An example network create operation:
Where ``${SUBNET}`` is of the form ``10.0.0.0/24``. The network range here, must *not* be one used on your existing physical network. It should be a range dedicated for the network that OpenStack will configure. So if ``10.0.0.0/24`` clashes with your local network, pick another subnet.
Currently, the bridge is not created immediately upon running this command, but is actually added when Nova first requires it.
If you wish to set up OpenStack manually on Fedora, read `Getting Started With OpenStack On Fedora`_.
.._Getting Started With OpenStack on Fedora: http://fedoraproject.org/wiki/Getting_started_with_OpenStack_on_Fedora_17
Note: these credentials will be required for all future steps.
Allocate Floating IP Addresses to OpenStack
-------------------------------------------
If you want to use templates that depend on ``AWS::EC2::EIP`` or ``AWS::EC2::EIPAssociation`` (multi-instance stacks often do, single-instance less often but it's still possible), see the wiki page on `Configuring Floating IPs`_.
Note: the first argument is either ``rpm`` for RPM-based distros (such as Fedora) or ``deb`` for Debian-based distros (such as Ubuntu). To prompt for confirmation when e.g. installing MySQL Server, omit the ``-y`` option. Run ``heat-db-setup --help`` for detailed documentation.
Register heat with keystone
---------------------------
::
sudo -E ./bin/heat-keystone-setup
Note: The ``-E`` option to ``sudo`` preserves the environment, specifically the keystone credentials, when ``heat-keystone-setup`` is run as root. This script needs to run as root in order to read the admin password.
Register a SSH key-pair with OpenStack Nova
-------------------------------------------
This is for Heat to associate with the virtual machines.
::
nova keypair-add --pub_key ~/.ssh/id_rsa.pub ${USER}_key
Verify JEOS registration
~~~~~~~~~~~~~~~~~~~~~~~~
Check that there is a ``F17-x86_64-cfntools`` JEOS in glance:
..
GLANCE_INDEX=$(cat <<EOF
::
glance index
..
EOF
)
$GLANCE_INDEX | grep -q "F17-x86_64-cfntools"
Update heat engine configuration file
-------------------------------------
The heat engine configuration file should be updated with the address of the bridge device (demonetbr0), however this device is not created by nova-network until the first instance is launched, so we assume that $BRIDGE_IP is 10.0.0.1 if $SUBNET is 10.0.0.0/24 as in the instructions above:
Alternatively, if you require a development environment not a package-based install, the suggested method is devstack, see instructions at :doc:`on_devstack`
::
sudo sed -i -e "/^\[DEFAULT\]/ a\\\nheat_metadata_server_url=http://${BRIDGE_IP}:8000/\n" /etc/heat/heat.conf
sudo sed -i -e "/^\[DEFAULT\]/ a\\\nheat_waitcondition_server_url=http://${BRIDGE_IP}:8000/v1/waitcondition/" /etc/heat/heat.conf
sudo sed -i -e "/^\[DEFAULT\]/ a\\\nheat_watch_server_url=http://${BRIDGE_IP}:8003/" /etc/heat/heat.conf
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. One way to check is to login via ssh and ``tail -f /var/log/yum.log``. Once ``mysql-server`` installs, the instance should be ready to go.
HOST=`echo $WebsiteURL | sed -r -e 's#http://([^/]+)/.*#\1#'`
retries=9
while ! ping -q -c 1 $HOST >/dev/null && ((retries-- > 0)); do
echo "Waiting for host networking..." >&2
sleep 2
done
test $retries -ge 0
sleep 10
retries=49
while ! ssh -o PasswordAuthentication=no -o StrictHostKeyChecking=no \
-q -t -l ec2-user $HOST \
sudo grep -q mysql-server /var/log/yum.log && \
((retries-- > 0))
do
echo "Waiting for package installation..." >&2
sleep 5
done
test $retries -ge 0
echo "Pausing to wait for application startup..." >&2
sleep 60
Point a web browser at the location given by the ``WebsiteURL`` Output as shown by ``heat-cfn describe``::
wget ${WebsiteURL}
Delete the instance when done
-----------------------------
::
heat-cfn delete wordpress
heat-cfn list
Note: This operation will show no running stack.
Other Templates
---------------
Check out the ``Wordpress_2_Instances_with_EBS_EIP.template``. This uses a few different APIs in OpenStack nova, such as the Volume API, the Floating IP API and the Security Groups API, as well as the general nova launching and monitoring APIs.
IPtables rules
--------------
Some templates require the instances to be able to connect to the heat CFN API (for metadata update via cfn-hup and waitcondition notification via cfn-signal):
Open up port 8000 so that the guests can communicate with the heat-api-cfn server::
Note the above rules will not persist across reboot, so you may wish to add them to /etc/sysconfig/iptables
Start the Heat Cloudwatch server
--------------------------------
If you wish to try any of the HA or autoscaling templates (which collect stats from instances via the CloudWatch API), it is neccessary to start the heat-api-cloudwatch server::
sudo -E bash -c 'heat-api-cloudwatch &'
Further information on using the heat cloudwatch features is available in the Using-Cloudwatch_ wiki page
CloudFormation (heat-api-cfn) and a native OpenStack Heat API (heat-api) are provided. To use the recommended Heat API, a python client library is necessary. To use this library, clone the python-heatclient repository_ from GitHub at ``git://github.com/openstack/python-heatclient.git``.
Install python-heatclient from source
-------------------------------------
In the python-heatclient directory, run the install script::
sudo ./setup.py install
Note that python-heatclient may be installed on a different server than heat itself.
Note that pip can be used to install python-heatclient, but the instructions vary for each distribution. Read your distribution documentation if you wish to install with pip.
Start the OpenStack specific Heat API
-------------------------------------
When using heat-pythonclient, the OpenStack API service provided by heat must be started::
sudo bash -c 'heat-api &'
List stacks
-----------
::
heat stack-list
..
echo; echo 'Success!'
Check out the example templates at ``https://github.com/openstack/heat-templates``. Here you can view example templates which will work with several Fedora versions.