1. create a stack with template:
**********************************
heat_template_version: 2015-04-30
resources:
s1:
type: OS::Nova::Server
properties:
flavor: 1
image: cirros-0.3.0-x86_64-disk
networks:
- port: {get_resource: s_port}
- port: {get_resource: s_port2}
name: testss
s_port2:
type: OS::Neutron::Port
properties:
network: 3447dd80-14ef-4059-8ea6-35f4fd60ba26
s_port:
type: OS::Neutron::Port
properties:
network: 3447dd80-14ef-4059-8ea6-35f4fd60ba26
**********************************
2. the stack create successful, to update the stack with template:
*******************************************
heat_template_version: 2015-04-30
resources:
s1:
type: OS::Nova::Server
properties:
flavor: 1
image: cirros-0.3.0-x86_64-disk
networks:
- port: {get_resource: s_port}
name: testss
s2:
type: OS::Nova::Server
properties:
flavor: 1
image: cirros-0.3.0-x86_64-disk
networks:
- port: {get_resource: s_port2}
name: tes2
s_port2:
type: OS::Neutron::Port
properties:
network: 3447dd80-14ef-4059-8ea6-35f4fd60ba26
s_port:
type: OS::Neutron::Port
properties:
network: 3447dd80-14ef-4059-8ea6-35f4fd60ba26
***************************************
3. the stack update failed, because the s2 create failed: port2 still in use
4. finally, we can find that port2 detached from s1
Because there is no dependence between s1 and s2, so they update in parallel. I think add the dependence to s2 will fix this problem.
It seems this is not allowed in heat.
The s_port2 is fixed in the first stack creation.