IP's are recycled too quickly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
My automated tests frequently fail. It turns out that it's almost exclusively caused by dnsmasq refusing to hand out an IP to a guest, because an old instance from a previous test run still holds the lease.
Once a lease expires, dnsmasq calls the dhcpbridge which in turn calls the network worker and disassociates the IP. That's great.
However, the compute worker also disassociates the IP when terminating an instance. This is almost always premature, since it's quite unlikely that it will coincide exactly with the expiration of the lease, so the IP doesn't belong back in the pool of available IP's.
We have a couple of options:
1) Add a "disassociated_at" column to fixed_ips. That timestamp is set when the instance is terminated. When we grab an ip from the pool, it must have been disassociate at least 120s earlier (that's what we pass to dnsmasq as the lease time). We might want to call it "recycle_
2) Leave it dnsmasq to release the IPs. We might leak IP's this way if dnsmasq is closed uncleanly or similar, but it does ensure that dnsmasq is willing to dish out this IP if we ask it to. We can probably solve this by doing some cleanup at startup.
3) Other options
Nevertheless, leaving it exclusively to dnsmasq could cause leaks if dnsmasq gets shut down uncleanly.
There
Related branches
- Devin Carlen (community): Approve
- Vish Ishaya (community): Approve
- Jay Pipes (community): Approve
-
Diff: 10 lines (+1/-1)1 file modifiednova/db/sqlalchemy/api.py (+1/-1)
Changed in nova: | |
status: | New → Incomplete |
Changed in nova: | |
status: | Incomplete → Fix Committed |
Changed in nova: | |
milestone: | none → 2011.2 |
status: | Fix Committed → Fix Released |
I think there is an easy solution to this. If you are blowing the database away in between tests, kill the running dnsmasq instances as well. Leases don't get returned to the pool until they have been released by dnsmasq or the timeout hits on the network periodic callback. The release of the ip by the compute host does not return the ip to the pool (unless there is some sort of bug that has been recently added).
Vish
On Feb 7, 2011, at 5:55 AM, Soren Hansen wrote:
> Public bug reported: after"/ "keep_until" and adjust the semantics accordingly. /bugs.launchpad .net/bugs/ 714577
>
> My automated tests frequently fail. It turns out that it's almost
> exclusively caused by dnsmasq refusing to hand out an IP to a guest,
> because an old instance from a previous test run still holds the lease.
>
> Once a lease expires, dnsmasq calls the dhcpbridge which in turn calls
> the network worker and disassociates the IP. That's great.
>
> However, the compute worker also disassociates the IP when terminating
> an instance. This is almost always premature, since it's quite unlikely
> that it will coincide exactly with the expiration of the lease, so the
> IP doesn't belong back in the pool of available IP's.
>
> We have a couple of options:
>
> 1) Add a "disassociated_at" column to fixed_ips. That timestamp is set
> when the instance is terminated. When we grab an ip from the pool, it
> must have been disassociate at least 120s earlier (that's what we pass
> to dnsmasq as the lease time). We might want to call it
> "recycle_
>
> 2) Leave it dnsmasq to release the IPs. We might leak IP's this way if
> dnsmasq is closed uncleanly or similar, but it does ensure that dnsmasq
> is willing to dish out this IP if we ask it to. We can probably solve
> this by doing some cleanup at startup.
>
> 3) Other options
>
> Nevertheless, leaving it exclusively to dnsmasq could cause leaks if
> dnsmasq gets shut down uncleanly.
>
> There
>
> ** Affects: nova
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are a member of Nova Bug
> Team, which is subscribed to OpenStack Compute (nova).
> https:/
>
> Title:
> IP's are recycled too quickly
>
> Status in OpenStack Compute (Nova):
> New
>
> Bug description:
> My automated tests frequently fail. It turns out that it's almost
> exclusively caused by dnsmasq refusing to hand out an IP to a guest,
> because an old instance from a previous test run still holds the
> lease.
>
> Once a lease expires, dnsmasq calls the dhcpbridge which in turn calls
> the network worker and disassociates the IP. That's great.
>
> However, the compute worker also disassociates the IP when terminating
> an instance. This is almost always premature, since it's quite
> unlikely that it will coincide exactly with the expiration of the
> lease, so the IP doesn't belong back in the pool of available IP's.
>
> We have a couple of options:
>
> 1) Add a "disassociated_at" column to fixed_ips. That timestamp is set
> when the instance is terminated. When we grab an ip from the pool, it
> must have been disassociate at least 120s earlier (that's what we pass
> to dnsmasq...