Comment 2 for bug 1371035

Revision history for this message
Babu Shanmugam (anbu-p) wrote : Re: [Bug 1371035] Re: Contrail port-list does not have fixed-ips based filtering

Hi Vedamurthy,
This is surprising.
Following is my investigation on this issue,
* When we try to create an instance for the second time, nova validates
the network setting to check if there is already a port with the same
network settings request (please refer to
$NOVA_SRC/nova/network/neutronv2/api.py - API.validate_networks()).
* If you can see validate_networks() method, there will be a call to
list_ports with a fixed-ip filter
* Since the port_list function in vnc_openstack/neutron_plugin_db.py
<https://review.opencontrail.org/#/c/2916/1/src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py>
does not have a filter for fixed-ips, it returns the entire list of
ports (basically the port created for the first instance)
* But when nova sees that list_ports with fixed-ips filter is not empty,
it throws an exception.FixedIpAlreadyInUse.

I don't understand how it worked for you. If possible, can you please
check if you have the same code-flow? My nova code is somewhat old (the
last commit was on Aug 8), but my contrail code is somewhat latest (Aug
28).

You can also check my patch https://review.opencontrail.org/#/c/2916/
which attempts to fix this bug.

Thank you,
Babu

On Thursday 18 September 2014 11:30 PM, Vedamurthy Joshi wrote:
> Babu,
> This is what i tried. But it seemed to get created fine. Am i missing anything ?
>
> neutron net-create test-net
> neutron subnet-create test-net 20.1.1.0/24
> nova boot --flavor 2 --image $image_id --nic net-id=4b6eab13-69f3-408e-8cfc-0a19802d9d92 test_vm1 ( creates 20.1.1.2)
> nova boot --flavor 2 --image $image_id --nic net-id=4b6eab13-69f3-408e-8cfc-0a19802d9d92,v4-fixed-ip=20.1.1.10 test_vm2
>
> root@nodec22:~# nova list |grep test-net
> | 01cfb703-0a8d-48b9-b797-02ff21c35149 | test_vm1 | ACTIVE | None | Running | test-net=20.1.1.2 |
> | 466fc134-bdf2-41c2-b782-90353e271be8 | test_vm2 | ACTIVE | None | Running | test-net=20.1.1.10 |
> root@nodec22:~#
>