Citrix XenDesktop Tips and Tricks

People are virtualizing these days, and I get the same question each time I do a presentation about XenDesktop, and that is almost every day.
How many Virtual Desktops can we put on each server? Well, to answer that question it depends on some key factors that include how much RAM and CPU does these servers have?

To ease some of the mind game you might have settled out to conquer , we here at Ervik.as wanted to make a short and Quick XenDesktop Planning Guide. So, lets digg right in to it!

Total RAM required:

Amount of RAM Needed = (Amount of RAM per desktop * Number of Desktops) + Hypervisor overhead

Total vCPUs required:

Number of Cores required = (Number of vCPUs per desktop * Number of Desktops) + 1 core for Hypervisor overhead

Please take a big note of that: The Servers that support virtualization have multiple cores, ex: 8 cores = 8 vCPUs.
I would also like to share some tips and tricks with you, learned down the road with implementations of XenDesktop and some useful links:

Some XenDesktop
considerations:
  • If VDAs are unable to register please check if Network Service has write access to Temp Directory

    For XP, the default dir would be
    “C:\Documents and Settings\NetworkService\Local Settings\Temp”, though note that the ‘NetworkService’    
    directory is hidden so it won’t show up in explorer.

    For Vista/Win7, the standard place would be    
    “C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp”

  • If Windows users suffer from extremely long logon times try to disable windows Theme/theme service on VDA
  • When you connect to your virtual desktop as a user and you get immediately disconnected but as an admin you can log on to the virtual desktop normally please check your eventlog isn’t corrupt (https://support.microsoft.com/kb/172156)
  • If you experience slow and laggy mouse, make sure in the virtual desktop theres no mouse scheme , animated mouse cursors ( i.e Aero) or mouse trail enabled
  • If you experience slow logins try to delete old NICs after P2V
  • If you experience problems and slow operations during login or with Client drivemapping make sure your VM is not named “Client” because XD/XA tries to map drives through \\client\d$ which can conflict (dependant on Providerorder in Registry)
  • On VDA check the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order – registry key

There are also some tuning that can be done on the XenServer side and Virtual Machines, here are some quick tips and tricks:

  • Check infrastructure with iPerf ( Network/TCP/IP) and CrystalDiskMark (Diskperformance)
  • Use NFS for management simplicity and the scalability of proper NFS servers.
  • Check load of Dom0 with Xentop when host is stressed ( check for Network and Disk I/O )
  • If Win7 or Win2K8R2 do not start, add for the VM or template „xe vm-param-set uuid=<VM UUID> platform:viridian=false“ ( only needed before XS 5.5 Upd1 )
  • Don’t forget to disable task offload in VMs.  Also if you could identify i.e. if the DDC is on the same XenServer as desktop VMs. By having the DDC on a different XenServer the task offloading is handled by the NIC. If the DDC and desktop VMs are on the same system the PVtools do not do task offloads https://support.citrix.com/article/ctx117374
  • Configure TCP/IP DisableTaskOffload for all W2K3(R2) and Windows XP machines which are hosted on XS 5.5, in XS 5.6 better throughput without DisableTaskOffload
  • Disable firewall service in VMs and bootscreen screensaver if allowed to achieve better network performance and less load of the hosts
  • Configure “no power saving” to avoid screensaver cpu-load
  • Configure “no defragging” , to let the physical machine take care of physical chores
  • Schedule antivirus scans, because it can be bad to have 50+ VMs in a SR doing intensive I/O at the same time

Some Provisioning Services considerations:

  • Use fixed VHDs, because internal structure of dynamic VHDs is different and can cause „alignment problems“ concerning disksubysystem (i.e. NetApp- Filer). There is a whitepaper created by NetApp covering alignment considerations. ( Same applies to Hyper-V VHDs )
  • For vDisks use RAID 5 ( read-intensive) , for WriteCache use RAID 1 / RAID10 (write-intensive) enable WriteBackCache /and ensure there is a BatteryBackupUnit for RAID Controller/ SAN Systems in place
  • TCP offloading
  • Set following Registry Keys in vDisk/ GoldenMaster:
    • HKLM\SYSTEM\CurrentControlSet\Services\BNNS\Parameters\- EnableOffload – value = 0 (DWORD)
    • Disables “Large Send Offload” for PVS driver – HKLM\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters\ – DisableTaskOffload – value=1 (DWORD)
    • Disables PV NIC (VIF) “TCP offload”
  • Run “chkdsk” before starting Xenconvert
  • Prior to putting vDisk into standard mode please flush the DNS Resolver Cache “ipconfig flushdns” and release DHCP address “ipconfig /release”
  • Use Sysinternals “sDelete –c driveletter:“ to zero out empty vDisk areas and reduce storage when creating golden master
  • Disable Windows Indexing Service and System Restore
  • Configure redirection of spooldirectory, viruspatterns, RADECache, EdgeSight DB, AppSense Profile, Databases, Eventlogs, Logfiles… to a persistent CacheDisk / CacheVolume if possible
  • Use HA-Setup for DHCP and TFTP Services
  • If you want to Loadbalance the TFTP service please check out this Citrix support article -> https://support.citrix.com/article/ctx116337

Good Links and references:

Citrix’s Daniel Fellers – Virtual Desktop Resource Allocation

Download the sizing spreadsheet here

Download Citrix XenServer here

Download Citrix XenDesktop here

Download Citrix Virtual Load Balancer & SSL VPN here

Optimizing Windows XP for XenDesktop

 

For more reference architecture whitepapers and guides please visit:

 

XenDesktop Modular Reference Architecture


Delivering 5000 Desktops with Citrix XenDesktop 4


XenServer Single Server Scalability with XenDesktop


XenDesktop Design Handbook


Designing Enterprise Solution for XD

 

Project VRC