remove-fixed-ip raise InvalidUUID Exception

Bug #1065899 reported by Tiantian Gao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Tiantian Gao
Folsom
Fix Released
Medium
Joe Gordon

Bug Description

1. use admin user to boot a instance
  hzgaott@114-113-199-x:~$ nova list
+--------------------------------------+----------------+---------+----------------------+
| ID | Name | Status | Networks |
+--------------------------------------+----------------+---------+----------------------+
| 6d74b0cc-5bb2-4233-b9a0-f80013412a3d | test-fixed-ip | ACTIVE | private=10.120.34.10 |

2. add additional fixed-ip to the instance
  hzgaott@114-113-199-x:~$ nova add-fixed-ip 6d74b0cc-5bb2-4233-b9a0-f80013412a3d f95c4d3b-44a1-436e-b6f5-d186569d9514
  hzgaott@114-113-199-x:~$ nova list
+--------------------------------------+----------------+---------+------------------------------------+
| ID | Name | Status | Networks |
+--------------------------------------+----------------+---------+------------------------------------+
| 6d74b0cc-5bb2-4233-b9a0-f80013412a3d | test-fixed-ip | ACTIVE | private=10.120.34.10, 10.120.34.18 |

3. remove the additional fixed-ip
    hzgaott@114-113-199-8:~$ nova remove-fixed-ip 6d74b0cc-5bb2-4233-b9a0-f80013412a3d 10.120.34.18
    return 202
    but the fixed-ip is still there.
    hzgaott@114-113-199-x:~$ nova list
+--------------------------------------+----------------+---------+------------------------------------+
| ID | Name | Status | Networks |
+--------------------------------------+----------------+---------+------------------------------------+
| 6d74b0cc-5bb2-4233-b9a0-f80013412a3d | test-fixed-ip | ACTIVE | private=10.120.34.10, 10.120.34.18 |

in nova-network.log
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp Traceback (most recent call last):
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp File "/usr/local/lib/python2.7/dist-packages/nova/openstack/common/rpc/amqp.py", line 275, in _process_data
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp rval = self.proxy.dispatch(ctxt, version, method, **args)
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp File "/usr/local/lib/python2.7/dist-packages/nova/openstack/common/rpc/dispatcher.py", line 145, in dispatch
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp return getattr(proxyobj, method)(ctxt, **kwargs)
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp File "/usr/local/lib/python2.7/dist-packages/nova/network/manager.py", line 257, in wrapped
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp return func(self, context, *args, **kwargs)
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp File "/usr/local/lib/python2.7/dist-packages/nova/network/manager.py", line 1217, in remove_fixed_ip_from_instance
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp fixed_ips = self.db.fixed_ip_get_by_instance(context, instance_id)
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp File "/usr/local/lib/python2.7/dist-packages/nova/db/api.py", line 482, in fixed_ip_get_by_instance
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp return IMPL.fixed_ip_get_by_instance(context, instance_uuid)
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp File "/usr/local/lib/python2.7/dist-packages/nova/db/sqlalchemy/api.py", line 129, in wrapper
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp return f(*args, **kwargs)
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp File "/usr/local/lib/python2.7/dist-packages/nova/db/sqlalchemy/api.py", line 1217, in fixed_ip_get_by_instance
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp raise exception.InvalidUUID(uuid=instance_uuid)
2012-10-12 16:50:20 TRACE nova.openstack.common.rpc.amqp InvalidUUID: Expected a uuid but received 559.

the method "fixed_ip_get_by_instance" in sqlalchemy/api.py used instance uuid rather than id, so change id to uuid in network/api.py can fix the bug.

Tiantian Gao (gtt116)
Changed in nova:
assignee: nobody → TianTian Gao (gtt116)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
importance: Undecided → Medium
tags: added: folsom-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/14383
Committed: http://github.com/openstack/nova/commit/66521a1571f0922f791ae7f405129fb99b870f38
Submitter: Jenkins
Branch: master

commit 66521a1571f0922f791ae7f405129fb99b870f38
Author: TianTian Gao <gtt116@126.com>
Date: Fri Oct 12 17:37:05 2012 +0800

    Used instance uuid rather than id in remove-fixed-ip

    remove-fixed-ip called db method fixed_ip_get_by_instance. but
    fixed_ip_get_by_instance use instance uuid not id, so change to
    uuid in remove-fixed-ip.

    Fixed bug: #1065899

    Change-Id: Ic7526c7e91933424c04be9bb91d4a98cfedd9b01

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/folsom)

Fix proposed to branch: stable/folsom
Review: https://review.openstack.org/16710

Joe Gordon (jogo)
tags: removed: folsom-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/folsom)

Reviewed: https://review.openstack.org/16710
Committed: http://github.com/openstack/nova/commit/85a8bc285131bdc179e884b7b8a5b1e43206a1be
Submitter: Jenkins
Branch: stable/folsom

commit 85a8bc285131bdc179e884b7b8a5b1e43206a1be
Author: TianTian Gao <gtt116@126.com>
Date: Fri Oct 12 17:37:05 2012 +0800

    Used instance uuid rather than id in remove-fixed-ip

    remove-fixed-ip called db method fixed_ip_get_by_instance. but
    fixed_ip_get_by_instance use instance uuid not id, so change to
    uuid in remove-fixed-ip.

    Fixed bug: #1065899

    Change-Id: Ic7526c7e91933424c04be9bb91d4a98cfedd9b01
    (cherry picked from commit 66521a1571f0922f791ae7f405129fb99b870f38)

Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-1 → 2013.1
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.