VlanManager: nova-network does not assign ip from project's network range

Asked by Giuseppe Civitella

Hi all,

I'm experiencing a problem with dhcp assigned ips in a vlan manager environment.
I'm testing a two node setup: both of them are ubuntu 11.04 running Diablo services.
Actual diablo milestone version is D4, but I found the problem on D3.
The first node runs as cloud controller and nova-network service, the second is a nova-compute node.
On my nova.conf I defined the fixed_range this way:

--fixed_range=10.12.0.0/16

On this node I created a first project and then a network with the following command:

root@nova-services2:~# nova-manage network create --label=gcivitella_proj_net --fixed_range_v4=10.12.2.0/24 --num_networks=1 --network_size=256 --vlan=12 --dns1=212.29.129.3 --dns2=212.29.129.2
root@nova-services2:~# nova-manage network list
network netmask start address DNS1 DNS2 VlanID project
10.12.2.0/24 255.255.255.0 10.12.2.3 None None 12 None

As soon as I deploy a vm with my project's credentials, in the nova database I can see:
mysql> select * from networks \G;
*************************** 1. row ***************************
         created_at: 2011-08-25 14:38:38
         updated_at: 2011-08-25 16:14:10
         deleted_at: NULL
         deleted: 0
          id: 8
          injected: 0
          cidr: 10.12.2.0/24
          netmask: 255.255.255.0
          bridge: br102
          gateway: 10.12.2.1
          broadcast: 10.12.2.255
          dns1: NULL
          vlan: 102
          vpn_public_address: 212.29.131.5
          vpn_public_port: 1000
          vpn_private_address: 10.12.2.2
         dhcp_start: 10.12.2.3
         project_id: gcivitella_proj
         host: nova-services2
         cidr_v6: NULL
         gateway_v6: NULL
         label: gcivitella_proj_net
         netmask_v6: NULL
         bridge_interface: eth0
         multi_host: 0
         dns2: NULL
         uuid: d1e1eb15-9392-4851-83fa-6528beb3fcc6

AFAIK this means that the network has been associated with the project without any further configuration. From now on the vms deployed by project's users should be linked to that project's network.
I would expect thath my first deployed vm woud get an ip between 10.12.2.3 and 10.12.2.255.
What really happens is that on both nodes vlans and bridges are created correctly. On nova-network node br102 gets 10.12.2.1 as ip (gateway's ip in this network sql record), but the vm gets as ip 10.12.1.5 and this makes it unreacheable.

In nova-network.log i can see:
2011-08-26 10:15:04,592 DEBUG nova.rpc [-] received {u'_context_request_id': u'1H687SBPN6FE9W766GBC', u'_context_read_deleted': False, u'args': {u'address': u'10.12.1.5'}, u'_context_is_admin': True, u'_context_timestamp': u'2011-08-26T08:15:04Z', u'_context_user': None,
 u'method': u'release_fixed_ip', u'_context_project': None, u'_context_remote_address': None} from (pid=21738) process_data /usr/lib/pymodules/python2.7/nova/rpc.py:202
2011-08-26 10:15:04,593 DEBUG nova.rpc [-] unpacked context: {'timestamp': u'2011-08-26T08:15:04Z', 'msg_id': None, 'remote_address': None, 'project': None, 'is_admin': True, 'user': None, 'request_id': u'1H687SBPN6FE9W766GBC', 'read_deleted': False} from (pid=21738) _un
pack_context /usr/lib/pymodules/python2.7/nova/rpc.py:451
2011-08-26 10:15:04,594 DEBUG nova.network.manager [1H687SBPN6FE9W766GBC None None] Released IP |10.12.1.5| from (pid=21738) release_fixed_ip /usr/lib/pymodules/python2.7/nova/network/manager.py:591
2011-08-26 10:15:04,732 WARNING nova.network.manager [1H687SBPN6FE9W766GBC None None] IP 10.12.1.5 released that was not leased

Dnsmasq gets started with the following command:

dnsmasq --strict-order --bind-interfaces --interface=br102 --conf-file= --domain=diablo.dev --pid-file=/var/lib/nova/networks/nova-br102.pid --listen-address=10.12.2.1 --except-interface=lo --dhcp-range=10.12.2.3,static,120s --dhcp-lease-max=256 --dhcp-hostsfile=/var/lib/nova/networks/nova-br102.conf --dhcp-script=/usr/bin/nova-dhcpbridge --leasefile-ro

in dhcp-hostsfile i get:

root@nova-services2:~# cat /var/lib/nova/networks/nova-br102.conf
02:16:3e:27:4a:48,server-32.diablo.dev,10.12.1.5

These are the networks that nova-manage shows:
root@nova-services2:~# nova-manage network list
id IPv4 IPv6 start address DNS1 DNS2 VlanID project uuid
8 10.12.2.0/24 None 10.12.2.3 None None 102 gcivitella_proj d1e1eb15-9392-4851-83fa-6528beb3fcc6
9 10.12.3.0/24 None 10.12.3.3 None None 103 None 90ac68c8-bff7-4919-9114-f7eec3b54e2a

Any suggestion to get over the problem?

Thanks
Giuseppe

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
Giuseppe Civitella
Solved:
Last query:
Last reply:
Revision history for this message
Giuseppe Civitella (gcivitella) said :
#1

I deleted and recreated the nova sql database. Now nova-network seems to assign ips from the right range.
The old database was created with a cactus version of nova-manage.
The fixed_ips table was showing a lot of records from previous tests. They were ips with timestamps for "created_at" end "updated_at" columns but not for the "deleted_at" one.
In "nova-manage network list" output those ips were not showing but nova-network was assigning some of them to the instances.
After upgrading from cactus to diablo D3 and D4 I executed a "nova db sync" thinking it was enough to upgrade the database's tables and records.
Probably I missed something.
I did not check yet the new setup with more tenants, so I'm not closing the question at the moment.

Revision history for this message
Giuseppe Civitella (gcivitella) said :
#2

Problem solved.