Problem with Heat Template using OS::Neutron::LoadBalancer
Hi all. I recently created a two node Openstack deployment, running on CentOS6.4 with kernel 2.6.32-358.123.2.openstack.el6.x86_64, enabling namespaces, Neutron, Heat and LBaaS. Everything appears to be running nicely. Manually creating a loadbalancer via CLI works just fine. However, when trying to create one via Heat, I'm running into some difficulty. I'm working on a Heat template where I'm building two servers and a loadbalancer. I would like to add the two servers as members of the loadbalancer. Here are the pertinent snippets of my template:
server1_port:
type: OS::Neutron::Port
properties:
network_id: 70f112d7-2b69-4b5a-b4c5-d7016f7b0f2a
fixed_ips:
- subnet_id: d9bdd754-5c57-41b0-ae50-a86ef41c8332
server2_port:
type: OS::Neutron::Port
properties:
network_id: 70f112d7-2b69-4b5a-b4c5-d7016f7b0f2a
fixed_ips:
- subnet_id: d9bdd754-5c57-41b0-ae50-a86ef41c8332
monitor:
type: OS::Neutron::HealthMonitor
properties:
type: HTTP
delay: 3
max_retries: 5
timeout: 10
pool:
type: OS::Neutron::Pool
properties:
name: mypool3
protocol: HTTP
subnet_id: d9bdd754-5c57-41b0-ae50-a86ef41c8332
lb_method: ROUND_ROBIN
monitors: [ { get_resource: monitor } ]
vip: {"address": 10.100.1.250, "protocol_port": 80}
mylb:
type: OS::Neutron::LoadBalancer
dependson: server1
properties:
members: [ XXXXX, XXXXX ]
pool_id: { get_resource: pool }
protocol_port: 80
My problem is I'm not quite sure how to populate the 'members' property (i.e. XXXXX in the above stanza) under OS::Neutron::LoadBalancer. I tried every built-in function (i.e. "ref", "get_reference", and "get_attr") combination I could think of, and nothing seems to work. From trial-and-error, I believe it's looking for a list of server IDs. The reason I suspect this is that the only way I could get this to work was hardcoding the IDs of two previously built servers. In other words, these servers had been created previous to running the Heat template. So once I changed that particular stanza to the below, everything worked perfectly.
mylb:
type: OS::Neutron::LoadBalancer
dependson: server1
properties:
members: [ c420bb4c-c748-47b1-a068-505683341ba5, 4d366207-f6de-41cf-b0d0-7b1f1a371a0b ]
pool_id: { get_resource: pool }
protocol_port: 80
Depending on which function I use, my heat-engine.log shows these types of messages when the template fails:
2013-11-01 12:15:22.802 8341 WARNING heat.engine.resources.nova_utils [-] Instance ({u'get_resource': u'server1'}) not found: Instance could not be found (HTTP 404) (Request-ID: req-631c9570-4370-4a73-9458-c9f37a36d1b3)
2013-11-01 12:36:13.378 8341 WARNING heat.engine.resources.nova_utils [-] Instance ({u'get_attr': [u'server1', u'instance_name']}) not found: Instance could not be found (HTTP 404) (Request-ID: req-a249fb64-90f3-476d-86a0-34bcc770315e)
Has anyone got this to work? Am I going about this incorrectly? Any tips would be greatly appreciated.
Thx!