0

We have a subnet with a couple of hundred virtual machines that:

  1. boot up
  2. do some short heavy computational task and shut down.

The average life of a vm here is about 20 minutes.

It's critical that we make sure we never run out of dhcp leases, so in addition to adding a short lease duration I want to make dhclient release the address when the machine shuts down using the DHCP RELEASE packet.

Does anyone know how to do this?

1 Answers1

1

The command to use is "dhclient -r"

gac
  • 459
  • 2
  • 8
  • is it possible to do this in dhclient.conf or I must run this command on shutdown? – Liudmil Mitev Oct 13 '11 at 13:15
  • 1
    I think it's a "non-standard" feature of DHCP, as clients aren't generally required to release their addresses so I would imagine you'd need to find a way to run it on shutdown (probably a simple init script in /etc/rc0.d and /etc/rc6.d, for shutdown/reboot respectively?). Alternatively, have you thought about dropping your DHCP lease times on the VM network? DHCP traffic is very small, maybe by dropping your leasetime to 1 or 2 hours you would recycle addresses quickly enough and machines which live longer would just ask for the same address and be ACKnowledged for another period. – gac Oct 13 '11 at 15:18