update to instances/servers fails because ports are still attached

Bug #1280151 reported by Zhang Yang
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
huangtianhua

Bug Description

if add a new port to ec2::instance in template.,update will fail.openstack version is havana(stable)
template before:
    my_instance:
    # Use an AWS resource type since this exists; so why use other name here?
    type: AWS::EC2::Instance
    properties:
      KeyName: { get_param: KeyName }
      ImageId: { get_param: ImageId }
      InstanceType: { get_param: InstanceType }
      NetworkInterfaces: [ { "NetworkInterfaceId" : {"Ref": "instacne_port"},
                                 "DeviceIndex" : "0" } ]
template update:
     my_instance:
    # Use an AWS resource type since this exists; so why use other name here?
    type: AWS::EC2::Instance
    properties:
      ImageId: { get_param: ImageId }
      InstanceType: { get_param: InstanceType }
      NetworkInterfaces: [ { "NetworkInterfaceId" : {"Ref": "instacne_port"},
                                 "DeviceIndex" : "0" },
                           { "NetworkInterfaceId" : {"Ref": "instacne_port2"},
                                 "DeviceIndex" : "1" }]

trace:
    014-02-14 16:58:38.493 22709 TRACE heat.engine.resource raise exceptions.from_response(resp, body, url, method)
2014-02-14 16:58:38.493 22709 TRACE heat.engine.resource Conflict: Port 74306ccc-7c49-46be-be70-2ccbe0578821 is still in use. (HTTP 409) (Request-ID: req-9c92c348-decd-4fda-8faa-debd155287a5)

when update a stack,heat won't delete the resource until the new resource is created,in this case,the new instance want to use the port which is still used by the old instance;so nova raise a conflict exception.I think will also happen when add a new volume to ec2:instance.

Changed in heat:
assignee: nobody → huangtianhua (huangtianhua)
Revision history for this message
huangtianhua (huangtianhua) wrote :

I think we can make the 'NetworkInterfaces' property updatable to avoid this problem.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/80209

Changed in heat:
status: New → In Progress
Changed in heat:
milestone: none → next
importance: Undecided → Medium
summary: - update failed if add a new port to ec2::instance in template
+ update to instances/servers fails because ports are still attached
Changed in heat:
importance: Medium → High
Revision history for this message
Nick Martin (nick-martin-z) wrote :

We are seeing a similar issue while trying to update an "OS::Nova::Server" resource.

Here's the resource:
"instance": {
            "Type": "OS::Nova::Server",
            "Properties": {
                "name": {"Fn::Join" : ["-", [ {"Ref" : "AWS::StackName"}, "cloudview01"]]},
                "availability_zone": "az1",
                "image": { "Ref" : "PSOStandardUbuntuLinuxImageId" },
                "flavor": "standard.medium",
                "key_name": { "Ref" : "StackProvisioningSSHKeyName" },
                "networks": [{"port": { "Ref" : "port_floating" }}],
                "metadata": {"tags": {"Fn::Join" : ["", ["Role_role::infra_services::cloudview,Stack_", {"Ref" : "AWS::StackName"}, ",Provisioner_Auto"]]}},
  "flavor_update_policy" : "REPLACE"
            }
        }

The final failing Heat event:
            "logical_resource_id": "instance",
            "resource_status_reason": "Conflict: Port 3f1e9c8e-ac1c-4d78-95b9-b10301a2690c is still in use. (HTTP 409) (Request-ID: req-46f28a5c-d795-4bb7-8d2c-8edc30ca6256)",
            "resource_status": "CREATE_FAILED"

Revision history for this message
Steve Baker (steve-stevebaker) wrote :

There was a fix recently for stack update with OS::Nova::Server + OS::Neutron::Port. Can you please try to reproduce with icehouse-rc1 and raise a new bug if it fails?

Revision history for this message
Steve Baker (steve-stevebaker) wrote :

oh, found bug #1301486 ;)

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/80209
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=0ddd9e0d9f6298500b8f0d7c2c847b7c254de2b0
Submitter: Jenkins
Branch: master

commit 0ddd9e0d9f6298500b8f0d7c2c847b7c254de2b0
Author: huangtianhua <email address hidden>
Date: Thu Mar 13 14:54:55 2014 +0800

    Make sure NetworkInterfaces and SubnetId updatable

    We should make the properties 'NetworkInterfaces' and 'SubnetId'
    updatable for AWS::EC2::Instance resource, so we can update the networks
    for an instance.

    Change-Id: I4a475fee6416696558807c189473a90d7517cfc0
    Closes-Bug: #1280151

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: next → none
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.