virtual_interfaces extension returns UUID, Nova expects ID
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Vish Ishaya |
Bug Description
nova/api/
44 def _translate_
45 """Maps keys for VIF summary view."""
46 d = {}
47 d['id'] = vif['uuid']
48 d['mac_address'] = vif['address']
49 return d
however, the the Nova code will only retrieve an ID properly.
1450 @require_context
1451 def instance_
1452 result = _build_
1453 filter_
1454 first()
1455
1456 if not result:
1457 raise exception.
1458
1459 return result
Resulting stack trace:
(nova.rpc): TRACE: File "/opt/stack/
(nova.rpc): TRACE: rval = node_func(
(nova.rpc): TRACE: File "/opt/stack/
(nova.rpc): TRACE: return func(self, context, *args, **kwargs)
(nova.rpc): TRACE: File "/opt/stack/
(nova.rpc): TRACE: vifs = self.db.
(nova.rpc): TRACE: File "/opt/stack/
(nova.rpc): TRACE: return IMPL.virtual_
(nova.rpc): TRACE: File "/opt/stack/
(nova.rpc): TRACE: return f(*args, **kwargs)
(nova.rpc): TRACE: File "/opt/stack/
(nova.rpc): TRACE: db.instance_
(nova.rpc): TRACE: File "/opt/stack/
(nova.rpc): TRACE: return IMPL.instance_
(nova.rpc): TRACE: File "/opt/stack/
(nova.rpc): TRACE: return f(*args, **kwargs)
(nova.rpc): TRACE: File "/opt/stack/
(nova.rpc): TRACE: raise exception.
(nova.rpc): TRACE: InstanceNotFound: Instance a4bf8a2b-
Is the appropriate fix to have the VIF extension return ID or to make instance_get work with UUIDs like this:
@require_context
def instance_
if utils.is_
result = _build_
first()
else:
result = _build_
first()
if not result:
raise exception.
return result
Changed in nova: | |
status: | New → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → Vish Ishaya (vishvananda) |
Changed in nova: | |
assignee: | Vish Ishaya (vishvananda) → Michael Fork (mjfork) |
Changed in nova: | |
milestone: | none → essex-4 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | essex-4 → 2012.1 |
A better fix, based on instance_update in nova/nova/ db/sqlalchemy/ api.py may be
@require_context get(context, instance_id, session=None): uuid_like( instance_ id): get_by_ uuid(context, instance_id, session) instance_ get(context, session=session).\
filter_ by(id=instance_ id).\ InstanceNotFoun d(instance_ id=instance_ id)
def instance_
if utils.is_
return instance_
else:
result = _build_
first()
if not result:
raise exception.
return result