Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

heat stack-update removes existing ip configuration

I want to use heat templates to in- and decrease the amount of instances within my private Juno cloud.

I use following 2 yaml files:

group.yaml
heat_template_version: 2014-10-16
resources:

  server:
    type: OS::Heat::ResourceGroup
    properties:
      count: 3
      resource_def: {type: fedora.yaml}

As you can see per default I start 3 instances, with following configuration:

fedora.yaml
heat_template_version: 2014-10-16
resources:

  init:
     type: OS::Heat::CloudConfig
     properties:
       cloud_config:
         chpasswd:
          list: |
            root:XXX
            fedora:XXX
          expire: False
         ssh_pwauth: True

  port:
    type: OS::Neutron::Port
    properties:
      network_id: 0eaf58df-6512-4ba7-9865-e92ba7b747a2
      replacement_policy: REPLACE_ALWAYS

  floating_ip:
    type: OS::Neutron::FloatingIP
    properties:
      floating_network_id: dce58c34-9d3f-4b1d-ad70-d3de7a762b7a
      port_id: { get_resource: port }

  server:
    type: OS::Nova::Server
    properties:
      flavor: m1.small
      image: fedora22_cloud
      networks:
        - port: { get_resource: port }
      user_data_format: RAW
      user_data:
        get_resource: init

First I create the stack with following command:

heat stack-create group -f group.yaml

After the stack is created I have 3 instances:

nova list
+--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-------------------------------------+
| ID                                   | Name                                                  | Status | Task State | Power State | Networks                            |
+--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-------------------------------------+
| c47c0298-0fec-4d52-a649-b5754ed7f704 | gr-er-3vzlom4ezpvd-0-jmmzqdvo4mc2-server-x67c3d3kse7i | ACTIVE | -          | Running     | internal=192.168.1.52, 172.29.15.40 |
| 1ad8790f-109f-4de4-a430-a54cd719e63f | gr-er-3vzlom4ezpvd-1-ublf5mhxouu7-server-ejrdxadabnnp | ACTIVE | -          | Running     | internal=192.168.1.53, 172.29.15.41 |
| fcbc2d71-da78-4181-83d2-b73405fc76bd | gr-er-3vzlom4ezpvd-2-m4acj4ber2ll-server-kb6ixvg4lqpp | ACTIVE | -          | Running     | internal=192.168.1.54, 172.29.15.42 |
+--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-------------------------------------+

Now I change the count property within the group.yaml file to 4 and update the stack:

heat stack-update group -f group.yaml

After the update is completed only the newly added instance has an ip configuration, the original three lost there configuration:

nova list
+--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-------------------------------------+
| ID                                   | Name                                                  | Status | Task State | Power State | Networks                            |
+--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-------------------------------------+
| c47c0298-0fec-4d52-a649-b5754ed7f704 | gr-er-3vzlom4ezpvd-0-jmmzqdvo4mc2-server-x67c3d3kse7i | ACTIVE | -          | Running     |                                     |
| 1ad8790f-109f-4de4-a430-a54cd719e63f | gr-er-3vzlom4ezpvd-1-ublf5mhxouu7-server-ejrdxadabnnp | ACTIVE | -          | Running     |                                     |
| fcbc2d71-da78-4181-83d2-b73405fc76bd | gr-er-3vzlom4ezpvd-2-m4acj4ber2ll-server-kb6ixvg4lqpp | ACTIVE | -          | Running     |                                     |
| 2e9eef04-4317-4de4-ada2-66161ddeb44c | gr-er-3vzlom4ezpvd-3-n3yewelbodfi-server-2dya5a4czv5z | ACTIVE | -          | Running     | internal=192.168.1.55, 172.29.15.43 |
+--------------------------------------+-------------------------------------------------------+--------+------------+-------------+-------------------------------------+

So the question is why is the original ip config lost during stack update, is this in general not possible or is something in my template file wrong? Every hint would be great - Thanks in advance.