• Category Archives Provisioning Server
  • Varrow Madness Part 2: Citrix Provisioning Server Implementation and Best Practices

    My session at Varrow Madness covered Citrix Provisioning Services (PVS) Implementation and Best Practices. I have always been a big fan of this product even before Citrix purchased Ardence which would become Provisioning Services. The ability to stream the server OS over the network and the flexibility that this product gives you is amazing. Even smaller environments can benefit from the advantages of Provisioning Services.

    My session summarized many of the guides, Citrix articles as well as my own personal experiences with Citrix PVS over the years. I will also include the resources at the end of this post. I personally have installed, managed and configured PVS in environments ranging from a handful of servers up to 10000+ desktops with multiple sites including DR environments.


    While I have been in IT for many years and spoken in many difference situations from board rooms to conference rooms with co-workers and executives, there is something different about public speaking.Varrow Madness was a first for me in more than one way, not just my first Madness but it was also my first professional speaking role.

    I have prepared for public speaking over the years in many ways. I knew this was something I always wanted to tackle as I have considered submitting for sessions at various technical conferences. At a previous company I got involved in the public speaking organization Toastmasters which really helped me prepare for this moment. I can’t say I was completely prepared for this but I think it went well. The session ended on time but the questions continued right into the next session 🙂 Which I thought was awesome.

    I highly encourage anyone to take a chance and give public speaking or something that scares you a chance. Fear is OK, letting it control you is not.

    “Do one thing every day that scares you” – Eleanor Roosevelt

    Citrix PVS Resources

    I plan to do more posts around Provisioning Services and a few instructional videos as well. As always I welcome any questions and comments that you have below regarding this or any topic.  

  • Tool: Citrix PVSDataTools 1.2.2

    Citrix announced the release of a tool from the Citrix Provisioning Server Escalation team, Citrix PVSDataTools 1.2.2 This looks like it may be another solid tool for assistance with Citrix PVS troubleshooting. There are two tools included in this set. One to gather the data and one to analyze the results.

    • PVSDataCollector 
    • PVSDataParser

    The PVSDataCollector collects the following information from the PVS Server:

    • System Information
    • Windows Event Logs
    • TCP and UDP Port Information
    • PVS Logs (Entire Directory)
    • PVS Configuration Files
    • PVS Data (that is farm, server, collection, device, disk, site and store information)

    The PVSDataParser is used to view the following data collected from the PVSDataCollector:

    • System Information
    • TCP and UDP Port Information
    • PVS Logs
    • Basic PVS Overview

    The PVSDataParser does not parse Windows Event Logs and dump files. Manual parsing is required for data of this type.


  • XenServer 6.1 Hotfixes w/ PVS and Guest Blue Screen fixes

    Recently I blogged about the XenServer 6.1 issues that Citrix announced here for customers facing blue screens and other issues such as

    • Add PVS support in XS 6.1
    • Resolve intermittent grey screen on Windows Server 2003
    • Resolve intermittent blue screen on VM migration
    • Resolve intermittent blue screen after attempting VM shutdown
    • Reinstate support for VSS shadow copy services

    Citrix has announced two hotfixes that should resolve these issues that should be applied in order to resolve the above issues.

    Hotfix XS61E009 – For XenServer 6.1.0 

    This is a hotfix for customers running XenServer 6.1.0. This is the first part of a two component fix, customers should install CTX136253 – Hotfix XS61E010 – For XenServer 6.1.0 after installing this hotfix.

    Issues Resolved In This Hotfix

    1. Virtual Machines (VMs) with out of date XenServer Tools, may not be flagged as “out of date” in XenCenter. This hotfix resolves this issue and enables customers to be notified in XenCenter when new XenServer Tools are available.
    2. Booting a Citrix Provisioning Services (PVS) target device using a Boot Device Manager (BDM) image can take an extended time to complete. This hotfix resolves this issue.

    Hotfix XS61E010 – For XenServer 6.1.0 

    This is a hotfix for customers running XenServer 6.1.0. This is the second part of a two component fix, customers must install CTX136252 – Hotfix XS61E009 – For XenServer 6.1.0 before attempting to apply this hotfix.

    • Before installing this hotfix, customers who have previously referred to CTX135099 – XenServer Tools Workarounds for XenServer 6.1.0 for workaround instructions should review it again as it contains updated content.
    • After applying this hotfix, customers should upgrade the XenServer Tools in each Windows Virtual Machine (VM). See the section, Upgrading XenServer Tools in VMs later in this article.
    • Customers should upgrade the XenServer Tools before configuring the network settings on VMs.

    Issues Resolved In This Hotfix

    This hotfix resolves the following issues:

    1. Customers using XenServer Platinum Edition to license Citrix Provisioning Services (PVS) may find that one PVS license per VM is checked out, rather than one PVS license per XenServer host. This may lead to a shortage of PVS licenses and an inability to provision VMs. Installing this hotfix along with CTX135672 – Hotfix CPVS61016 (Version 6.1.16) – For Citrix Provisioning Services 6.1 – English resolves this issue.
    2. Attempts to shut down Microsoft Windows Vista and later VMs can cause intermittent blue screen errors, with a "STOP: 0x0000009f..." error message.
    3. Adding more than eight NICs to Microsoft Windows Vista and later VMs, using the xe CLI can lead to a blue screen error on reboot.
    4. Copying data to a Microsoft Windows 2003 VM can cause the VMs to hang and lead to a grey screen error.
    5. When Dynamic Memory Control (DMC) is enabled, attempts to migrate Microsoft Windows XP and later VMs using XenMotion can cause the VMs to hang and lead to blue screen error.
    6. When the Citrix Xen Guest Agent service is running, Cut and Paste will not work between a XenDesktop virtual desktop and the endpoint device.
    7. Microsoft Windows XP and later VMs may hang during the boot process and may have to be forced to reboot.
    8. Attempting to install or upgrade the XenServer Tools on Microsoft Windows Vista and later VMs, which do not have access to a paravirtualized or an emulated network device can cause the installation process to hang.
    9. Manually installing the Legacy XenServer Tools without changing the device_id to 0001 can result in a "STOP: 0x0000007B..." error when rebooting a Windows VM. After installing this hotfix, customers will not be able to manually install the Legacy XenServer Tools by running xenlegacy.exe. When customers start the XenServer Tools installation process, the installwizard.msi will be launched automatically.
    10. Microsoft Volume Shadow Copy Services (VSS) (required for third party backup solutions) was unavailable on Microsoft Windows Server 2008 in the original version of XenServer 6.1.0. After installing this hotfix, XenServer 6.1.0 customers will be able to take quiesced snapshots on Microsoft Windows Server 2003 and Windows Server 2008 VMs. Note VSS is not supported for Windows Server 2008 R2.

    In addition, this hotfix also contains several usability and performance improvements

  • XenServer Guest VM time issue

    Today I was working on an issue where a new XenDesktop Desktop Group was built and the time on all VMs provisioned was off by five hours. This led to the Desktop guest VMs not being able to talk on the domain and coming up as “Unregistered”.

    Anyone that’s worked in this industry long enough knows that Windows is very sensitive to time, the time of a Windows machine cannot be off by more than five minutes.

    From Microsoft Technet regarding time

    The Desktop Group was provisioned on XenServer using Provisioning Services So I checked all the usual culprits and found no issues so I had to dig further

    • XenServer time configuration
    • Domain Controller configuration
    • Infoblox 

    As this issue was only happening to newly provisioned desktops and no other server on the domain.A work-around was found that by changing the VM time for every VM while in standard mode after they were provisioned they would keep the correct time.

    For those of you out there running Provisioning Services, you understand that Standard mode changes do not persist by reboot so this defies a bit of logic and led me to dig deeper down in the XenServer VM XenTools time sync.

    XenServer has a parameter set per VM, timeoffset configured per VM

    For Windows guests, time is initially driven from the control domain clock, and is updated during VM lifecycle operations such as suspend, reboot and so on. Citrix highly recommends running a reliable NTP service in the control domain and all Windows VMs.
    So if you manually set a VM to be 2 hours ahead of the control domain (for example, using a time-zone offset within the VM), then it will persist. If you subsequently change the control domain time (either manually or if it is automatically corrected by NTP), the VM will shift accordingly but maintain the 2 hour offset. Note that changing the control domain time-zone does not affect VM time-zones or offset. It is only the hardware clock setting which is used by XenServer to synchronize the guests.
    When performing suspend/resume operations or live relocation using XenMotion, it is important to have up-to-date XenServer Tools installed, as they notify the Windows kernel that a time synchronization is required after resuming (potentially on a different physical host).

    To check the offset of the VM, you can run the following command from the XenServer command line.

    • xe vm-list name-label=vmName params=name-label,platform

     Example Output

    [root@xenhost01 ~]# xe vm-list name-label=vmTest-001 params=name-label,platform
    name-label ( RW)    : vmTest-001
          platform (MRW): timeoffset: -18004; nx: false; acpi: true; apic: true; pae: true; viridian: true

    [root@xenhost02 ~]# xe vm-list name-label=vmTest-002 params=name-label,platform
    name-label ( RW)    : vmTest-002
          platform (MRW): timeoffset: -2; nx: false; acpi: true; apic: true; pae: true; viridian: true

    Note the timeoffset of -18004 on vmTest-001 and -2 on vmTest-002. This value is listed in seconds so that is a five hour time difference (the difference we were seeing on boot of the VM). This is no coincidence.


    • In our case it was to build a new Template VM and ensure the timeoffset was set correctly
    • You can also do this on a case by case basis per VM by running the following command and substituting vm-uuid for the VM that would like to update.
      • xe-param-set platform:timeoffset=<value-in-seconds> uuid=<vm-uuid>

  • Shrink VHD with PowerShell

    Recently I posted directions on how to manually compact VHD files in Windows 2008 R2 here. In coordination with a fellow Engineer David Ott we have now completed a Powershell Script that will handle this for you automatically. Depending on how you set your parameters this script can even be run as a scheduled task.

    I have created two versions of the script, one for Citrix Provisioning Server (PVS) environments and one for running against specified folders.

    Download the script for

    Update – After further testing, I have encountered an issue once while running the script on actively streamed target devices. A reboot resolved the issue. As such I will be making modifications to the script soon.

    In limited testing this script has been run on VHDs in both standard and private mode with devices streamed from Citrix Provisioning Server with no apperant impact. I have also run IOmeter while shrinking the vDisk and there was no difference in IOmeter results while disks were compacting vs disks that were not. I also performed some End User Experience testing for latency and found no impact to actively streamed devices.

    I still cannot recommend running the script in a production environment on actively streamed devices without substantial testing in your environment, as always with any script, test test and test some more and decide on how the impact to your environment.

    Reasons for the script

    Dynamic Virtual Hard Disks (VHDs) can grow to a maximum size to accommodate data as required. As data is added to the VHD, the VHD file size grows. When data is deleted from the VHD, the VHD size does not decrease. The VHD size remains at the largest amount of data stored within the VHD. Compacting a VHD reduces the VHD file size to match the amount of data stored within the VHD, therefore accurately representing the true amount of data within the VHD.

    • Optimize dynamic VHD file sizes to only use what you actually need as deleted files are not cleared from the VHD even though Storage grows on trees
    • Reduce Boot times, smaller VHD files boot faster  

    The script as written below will do the following.

    1. Add Citrix PVS Powershell Snap In
    2. Create Function to store PVS data in an object, special thanks to @CarlWebster on his PVS Documentation post that detailed how to gather and use this information
    3. Variables for PVS function to gather Store Data *** In Non_PVS script, step 1/2 are commented out
    4. Options to hard code a path in script or prompt the user to enter a path
    5. The next part will find the next available drive letter on the system and use that for the script, options are there to manually set or prompt the user as well
    6. Here is where the fun starts and begins to run DiskPart with gathered information. The process below will loop through all VHD files located in $path
      1. Attach VHD
      2. Assign $letter to attached VHD on partition 1
      3. Defragment the drive
      4. Detach VHD
      5. Attach Disk read only
      6. Compact the VHD
      7. Detach VHD

    The Script

    # Shink VHD Files
    # This script is designed to shrink Dynamic VHD files used by products such as Citrix Provisioning Server
    # XenApp_Wizard_v1.ps1 script written by Phillip Jones and David Ott
    # Version 1.0
    # This script is provided as-is, no warrenty is provided or implied.
    # The author is NOT responsible for any damages or data loss that may occur
    # through the use of this script.  Always test, test, test before
    # rolling anything into a production environment.
    # This script is free to use for both personal and business use, however,
    # it may not be sold or included as part of a package that is for sale.
    # A Service Provider may include this script as part of their service
    # offering/best practices provided they only charge for their time
    # to implement and support.
    # For distribution and updates go to: http://www.www.p2vme.com

    # Please uncomment this entire section if using Citrix Provisioning Services to detect and use store path

    Add-PSSnapin mclipssnapin
    Function BuildPVSObject
        Param( [string]$MCLIGetWhat = ”, [string]$MCLIGetParameters = ”, [string]$TextForErrorMsg = ” )


        If($MCLIGetParameters -ne ”)
            $MCLIGetResult = Mcli-Get “$($MCLIGetWhat)” -p “$($MCLIGetParameters)”
            $MCLIGetResult = Mcli-Get “$($MCLIGetWhat)”
        If( $error.Count -eq 0 )
            $PluralObject = @()
            $SingleObject = $null
            foreach( $record in $MCLIGetResult )
                If($record.length -gt 5 -and $record.substring(0,6) -eq “Record”)
                    If($SingleObject -ne $null)
                        $PluralObject += $SingleObject
                    $SingleObject = new-object System.Object

                $index = $record.IndexOf( ‘:’ )
                if( $index –gt 0 )
                    $property = $record.SubString( 0, $index  )
                    $value    = $record.SubString( $index + 2 )
                    If($property -ne “Executing”)
                        Add-Member –inputObject $SingleObject –MemberType NoteProperty –Name $property –Value $value
            $PluralObject += $SingleObject
            Return $PluralObject
            line 0 “$($TextForErrorMsg) could not be retrieved”
            line 0 “Error returned is ” $error[0].FullyQualifiedErrorId.Split(‘,’)[0].Trim()
     $GetWhat = “store”
     $GetParam = “”
     $ErrorTxt = “Store Information”
     $Store = BuildPVSObject $GetWhat $GetParam $ErrorTxt
     # Path to VHD files is hard coded below
     $path = $store.path

    # Hard coded path *** Please edit and uncomment line below to set hard coded path, ex. if you want to schedule task
    # $path = “c:”

    # Please uncomment line below if you would like for the script to ask you which drive you want to use.
    # $path = Read-Host “Please enter where your VHD ‘Virtual Hard Drives’ are stored”

    # Hard coded letter *** please edit and uncomment line below if you would like to use a hard coded path
    # $letter = Read-Host “Please enter an available drive letter, format ex c: or d: not c:”

    # The lines below will detect the next legal available drive letter and choose the next available letter 
    $letter = [char[]]”DEFGJKLMNOPQRTUVWXY” | ?{!(gdr $_ -ea ‘SilentlyContinue’)} | select -f 1
    $letter = $letter + “:”

    # This is where the script will collect all vhd files in the specified folder and compact them
    $Dir = get-childitem $Path -include *.vhd -name

    foreach ($name in $dir) {
    $vdiskpath = $path + “” + $name
    $script1 = “select vdisk file=`”$vdiskpath`”`r`nattach vdisk”
    $script2 = “select vdisk file=`”$vdiskpath`”`r`nselect part 1`”`r`nassign letter=$letter”
    $script3 = “select vdisk file=`”$vdiskpath`”`r`ndetach vdisk”
    $script4 = “select vdisk file=`”$vdiskpath`”`r`nattach vdisk readonly`”`r`ncompact vdisk”
    $script1 | diskpart
    start-sleep -s 5
    $script2 | diskpart
    cmd /c defrag $letter /U
    $script3 | diskpart
    $script4 | diskpart
    $script3 | diskpart

    In the screenshot you will see two VHD files located in a PVS store. Both are the same size on disk currently, one has had some files deleted by mounting the VHD manually and the space is not cleared from the VHD yet…

    The below screenshot is after the script is completed and the VHD has been compacted.

    Hope you enjoy and find this script useful, if you have suggestions, comments or issues or anything, leave me a comment below or find me on twitter at @P2Vme

  • Powershell XenApp Deployment Wizard v1

    Ever wanted an easier way to deploy XenApp machines en mass? Well have I got a treat for you.

    XenDesktop has an easy way to deploy virtual machines from Citrix Provisioning Server (PVS) but XenApp with PVS is missing this component making deploying virtual machines sometimes a very tedious task. I want to make that easier for myself, I mean the community :). I have began working on a script with another engineer and friend that should ease that pain. This script is only a v1 with future versions to support other hypervisors and remove some of the manual ad nauseum type work on large deployments.

    Currently the script is designed to do the following.


    1. You will need to create two files currently placed in the root of C: (paths and files can be changed) 
      1. One file will contain a list of servers (servers.txt) and the other the list of ip addresses (ips.txt) Match up the lines in each file so the server and IP match up.
    2. You will need to run this script from the Provisioning Server
    3. Download and configure the Following Powershell Snap Ins
      1. XenServer Powershell Snap-IN
        1. Download XS-PS Windows installer
      2. Configure the PVS Powershell MCLI snap in
        1. The snapin comes with the Provisioning Services Console. To use the snapin, you have to first register it (requires .Net framework). If your Windows is 32bits, use this command: 
          1. “C:WindowsMicrosoft.NETFrameworkv2.0.50727installutil.exe” “C:Program FilesCitrixProvisioning Services ConsoleMcliPSSnapIn.dll” 
        2. For 64bits: “C:WindowsMicrosoft.NETFramework64v2.0.50727installutil.exe” “C:Program FilesCitrixProvisioning Services ConsoleMcliPSSnapIn.dll” 
        3. If you encountered error, make sure that you are running the Command Prompt as administrator. 
        4. Once registered, start a PowerShell console and add the snapin using “add-PSSnapIn mclipssnapin”. The main cmdlets are mcli-run, mcli-get, mcli-set and mcli-delete. To get a detailed help on the cmdlets, use mcli-help.

    Once you have completed the prerequisites you can run the script. The script is currently designed to do the following.

    1. Enter variables needed for script to run and confirm settings
    2. Create XenServer VMs based upon servers identified in c:servers.txt from template
    3. Create c:macs.txt listing all Mac addresses for each XenServer VM created from servers.txt
    4. Add IP MAC Reservations to primary Microsoft DHCP Server
    5. Add Devices to Citrix PVS server in appropriate collection and Site
    6. Export IP Mac Reservations from primary Microsoft DHCP server to Secondary DHCP server

    As this script is a v1 it is making a lot of assumptions and I plan on building more logic and support for various configurations into the script. If you have any ideas or suggestions, please leave me a comment or contact me.

    Upcoming Features

    • VMware Support

    # XenApp PVS Deployment Wizard
    # This script is designed to help deploy XenApp machines en masse to a XenApp Farm using XenServer and Microsoft DHCP
    # XenApp_Wizard_v1.ps1 script written by Phillip Jones and David Ott
    # Version 1.0
    # This script is provided as-is, no warrenty is provided or implied.
    # The author is NOT responsible for any damages or data loss that may occur
    # through the use of this script.  Always test, test, test before
    # rolling anything into a production environment.
    # This script is free to use for both personal and business use, however,
    # it may not be sold or included as part of a package that is for sale.
    # A Service Provider may include this script as part of their service
    # offering/best practices provided they only charge for their time
    # to implement and support.
    # For distribution and updates go to: http://www.wwwp2vme.com

    add-pssnapin xenserverpssnapin
    add-pssnapin mclipssnapin

    # Variables Section – This will define the variables that the script requires in order to create the VMs in DHCP, PVS and XenServer

    $sitename = Read-Host “Enter the PVS Site Name.”
    $collectionname = Read-Host “Enter the PVS collection name.”
    $xenserver = Read-Host “Enter the XenServer host name to connect to.”
    $XSBase = Read-Host “Enter the base VM to copy. (Case Sensitive!)”
    $SR = Read-Host “Enter the storage repository name. (Case Sensitive!)”
    $pdhcpip = Read-Host “Enter the IP address of the primary DHCP server.”
    $sdhcpip = Read-Host “Enter the IP address of the secondary DHCP server.”
    $pdhcpscope = Read-Host “Enter the DHCP scope (ie:10.xxx.xxx.0).”

    ” “
    “Please confirm before continuing.”
    ” “

    “PVS Site Name: “+$sitename
    “PVS Collection Name: “+$collectionname
    “XenServer: “+$xenserver
    “Base VM: “+$XSBase
    “Storage Repository: “+$SR
    “Primary DHCP IP: “+$pdhcpip
    “Secondary DHCP IP: “+$sdhcpip
    “DHCP Scope: “+$pdhcpscope

    $n = ([System.Management.Automation.Host.ChoiceDescription]”&No”)
    $n.helpmessage = “No, exit script”
    $Y = ([System.Management.Automation.Host.ChoiceDescription]”&Yes”)
    $y.helpmessage = “Yes, continue script”
    $YN= ($Y,$N)

    Function Prompt-YesNo ($Caption = “Confirm”, $Message = “Do you want to continue?”,$choices = $YN)

    $answer = Prompt-YesNo
        if ($answer -eq 0) {“Continue”} else {Exit}
            Connect-XenServer -server $xenserver
            cmd /c if not exist c:csv md c:csv
        if (Test-Path c:macs.txt) {remove-item c:macs.txt}
            $vmnames = get-content c:servers.txt
            $ips = get-content c:ips.txt
            Remove-Item c:csv*.*

    # Xenserver – create VMs then pull MAC addresses for each and append c:MACs.txt

    foreach ($vmname in $vmnames)
        Invoke-Xenserver:VM.Copy -VM $XSBase -NewName $vmname -SR $SR
            $vifs = Get-XenServer:VM.VIFs -VM $vmname
            $vmname | Out-File c:CSVVMs.csv -append -Encoding ASCII
            $vifs.mac | Out-File c:MACs.txt -append -Encoding ASCII

    # MAC Translations – Required for DHCP and PVS as MAC formats are different for each program
    # PVS MAC MCLI input format
    Get-Content c:MACs.txt | ForEach-Object { $_ -replace “:”, “-” } | Set-Content c:csvMDevice.csv

    # DHCP MAC input format
    Get-Content c:MACs.txt | ForEach-Object { $_ -replace “:”, “” } | Set-Content c:csvMDHCP.csv

    # Obtain IP addresses from ips.txt file
    Get-Content c:ips.txt | Set-Content c:csvips.csv
        $num = 0
        $items = get-content c:csvvms.csv

    # DHCP and Citrix PVS
    foreach ($item in $items)
            $server = get-content C:csvVMs.csv | Select-Object -Index $num
            $mdhcp = get-content C:csvMDHCP.csv | Select-Object -Index $num
            $ip = Get-Content C:csvips.csv | Select-Object -Index $num
            $mdevice = Get-Content C:csvMDevice.csv | Select-Object -Index $num
            “Dhcp Server \”+$pdhcpip+” Scope “+$pdhcpscope+” Add reservedip “+$ip+” “+$mdhcp+” “+”`”$server`””+” “+”`”`””+” “+”`”DHCP`”” | Out-File c:csvprimdhcp.txt -append -Encoding ASCII
            “Dhcp Server \”+$sdhcpip+” Scope “+$pdhcpscope+” Add reservedip “+$ip+” “+$mdhcp+” “+”`”$server`””+” “+”`”`””+” “+”`”DHCP`”” | Out-File c:csvsecdhcp.txt -append -Encoding ASCII
    # Citrix PVS add device to Site and Collection
            Mcli-Add Device -r siteName=$siteName, collectionName=$collectionName, deviceName=$server, deviceMac=$mdevice
            $num = $num + 1

    “@Echo Off” | out-file c:csvdhcpimport.cmd -encoding ASCII

    #DHCP – This will export the settings of the DHCP reservations added above
    “netsh exec c:csvprimdhcp.txt” | out-file c:csvdhcpimport.cmd -append -encoding ASCII

    #DHCP – This will import the reservations on your secondary Microsoft DHCP server
    “netsh exec c:csvsecdhcp.txt” | out-file c:csvdhcpimport.cmd -append -encoding ASCII
    “echo Please verify all objects have been created successfully” | out-file C:csvdhcpimport.cmd -append -encoding ASCII
    “pause” | out-file C:csvdhcpimport.cmd -append -encoding ASCII
    Remove-Item c:csv*.csv
    cmd /c C:csvdhcpimport.cmd

  • Shrinking VHD Files for Xenserver and Citrix PVS

    A question that often comes up when working with Dynamic vDisk when using Citrix Provisioning Server is does PVS automatically shrink the vDisk or is there a built in method to compact them. Citrix PVS does not have a way to do this automatically but with a few steps this can save some disk space on your storage.

    ** Update: 9/23 You can find the PowerShell script to Shrink VHD files here

    A good use case is lets say you clean up your images and remove old programs, installation files and things you no longer need, you will notice the file size does not go down. In order to maximize your storage investment, you want to keep these images as small as possible so you can do this on a regular basis.

    This method can also be used to shrink any VHD files which are used by Hyper-V, Citrix PVS, and you can even configure Windows 2008 and Windows 7 to use VHD files.

    Basic steps

    1. Make a copy of the VHD file that you have to compact 
    2. Open Server Manager
    3. Expand Storage
    4. Right-click on Disk Management on the server.
    5. Select Attach VHD.
    6. Select the required VHD File (The VHD appears as a volume on the server.)
    7. Defragment the drive for performance and storage optimization. (After defragmentation and optimization, the data on the VHD is now all at the beginning of the disk and defragmented.)
    8. Detach the VHD from within Disk Management. (Ensure that you do not delete the VHD when you are detaching the VHD.)
    9. Run the DISKPART command from a command Window.
    10. Run the following commands, substituting the path to your VHD file
      1. select vdisk file =”c:pathvdisk.vhd”
      2. attach vdisk readonly
      3. compact vdisk
      4. detach vdisk 
      5. exit

    Coming soon I will write a script that will execute against a folder and compact all VHD files in the folder. Keep an eye out here for that script 🙂 

  • Citrix XenDesktop 5.6 and Provisioning Server 6.1 Released

    Recently Citrix released to GA (general availability) XenDesktop 5.6 and Provisioning Server 6.1. Both of these upgrades fix many issues and offer new features. Below are some of the details on these two new product releases. I am really excited about Personal vDisk for Xendesktop as this allow users to join the pool and have their personalized installed apps follow them. I will blog more seperately about this new feature in the future.

    Provisioning Server 6.1 now supports vSphere 5.x as indicated below for those of you deploying Citrix on VMware as well as some KMS licensing modifications.

    XenDesktop 5.6

    XenDesktop 5.6 includes the following new features and enhancements:

    • Personal vDisk – This feature is a personalization solution for virtual desktops. Two new types of catalog allow you to preserve the assignment of users to desktops even when the disk is cleaned at restart; the same user is assigned the same desktop for later sessions. The new catalogs are pooled with personal vDisk (for pooled-static virtual desktops) that you manage with Desktop Studio and streamed with personal vDisk that you manage with Provisioning Services. In addition, a dedicated storage disk is created, before logon, so users can store their data on the desktop, including any applications they install. For background information on this feature, see About Personal vDisks. New commands have also been added to the XenDesktop Software Development Kit (SDK) to support this feature.
    • System Center support – XenDesktop now supports Microsoft System Center 2012 Configuration Manager and Microsoft System Center 2012 Virtual Machine Manager.
    • Virtual Desktop Agent – A new version of the Virtual Desktop Agent fixes issues in the version included with XenDesktop 5.5.
    • Citrix Licensing – Citrix Licensing 11.10 lets you assign access to the License Administration Console using Active Directory Users and Groups.
    • Desktop Director – Desktop Director 2.1 supports personal vDisks and contains fixes since the last release. For more information, see the Desktop Director documentation.
    • Fixed issues – For information on the issues that have been fixed in this release, see CTX124164.

    Known Issues

    The following known issues have been observed in this version of XenDesktop:

    • If Microsoft Visual Studio is installed by an administrator on a master image, it may fail to start on virtual desktops that are created from the image. Reinstalling this application, updating the image, and restarting the desktops corrects this issue. [#0270259]
    • Desktop-background images (wallpapers) are lost when users switch between a desktop with a personal vDisk and a desktop without one. This issue occurs with Windows roaming profiles when users select images for the background. The issue does not occur with background colors. The workaround is to use profile management solutions, such as Citrix Profile management. [#0272970]
    • In some deployments involving Windows 7 virtual desktops with personal vDisks, users may notice that network drives are incorrectly displayed as offline, instead of unavailable, in Windows Explorer. These are deployments in which the Enable Offline Files policy is changed to Disable Offline Files in Microsoft Group Policy. To work around this issue, ensure that Disable Offline Files policy is applied on the master image before using it to create virtual desktops. [#0277774]
    • Desktop-background images (wallpapers) are lost when users switch between a desktop with a personal vDisk and a desktop without one. This issue occurs with Windows roaming profiles when users select images for the background. The issue does not occur with background colors. The workaround is to modify as follows the Registry on the desktop containing the personal vDisk, and to use a profile management solution, such as Citrix Profile management, to handle profiles stored on the desktop.

      Caution: Editing the Registry incorrectly can cause serious problems that may require you to reinstall your operating system. Citrix cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. Be sure to back up the registry before you edit it.

      In HKLMSoftwareCitrixpersonal vDiskConfig, change the value of the EnableUserProfileRedirection key from 1 to 0 [#0272970]

    • Do not use Desktop Studio to administer a mixed-controller site. Desktop Studio displays misleading information in a mixed site and cannot be used to create and manage objects in it. For example, if you have two controllers but only upgrade one to XenDesktop 5.6, the Pooled with Personal vDisk catalog type appears in Desktop Studio but you cannot create virtual desktops with it. The workaround for this issue is to upgrade fully all controllers in the site before using Desktop Studio to manage it (and only to follow supported upgrade paths). [#0276786]
    • Citrix recommends planning your hypervisor hardware requirements so the reduction in CPU performance when personal vDisks are used does not detract from the user experience. The reduction is also affected, especially in large-scale deployments, by your choice of operating system (OS). For example, in some environments Windows 7 machines with personal vDisks significantly outperform the equivalent Windows XP machines, allowing more Windows 7 machines to be hosted on each hypervisor. Choosing that OS rather than Windows XP therefore means you purchase and maintain less hardware. Citrix continues to investigate differences in operating system performance and continues to optimize XenDesktop scalability. [#0284660, #0284706]
    • You may fail to create viable machines if a node in a Hyper-V cluster is paused or offline. In some scenarios, the Failover Cluster Manager Console shows that resources are allocated for machines but Microsoft System Center Virtual Machine Manager and XenDesktop cannot recognize them. To work around this issue, manually remove these resources using the Failover Cluster Manager Console and ensure all nodes are healthy (not paused or offline) before creating the machines again. [#285696]
    • The error “Citrix Personal vDisk failed to start” may be displayed on a desktop with a personal vDisk. If the error includes “Status code: 7” and “Error code: 0x2000000b”, this indicates that a master image has been distributed but the Virtual Hard Disk (VHD, part of the personal vDisk) is full. To work around this issue, on the image increase the percentage value of the registry key HKEY_LOCAL_MACHINESOFTWARECitrixpersonal vDiskConfigPercentOfPvDForApps, and redistribute the image. [#287292]

    Citrix Provisioning Server 6.1

    Starting with this release, see http://support.citrix.com/article/CTX131938 to view a list of fixed issues and hot fixes since the previous Provisioning Services release.

    This release contains the following new enhancements:

    • Support for Personal vDisks — Citrix XenDesktop with personal vDisk technology is a high-performance enterprise desktop virtualization solution that makes VDI accessible to workers who require personalized desktops using pooled-static virtual machines. Target devices that use personal vDisks are created using the Citrix XenDesktop Setup Wizard. Within a Provisioning Services farm, the wizard creates and adds target devices with personal vDisks to an existing site’s collection and assigns an existing shared-mode vDisk to that device. The wizard also creates XenDesktop virtual machines to associate with each device. A new type of catalog exists in Citrix Desktop Studio that allows you to preserve the assignment of users to desktops; the same users are assigned the same desktop for later sessions. In addition, a dedicated storage disk is created (before logon) for each user so they can store all personalization’s to that desktop. Personalizations include any changes to the vDisk image or desktop that are not made as a result of an image update, such as application settings, adds, deletes, modifications, documents, etc.
    • Support for Microsoft System Center 2012 Configuration Manager (SCCM) – The vDisk Update Management feature now supports SCCM 2012 environments.
    • Support for Microsoft System Center 2012 Virtual Machine Manager (SCVMM) – The XenDesktop Setup Wizard and Streamed VM Setup Wizard now support SCVMM 2012 for Hyper-V environments.
    • Provisioning Services support for KMS licensing no longer requires local administrator privileges. Provisioning Services SoapServer KMS licensing now requires the same VHD mount privileges as Microsoft Windows (SE_MANAGE_VOLUME_PRIVILEGE, which is included in Administrators group by default).

      Note: If upgrading from a past release, be sure to reset the privileges accordingly.

    • Hypervisor support for ESX 5.0.

    Known Issues and Limitations

    In this Provisioning Services release, the following known issues has been identified:

    XenDesktop Setup Wizard
    BUG0278019 — In a streamed XenDesktop environment, the preferred mechanism for creating streamed desktop catalogs is to use the XenDesktop Setup Wizard, which is available from the Provisioning Services Console. While the XenDesktop Desktop Studio console also provides a mechanism to create streamed catalogs by ‘importing’ information from Provisioning Services, it is not the preferred mechanism because using it can lead to duplicate desktops being created in multiple catalogs (an unsupported configuration). To avoid this, only create new catalogs using the XenDesktop Setup Wizard, and only use the streamed catalog creation mechanism in Desktop Studio if you are reconstructing a catalog from previously created VM’s.

     Links to Download (Requires MyCitrix login)