Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The command to use is "dhclient -r"

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.