db: Retrieve VirtualInterface objects by UUID, not address

Bug #1958938 reported by Minghong Hou
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Low
Minghong Hou

Bug Description

1. I use the method get_by_uuid from VirtualInterface to get the vif of an instance.
    vif = objects.VirtualInterface.get_by_uuid(context, port_uuid)
2. I change the 'tag' value in the vif.
3. I use the method vif.save()

Result:
I expect the the tag of my vif would be changed, but actually the LOG information of nova-compute says that 'Nonetype' object has no attribute to 'update'. By pdb check, I find out that the the method in nova/db/sqlalchemy/api/virtual_interface_update can't find the corresponding record of the instance.

The reason I guess is that when we use the method get_by_uuid, the address would be the mac address, but the address shows in the table of VirtualInterface is 'address/uuid', which causes the virtual_interface_update can't find the corresponding address.

Minghong Hou (houmh)
Changed in nova:
assignee: nobody → Minghong Hou (houmh)
tags: added: nova virtualinterface
Minghong Hou (houmh)
Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/nova/+/828819

Minghong Hou (houmh)
summary: - VirtualInterface table can't use the default save() to change the table
+ db: Retrieve VirtualInterface objects by UUID, not address
Changed in nova:
importance: Undecided → Low
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.