[openstack-dev] [Quantum] Introducing Heat Quantum resource types

Steve Baker sbaker at redhat.com
Tue Nov 6 22:59:48 UTC 2012


The Quantum resource types have just landed in Heat master. I think they 
are ready now for some Quantum developers to write some templates to 
build some common scenarios.

The aim was to define resource types which mapped as closely as possible 
to the REST calls, which has made for a fairly clean implementation.

The following types have been defined:
OS::Quantum::FloatingIP
OS::Quantum::FloatingIPAssociation
OS::Quantum::Net
OS::Quantum::Port
OS::Quantum::Router
OS::Quantum::RouterInterface
OS::Quantum::RouterGateway
OS::Quantum::Subnet

Here are some example templates with them in use:
https://raw.github.com/heat-api/heat/master/templates/Quantum.template
https://raw.github.com/heat-api/heat/master/templates/Quantum_floating.template 
<https://raw.github.com/heat-api/heat/master/templates/Quantum.template>
https://raw.github.com/heat-api/heat/master/templates/WordPress_Single_Instance_With_Quantum.template 
<https://raw.github.com/heat-api/heat/master/templates/Quantum.template>

Heat resource types have a strict validated Properties schema however 
some Quantum resources allow arbitrary key/value pairs for 
configuration. This is made possible with the unvalidated value_specs 
property, eg:
     "external_network": {
       "Type": "OS::Quantum::Net",
       "Properties": {
         "value_specs": {
           "router:external", true
         }
       }
     },

Because Heat templates always execute in the context of a tenant, 
Quantum resources can only be created in the user's tenant and cannot be 
flagged as shared.

If you are running devstack with Quantum and Heat enabled you should be 
able to do the following:
cd ../heat

bin/heat-cfn create Quantum --template-file=templates/Quantum.template
bin/heat-cfn describe Quantum

bin/heat-cfn create Quantum_floating 
--template-file=templates/Quantum_floating.template --parameters="\
external_network=`quantum net-list -F id  -- --name=nova | awk "NR==4" | 
cut -d' ' -f2`;\
internal_network=`quantum net-list -F id  -- --name=private | awk 
"NR==4" | cut -d' ' -f2`;\
internal_subnet=`quantum subnet-list -F id  -- --cidr=10.0.0.0/24 | awk 
"NR==4" | cut -d' ' -f2`"

bin/heat-cfn create Quantum_instance 
--template-file=templates/WordPress_Single_Instance_With_Quantum.template--parameters="InstanceType=m1.large;DBUsername=wp;DBPassword=verybadpassword;KeyName=heat_key;LinuxDistribution=F17"

If you want a hand on IRC then you can join #heat or ping stevebake.

cheers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20121107/7c4c5b92/attachment.html>


More information about the OpenStack-dev mailing list