Ask Your Question
0

heat stack-update removes existing ip configuration

asked 2015-10-09 09:54:03 -0600

Markus Kirchknopf gravatar image

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.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2016-06-10 10:22:35 -0600

nuruddin gravatar image

Hi,

How to deal with IP change? for example if you take heat template snapshot and want to use in different network, in this case huge IP change occurs, how to deal with that?

//Regards Nur

edit flag offensive delete link more
0

answered 2015-10-14 00:54:21 -0600

Markus Kirchknopf gravatar image

Finally I solved the issue by myself, the replacement_policy from the Neutron::Port must be set to AUTO which is a little bit strange because it's the default value. Only by setting it explicit the scenario works as it should work.

So my port configuration looks following:

  port:
    type: OS::Neutron::Port
    properties:
      network_id: 0eaf58df-6512-4ba7-9865-e92ba7b747a2
      replacement_policy: AUTO
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-10-09 09:41:18 -0600

Seen: 845 times

Last updated: Jun 10 '16