Local host cache, within XenApp and XenDesktop, utilizes a local DB to store configuration information. This local DB is continuously updated by the master SQL DB. When connectivity to the SQL DB fails, the controller automatically switches to the local DB. When the link to the SQL DB is restored, the controller automatically switches back.
Local host cache allows users to make new connections to published apps and desktops. However, local host cache can’t replace all functionality of the master SQL DB. For instance, power options (starting and stopping VMs) are not available. This can be a concern for implementations that rely on pooled desktops (desktop that is temporarily assigned to a user. When the session ends, the desktops is rebooted and is available for any other user).
The power options for a pooled desktop is the problem with local host cache. In the default behavior with local host cache, when a user logs off, the pooled desktop goes into maintenance mode. It is now unavailable for any other user.
If the outage only lasts a short amount of time, this isn’t much of a concern. But if the outage lasts hours, or an entire day, we could potentially run out of powered on VMs.
Now, because I said this is the default behavior it should make you believe that there is an alternative. And there is.
The differences are:
- Maintenance Mode: The VM does not go into maintenance mode
- Reboot: The VM is not rebooted
- Availability: The VM is immediately available for another user
- Tainted: The VM is tainted or dirty. The user does not get a clean machine, because that only happens with a reboot. There is the possibility that some data or configs were left behind from the previous user. Because of this, it is probably wise to not enable this for every desktop group, especially not for groups dealing with very sensitive data.
To enable this, we need to use PowerShell.
Set-BrokerSite -ReuseMachinesWithoutShutdownInOutageAllowed $true Set-BrokerDesktopGroup -Name "desktop_group_name" -ReuseMachinesWithoutShutdownInOutage $true
To make this work, you have to enable it in 2 places:
- The entire site. This is the Set-BrokerSite line
- The desktop group. This is the Set-BrokerDesktopGroup line. It uses the parameter ReuseMachinesWithoutShutdownInOutage, which is only used when in local host cache mode. It does not impact the ShutdownDesktopsAfterUse parameter.