Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I did that too, but thanks for reminder. So basically no garbage should be left in DB after cleaning tables networks and fixed_ips, right? Because newly created networks get id number, continued from id of just deleted networks. Not that this is a problem, but I thought it is strange.

Problems showed later. After deleting some networks I left only one network:

mysql> select * from networks; +---------------------+---------------------+------------+---------+----+----------+---------------+-----------------+--------+------------+------------+------+------+--------------------+-----------------+---------------------+------------+------------+-----------+---------+-----------+ | created_at | updated_at | deleted_at | deleted | id | injected | cidr | netmask | bridge | gateway | broadcast | dns | vlan | vpn_public_address | vpn_public_port | vpn_private_address | dhcp_start | project_id | host | cidr_v6 | ra_server | +---------------------+---------------------+------------+---------+----+----------+---------------+-----------------+--------+------------+------------+------+------+--------------------+-----------------+---------------------+------------+------------+-----------+---------+-----------+ | 2011-01-28 10:08:00 | 2011-01-28 10:12:43 | NULL | 0 | 1 | 0 | 10.0.0.0/27 | 255.255.255.224 | br100 | 10.0.0.1 | 10.0.0.31 | NULL | 100 | 172.16.120.229 | 1000 | 10.0.0.2 | 10.0.0.3 | xproj | ubuntu04a | NULL | NULL |

New networks were created with nova-manage network create 10.0.0.0/24 5 32 and in DB is:

| 2011-02-14 13:17:12 | NULL | NULL | 0 | 5 | 0 | 10.0.0.32/27 | 255.255.255.224 | br101 | 10.0.0.33 | 10.0.0.63 | NULL | 101 | NULL | 1001 | 10.0.0.34 | 10.0.0.35 | NULL | NULL | NULL | NULL | | 2011-02-14 13:17:12 | NULL | NULL | 0 | 4 | 0 | 10.0.0.0/27 | 255.255.255.224 | br100 | 10.0.0.1 | 10.0.0.31 | NULL | 100 | NULL | 1000 | 10.0.0.2 | 10.0.0.3 | NULL | NULL | NULL | NULL | | 2011-02-14 13:17:12 | NULL | NULL | 0 | 6 | 0 | 10.0.0.64/27 | 255.255.255.224 | br102 | 10.0.0.65 | 10.0.0.95 | NULL | 102 | NULL | 1002 | 10.0.0.66 | 10.0.0.67 | NULL | NULL | NULL | NULL | | 2011-02-14 13:17:12 | NULL | NULL | 0 | 7 | 0 | 10.0.0.96/27 | 255.255.255.224 | br103 | 10.0.0.97 | 10.0.0.127 | NULL | 103 | NULL | 1003 | 10.0.0.98 | 10.0.0.99 | NULL | NULL | NULL | NULL | | 2011-02-14 13:17:12 | NULL | NULL | 0 | 8 | 0 | 10.0.0.128/27 | 255.255.255.224 | br104 | 10.0.0.129 | 10.0.0.159 | NULL | 104 | NULL | 1004 | 10.0.0.130 | 10.0.0.131 | NULL | NULL | NULL | NULL |

First new network has id 4, its IP subnet and bridge overlap with old network with id=1. I'm not sure if this should is a bug or a not-yet-implemented thing. I just removed network with id=4 and corresponding entries in fixed_ips table.

Well, after adding new project, VM instances got IPs from let say 10.0.0.32/27 subnet. But first instance received 10.0.0.63, which is a broadcast address. Looking at DB again:

mysql> select id, address, network_id, instance_id, allocated, leased, reserved from fixed_ips where (network_id=1 OR network_id=10); +-----+-----------+------------+-------------+-----------+--------+----------+ | id | address | network_id | instance_id | allocated | leased | reserved | +-----+-----------+------------+-------------+-----------+--------+----------+ | 1 | 10.0.0.0 | 1 | NULL | 0 | 0 | 1 | | 2 | 10.0.0.1 | 1 | NULL | 0 | 0 | 1 | | 3 | 10.0.0.2 | 1 | NULL | 0 | 0 | 1 | | 4 | 10.0.0.3 | 1 | 153 | 1 | 1 | 0 | | 5 | 10.0.0.4 | 1 | NULL | 0 | 0 | 0 | ... | 512 | 10.0.0.63 | 10 | NULL | 0 | 0 | 0 | | 511 | 10.0.0.62 | 10 | NULL | 0 | 0 | 0 | .. | 484 | 10.0.0.35 | 10 | NULL | 0 | 0 | 0 | | 483 | 10.0.0.34 | 10 | NULL | 0 | 0 | 1 | | 482 | 10.0.0.33 | 10 | NULL | 0 | 0 | 1 | | 481 | 10.0.0.32 | 10 | NULL | 0 | 0 | 1 |

Seems like that un-ordered order of fixed_ips is important, as 10.0.0.63 was used as first address leased by dnsmasq. I tried to set reserved to 1 for all broadcast addresses, and it seems to work.

Two questions now. 1. What would be correct way of adding new networks? "nova-manage network create 10.0.0.0/24 5 32" required some manual cleaning in DB. 2. Is setting reserved flag in fixed_ips OK? If so, shouldn't it be done by nova?

Regards, Justin