Horizon View Desktops going offline

So I ran into an issue a while ago with my Horizon View non-persistant desktops.

The issue was that they kept losing their DHCP lease and through the vCenter console you could see that they had APIPA addresses.

In this environment we have a lot of churn in the VDI environment.  People will logon to a terminal print something out and then logoff.

Because of this we have 30 minute DHCP lease times in a /23 subnet.

This is specific to windows 7 and is not affected in windows 8.1 or windows 10.

The problem is with time sync and the way the windows 7 DHCP client calculates it’s lease time.

When windows 7 boots it follows the normal DHCP RFC for acquiring a lease.  Once it has its address the windows 7 time service will pull its time from the domain, if time goes back on the client “which you can see in the windows system logs” the client will never attempt to renew it’s address because it is using time and not a countdown to calculate the lease time for when it should request a renewal.

https://www.ietf.org/rfc/rfc2131.txt

To fix this disable the windows time service in the gold image and set the desktop to sync time with host.  Obviously you need to make sure your hosts have correct time set through NTP and that the service on the ESXi hosts is started.

If the time is off on the hosts and the service is started and ntp is configured it will show red and not correct itself, you will need to manually adjust time on the host until it is within 5 minutes of the NTP server.

2017-02-21-15_42_26-10.100.10.91-vSphere-Client

Once complete recompose the pool and the issue should be gone.

However another way this type of issue can present itself is during daylight saving time.  If your DHCP lease is less that 60 minutes you will see something similar to this.

To prevent that from happening boot up your gold image after daylight savings time has occurred, let it pull time. Shutdown and then recompose your pool.

Fortunately that only occurs twice a year and again only presents itself in windows 7