Start a Conversation

Unsolved

This post is more than 5 years old

169243

March 8th, 2016 12:00

Is there any way to force pool VMs to release their IP address before deletion?

Our installation deletes the VMs when a user logs out and deploys a new one in its place.  That makes sure that every user gets a clean installation.  It also means we have substantial churn in the DHCP scope for that subnet.  It would make life easier if I could figure out how to release the IP when the machine gets removed.  I tried adding a shutdown task to the mix to do an ipconfig /release but that didn't seem to work.  Any ideas on why or alternatives?  I've shortened the lease times in that scope so the unused addresses get recycled, but making them too short winds up creating DNS issues.  The release should actually help in both areas.

March 10th, 2016 01:00

Hi Dragonator,

Are you using VMware or HyperV?

Thanks, Andrew.

8 Posts

March 10th, 2016 04:00

We're using VMware.

March 10th, 2016 06:00

Hey Dragonator, 

I haven't tested it. All I can find is it existed in 95, 98, XP and Windows 2000 but not NT4. 

Then talk about it seemed to dry up. 

Hilbert, tick here and we'll take care of your HyperV Mac Addresses for any VMs we create so not to cause a DHCP storm

Thanks, Andrew

8 Posts

March 10th, 2016 06:00

I can test it to see what happens, it'll just take a bit for the change to propagate.  I'd love to have that MAC control for VMware.  We have a pool of 100 machines that gets deleted and recreated several times a day.  Some of them live all day, some only hang around a few minutes.  That would make life easier on multiple levels.

Add my name to the "gotta have it" list for that one. :)

March 10th, 2016 06:00

Hello,

That's a shame as we're great at managing HyperV IPs - it's just a tick box. 


With VMware, The IP management is still a pending feature request. 

However, this could work for you:

http://windowsitpro.com/networking/do-windows-2000-or-later-dhcp-clients-renew-their-existing-lease-restart

Thanks, Andrew

8 Posts

March 10th, 2016 06:00

I think I may have found the issue.  Actually not an issue so much as a misleading status report.  When DHCP leases expire, the server doesn't immediately kill them, it puts them in grace mode, just in case.  By default that's 4 hours, and then once an hour, it does a cleanup to reclaim IPs.  Since this pool is very dynamic it pretty much always stays at / near full use because those IPs hang around.  I found an article on how to reduce that grace period and I've set it to 30 minutes.  Situation is much better, but used IP count is still much higher than machines in the pool.  It's now running at 20-30% above whereas it was running around 50% before.  I checked out the article.  Looks like it's pretty much related to what I'm doing now, but I wasn't aware of the client side.  Does that apply to Win7? 

17 Posts

March 10th, 2016 06:00

Hi Andrew,


Which tick box is that in Hyper-V?


Thanks,
Hilbert

8 Posts

March 10th, 2016 07:00

I just did a quick test adding that control to the client side.  No real help.  The DHCP server still shows that IP in use, and in fact I'm seeing multiple IPs reported as the same machine name because they get recreated.  The MAC is different, but same computer name.  Even when I went in and manually released the IP address from the client side the server retains it until the lease expires, and presumably plus the grace period, etc.

8 Posts

March 10th, 2016 08:00

We'd actually looked at that at some point for other reasons.  We discounted it because it essentially means we have all our machines up and running even when we only need 10% of them.  Similar issue when we looked at doing reprovision instead of delete.  It sounds like it might be worth revisiting, particularly since we've done lots of stuff related to storage since then so the additional I/O benefit may make the extra machines a worthwhile tradeoff.  Is there a way to automatically downsize the pool based on idle machines?  We currently do autosizing on the pool and that's one of the reasons we delete them now.

March 10th, 2016 08:00

Ok, so lets take another approach.


There is a cool VMware feature that vWorkspace can leverage. This will save you loads of I/O as well as sort out your mac address issue. 

What you do is

1. When you create a new machine, set the Configure Hardware | Reconfigure Virtual Disks

Set first disk only to Independent | Non Persistent

2. Then, on the Computer Group settings, set the logoff action to "Reset" 

This will give you a freshly provisioned machine within a minute or so of logging out without the I/O or Mac address storm. 

Thanks, Andrew.

No Events found!

Top