ProvisioningServices

We are close to the New Year 2016 and I want to wish you all the best for 2016!
I’m already happy now, because I can publish some hours after the PVS 7.7 release from Citrix this Script:

Today Citrix released XenApp/XenDesktop 7.7 and Citrix Provisioning Services 7.7. There are a bunch of new features, but for me the most important thing, beside of the Win10 support, is…. drum roll ….
the new PVS PowerShell API. PoSh with PVS 7.6 and below was a pain … To know what else is new in PVS look here: PVS 7.7 New in this release

Now PVS comes with a real PoSh interface which gave more back than a bundle of strings. I had the chance to play around with PVS 7.7 Tech Preview and so here you have already the PVS HealthCheck Script for Version 7.7 in a complete new developed version:

If you have a feature request or a bug report please post it direct on GitHub.

This version doesn’t work with PVS 7.6 and below, if you have an older version than 7.7 take this script: Citrix PVS HealthCheck

Update 11.04.2016: Performance-Improvement, Change the order of the table, all the VDI status now at the end.Update 09.05.2016: Bugfix & Input from Jay, get CPU/Memory/Disk usage of PVS.Update 27.05.2016: Now my Script is on GitHub
I’m an absolute GitHub newbie … for this reason I leave it still also here as a download until I’m really comfortable with GitHub.

My Citrix PVS Health Check PowerShell Script was nominated into the final round (Top3) of the Citrix GeekOvation Award. This means I have to present my “geeky solution” on Citrix Synergy 2015 in Orlando on the SYN501 Geek Speak Tonight Session. To be honest to speak in front of so much people is a new thing for me … and it makes me “a bit” twitchy …

To be nominated for this Award was not just a big surprise for me, I see this also as a honor and glory for my work. I would say it’s not so a big thing this script and it isn’t rocket science.

At this place I want to say thank you to Jason Poyner who gave me the idea for such kind of Script with his XenApp6 HealthCheck and where I took some code lines for the HTML output. To Martin Hartmann who helped me by learning PowerShell and of course to Aaron Parker (http://stealthpuppy.com) who was the assigned CTP helping me polish off my presentation materials.

Update 14.5.2015:

I won – thank YOU

I won the competition and seems that I’m the not-yet-known Geek #1 this Year! Thanks you all! When I saw the work from to other two guys, I had the feeling to have no chance, not just because I’m the only not-native english speaker. David Ott with a great PowerShell script to modify the user profile and Shane O’Neil with the C-Sharp code to have a self healing VDI, GREAT!

Like already mentioned the idea about the health check with the HTML output comes from Jason Poyner. The main script with all the logics it’s from me. The hardest thing when you Script with PoSh on PVS that it doesn’t return proper PS Object, that mean’s you doing a lot of format-cut stuff to get what you want. If you want to know more about that read Paul’s blog section “PVS comes with a PowerShell add-in that is not an easy beast to tame.”

What’s next?

I’m currently working on a Script which shows PVS retries during a variable timeframe (day, week or month) and create a graphic output, in this way you can see at which time you maybe have a traffic jam on your network.

I also made a script to export/import target’s into PVS and another one for export and import in XenDesktop, if I have time I’ll polish and publish this here.

Problem: There is currently no free tool to check the health status of a Citrix Provisioning Services farm with all Citrix relevant parameters. There are monitoring tools which tell you if a server is up and running or if it’s not, but now tool who gives you a special overview for Citrix Provisioning Services according to how much targets on which server, how much communication retries on which target an so on.

Solution:
Since some year’s I’m using the XenApp Health Check from Jason Poyner (deptive.co.nz) to get daily a status of my environment(s). I really appreciate the work from Jason, if you don’t know it until now, you really need have a look on his blog and on the Script . The mentioned XenApp Farm Health Check Script gave me the inspiration to create a similar Health Check Script for my Citrix Provisioning Server farm. To be honest, and I’m happy that Jason doesn’t mind, that I have “recycled” some parts, or say the “framework” of his XenApp Farm Health Check script to build my Script.

The script I built can be scheduled with a Windows task which trigger a run once a day and send out a email with the attached HTML-Report:

I’ve written the Script to perform the checks in 3 Parts:

Target Devices:

Ping

Retry (Threshold configurable, default is 15)

PVS Disk (Value which I read from PVS farm with get-mcli)

PVS Disk (Value which is written in the personality.ini on the Target)

PVS disk version (V1.2)

The vDisk-Store *

PVS Server

WriteCache Size

* like you can read in my BlogPost “Achieve fastest Citrix Provisioning Target Device” I propose to have the vDisk Store local on each provisioning server. So I can check with that column if the Target is booting from the correct vDisk store. The Master Store is on CIFS and only used for updates of the Image.

vDisks:

Replication state (PVS don’t replicate anything – but can check if the vDisks on all servers are equal)

DeviceCount to see how many targets are currently reading from this Image

Load Balancing algorithm
(Green if Best Effort because I want to have subnet affinity – feel free to change for your need. I have two data centers with two separated subnet’s – so I can guarantee that each target stream from his own data centre as long the server is available. Just in case of an outage of all PVS server in one DC it fail over to the other DC )

WriteCache Type

Name & Date of the vDisk

PVS Servers:

Ping

Active

How many device are connected

Don’t forget to register the PVS SnapIn DLL e.g. with .Net Framework 2.0 with the command:

Update 12.11.14: Now in version 1.2 it’s possible to define the device collection which should be checked. An other additional feature is that the script shows the version of the vDisk.Update 15.08.15: Now in version 1.4 it’s possible to have more than just one vDisk store.Update 16.09.15: Now in version 1.5 the vDisk file name, it’s date and the count of the used disk will be showed.Update 14.10.15: Version 1.61 New feature, PVS Cache (on disk or Ram) will be reported. / 20.10.2015 1.62: fixed some bugs (see comments)

Citrix Provisioning Services is in my point of view an incomparable way to deliver a Software image to a system. It’s not a kind of an known enterprise software deployment, rather it’s a way to stream a virtual disk during runtime to hardware. Beside of PVS, the acronym of Provisioning Services.

This article doesn’t explain what’s PVS and how it works. It only shows my personal best practice to have the fastest PVS target device. It’s maybe not the only one and right solution to work with PVS, e.g. for VDI other approaches would match better. In the last couple of years I was working on multiple projects to introduce PVS OS streaming for XenApp servers on physical hardware or virtualized servers. The following instruction shows my way to deliver the fastest PVS Target for read-only XenApp servers, or in the XenApp replacement this role is Xen Desktop 7.x App Edition called .

In this article I only mention performance relevant topics, I will not talk about HA, continuous availability or about PXE, TFTP and so on.

#1. Reduce reads from disk, make use of Standby Memory for vDisks

The best way to increase performance is to reduce work, in this first step it’s to reduce the hard disk read by reading virtual hard disk files (VHD’s). This can be achieved by make use of the Windows disk cache, this approach is possible on physical PVS servers and as well on virtualized PVS servers on any hypervisor. Using the Windows disk cache means that files which are read from disk, are cached in Standby memory of the Server.
(If you are using XenServer as hypervisor have a look to the IntelliCache feature, http://blog.citrix24.com/how-does-intellicache-work. )

To make use of the file cache you need:

The vDisk on local drives, no CIFS share, no NFS share.

A plenty of memory to the PVS.

Having the vDisk’s on local disks is not the common way to work with PVS, keep in mind that you have to synchronize the files on all servers in PVS farm.

You can check if the file cache is used properly by having a look in the resource manager. If you have nearly no free memory and have a lot of use standby memory it’s a good sign:

To have a deep dive look in the cache use RamMap and keep an eye to File Summary:

#2. Use Target Device Write Cache on Ram

The second second way to increase performance is to use fastest possible storage, hard disk drives are quite fast today, solid state disks are faster but Ram is still the fastest memory. Because we need on the Target device only the Write Cache it doesn’t matter that the Ram is a transient memory.

When you working with Write Cache in the Target device Ram you must appreciate the dangers of it … If you are running out of WriteCache the Target Device, perhaps a XenApp server with 50 users on it, will reboot immediately .
(By the way … Citrix Provisioning Services 7.1 offers a great new feature, it’s the possibility to Cache to Ram with overflow to hard disk. Do not use it … it doesent work proper! Waiting for a hotfix.)

Plan the amount of real used Memory:Think how much of the Ram you will use for WriteCache, give as much as possible and consider the real memory usage of a fully loaded server. e.g. if you have a XenApp server as Target device with 16GB of Memory you can allocate 6GB for WriteCache and have still 10GB Memory for the XenApp servers. If you have special memory hungry application on the server you need maybe an other segmentation. It doesn’t exists a recipe, have a look on your currently productive servers about the used memory.

Reboot your Target device periodically to reset the used cache.

Reduce usage of Write Cache by redirecting as much as possible to an other disk drive, of course this is only possible if you still have a local disk attached to the Target Device.Good candidates to redirect are:

Printer Spooler

Pagefile

EventLog

EdgeSight database

Monitor your Write Cache, a way to do this is e.g. using this small Powershell script on the PVS server with a scheduled task:(If you have PVS 7.1 with the newest Hotfixes I recommend to use WriteCache on Ram with overflow to hard disk)

If you have different subnet’s, make use of subnet affinity in the load balancing configuration on the vDisk.

If you have one subnet over more data centres, create a store with the vDisk for each data centre and let only provide servers from the corresponding data centre this store. With this way you can still switch fast to a cross data centre configuration in a case of a PVS server outage in a data centre.

4#. Use all exiting best practice guides for tuning:
(for all what I’ve forget here … )