Quantcast
Channel: PVS | Carl Webster
Viewing all 59 articles
Browse latest View live

Documenting a Citrix Provisioning Services Farm with Microsoft PowerShell and Word – Version 2

$
0
0

The script to document a Citrix Provisioning Services (PVS) farm has proven to be very popular.  I have always wanted to take the time to create a version of the script that would output to a Microsoft Word document.  Ryan Revord had taken the XenApp 6.0 script and changed it to create a basic Microsoft Word document.  Ryan saved me a lot of work but I wanted improve on the document created by adding a cover page, Table of Contents and footer.  This article will explain the changes to the script to create a Word document.

NOTE: This script is continually updated.  You can always find the most current version by going to http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

As much as Microsoft pushes PowerShell for their products and on their users, I find it surprising there is no native PowerShell support for any of the Office products.  For example there is no New_WordDocument, Get-WordDocument or Save-WordDocument.  In order to use Word with PowerShell you must use the Word COM Object model.  Finding detailed information on that subject was not easy.  Fortunately for me, Jeff Hicks had blogged about a presentation he did in 2012 where he linked to some sample PowerShell script files.  One of his sample files gave me the start I needed.

The prerequisites to follow along with this article are:

  • Word 2007, 2010 or 2013 installed on the computer running the script
  • PVS 5.6, PVS 6.0 or PVS 6.1
  • PVS Console PowerShell snap-in registered

Note: The parts of this script that deal with creating the Word document are derived 100% from the XenApp 6.5 script.  To read the details of the changes to the script that deal with Microsoft Word, please read Documenting a Citrix XenApp 6.5 Farm with Microsoft PowerShell and Word – Version 3.  Several of the bug fixes and issues resolved for Version 3.1 of the XenApp 6.5 script are included in this script.  These include:

  • Several typos were fixed to get rid of my southern drawl. No more “gettin”, “settin” or “runnin”.
  • Write-Verbose statements were added.
  • Fixed all the issues reported by running the script with Set-StrictMode –Version 2.0 set.
  • For some users, when Microsoft Word is installed, the HKCU:\Software\Microsoft\Office\Common\UserInfo\CompanyName registry key is set and for some, it is not set. For those users, the HKCU:\Software\Microsoft\Office\Common\UserInfo\Company registry key is set. The script will now check both locations.
  • Some companies do not install the Microsoft Word Templates. This cause the Cover Page and Table of Contents sections of the script to generate numerous errors. The script now checks to see if the appropriate Word Template file is loaded successfully. If not, then the Cover Page and Table of Contents are skipped. The rest of the report is generated.
  • Pat Coughlin showed me how to disable Spell Check and Grammar Check while the document is created. For large PVS Farms, this can substantially speed up the document creation. For those large farms that can generate 1000+ page documents, Word would crash trying to keep track of all the spelling and grammar errors.
  • I received a question as to whether Microsoft Word needed to be installed to create the Word document. The script now verifies that Word is installed. If not, a warning is given and the script exits.
  • I received reports of the script “crashing” if Word was running before the script was run. The script will now check to see if Word is running and if it is, the script will exit. If the script is run from a XenApp server, the script gets the Session ID of the user running the script. Then the script checks if the WinWord process is running in that session. If it is, a warning is given and the script exits.

In trying to find resources to figure out how to use PowerShell to create a complex Word document, I found Jeff Hick’s blog post and sample scripts.

http://jdhitsolutions.com/blog/2012/05/san-diego-2012-powershell-deep-dive-slides-and-demos/

Jeff had a ZIP file with several sample PowerShell scripts.  One of them, Demo-WordReport.ps1, was extremely helpful.

Pat Coughlin showed me how to disable Spell Check and Grammar Check while the document is created.  For large PVS Farms, this can substantially speed up the document creation.  For those large farms that can generate 1000+ page documents, Word would crash trying to keep track of all the spelling and grammar errors.

There are three pieces of information the script needs for the Cover Page and Footer:

  1. Company Name
  2. Cover Page
  3. User Name

Since a digitally signed version of the script is provided, these three pieces of information need to be passed to the script as parameters.  A signed PowerShell script cannot be modified or the script is rendered useless.

These parameters give us $CompanyName, $CoverPage and $UserName.  Each has an alias: CN for CompanyName, CP for CoverPage and UN for UserName.

The default for $CompanyName is read from the registry key where Microsoft Office stores user information.  For some users, when Microsoft Word is installed, the HKCU:\Software\Microsoft\Office\Common\UserInfo\CompanyName registry key is set and for some, it is not set.  For those users, the HKCU:\Software\Microsoft\Office\Common\UserInfo\Company registry key is set.  The script checks both locations.

The default for $CoverPage is Motion.  Motion is a Word Cover Page that comes with all versions of Word, looks good but will require a minor tweak of changing the font used by the date field to a smaller font size.  Some companies do not install the Microsoft Word Templates.  The script checks to see if the appropriate Word Template file is loaded successfully.  If not, then the Cover Page and Table of Contents are skipped.  The rest of the report is generated.

The default for $UserName is taken from the USERNAME environment variable.

The parameter names can be spelled out or the aliases can be used or any combination.  All three of these examples are valid:

-CompanyName “XYC, Inc.” –CoverPage “Grid” –UserName “Joe User”

-CN “XYC, Inc.” –CP “Grid” –UN “Joe User”

-CoverPage “Grid” –UN “Joe User”

For the third example, the default Company Name will be used.

For the Word document to be saved a file name is needed and for the Cover Page, a title is needed.

The filename for the document is the PVS farm name with the extension DOCX.  The document is stored in the folder where the script is run.

Each version of Word comes with Cover Pages and only two are shared across all versions.  The version of Word installed on the computer running the script needs to be determined.  If a wrong cover page is passed as $CoverPage and that Cover Page is not in the installed version of Word, the script will run but a lot of errors will be returned.  The script validates the $CoverPage against the valid Cover Pages specific to each version of Word.

If an invalid Cover Page is used, the script gives an error, closes Word and exits.

In Version 1 of this script, in order to write out a line of output, my friend Michael B. Smith wrote a Line function.  That function is no longer needed.  Ryan took Michael’s function and modified it to write a line to Word.

In updating this script, I fixed several bugs and logic issues.  For example, the time of “12:00 AM” for various update schedules was incorrectly printed as “012:00 PM”.  An example of a logic fix is For PVS 6.x vDisk Update Management.  I was only processing the Virtualization Hosts and vDisks only if at least one Task had been defined.  The Virtualization Hosts and vDisks are now processed independently of the Tasks.

Since this script has parameters, I created help text for the script.  Running the following command from the PowerShell prompt will display the full help text.


Get-Help .\PVS_Inventory_v2.ps1 -full

You can also use –online to get taken to this article.


Get-Help .\PVS_Inventory_V2.ps1 -online

Running the script with –verbose, gives information of the script’s running.


.\PVS_inventory_v2.ps1 -CompanyName "The Accidental Citrix Admin" -CoverPage "Motion" -UserName "Amalgamated Consulting Group" -verbose

Sample output.

PS C:\webster> .\pvs_inventory_v2.ps1 -CompanyName "The Accidental Citrix Admin" -CoverPage "Contrast" -UserName "Amalgamated Consulting Group" -verbose
VERBOSE: checking for McliPSSnapin
VERBOSE: Getting PVS version info
VERBOSE: Build PVS farm values
VERBOSE: Setting up Word
VERBOSE: Create Word comObject.  If you are not running Word 2007, ignore the next message.
VERBOSE: The object written to the pipeline is an instance of the type “Microsoft.Office.Interop.Word.ApplicationClass"  from the component's primary interop assembly. If this type exposes different members than the IDispatch members, scripts written to work with this object might not work if the primary interop assembly is not installed.
VERBOSE: Running Microsoft Word 2010
VERBOSE: Validate company name
VERBOSE: Validate cover page
VERBOSE: Company Name: The Accidental Citrix Admin
VERBOSE: Cover Page  : Contrast
VERBOSE: User Name   : Amalgamated Consulting Group
VERBOSE: Farm Name   : PVS61Farm
VERBOSE: Title       : Inventory Report for the PVS61Farm Farm
VERBOSE: Filename    : C:\webster\PVS61Farm.docx
VERBOSE: Load Word Templates
VERBOSE: Create empty word doc
VERBOSE: disable spell checking
VERBOSE: insert new page, getting ready for table of contents
VERBOSE: table of contents
VERBOSE: set the footer
VERBOSE: get the footer and format font
VERBOSE: Footer text
VERBOSE: add page numbering
VERBOSE: return focus to main document
VERBOSE: move to the end of the current document
VERBOSE: Processing PVS Farm Information
VERBOSE: Processing Security Tab
VERBOSE: Processing Groups Tab
VERBOSE: Processing Licensing Tab
VERBOSE: Processing Options Tab
VERBOSE: Processing vDisk Version Tab
VERBOSE: Processing Status Tab
VERBOSE: Processing Sites
VERBOSE: Processing Site PVS61Site
VERBOSE: Processing Security Tab
VERBOSE: Processing Options Tab
VERBOSE: Processing vDisk Update Tab
VERBOSE: Processing Servers in Site PVS61Site
VERBOSE: Processing Server PVS61
VERBOSE: Processing General Tab
VERBOSE: Processing Network Tab
VERBOSE: Processing Stores Tab
VERBOSE: Processing Stores for server
VERBOSE: Processing Store PVS61Store
VERBOSE: Processing Options Tab
VERBOSE: Processing Logging Tab
VERBOSE: Processing Server Tab on Advanced button
VERBOSE: Processing Network Tab on Advanced button
VERBOSE: Processing Pacing Tab on Advanced button
VERBOSE: Processing Device Tab on Advanced button
VERBOSE: Processing Bootstrap files
VERBOSE: Processing Bootstrap files for Server PVS61
VERBOSE: Processing General Tab
VERBOSE: Processing Options Tab
VERBOSE: Processing all vDisks in site
VERBOSE: Processing vDisk PVS61vDisk
VERBOSE: Processing Properties General Tab
VERBOSE: Processing Identification Tab
VERBOSE: Processing Auto Update Tab
VERBOSE: Processing vDisk Update Management
VERBOSE: Processing virtual hosts
VERBOSE: Processing virtual host XenServer5
VERBOSE: Processing General Tab
VERBOSE: Processing Advanced Tab
VERBOSE: Processing all Update Managed vDisks for this site
VERBOSE: Processing Managed vDisk PVS61Store\PVS61vDisk
VERBOSE: Processing General Tab
VERBOSE: Processing Personality Tab
VERBOSE: Processing Status Tab
VERBOSE: Processing Logging Tab
VERBOSE: Processing Task Task2
VERBOSE: Processing General Tab
VERBOSE: Processing Schedule Tab
VERBOSE: Processing vDisks Tab
VERBOSE: Processing ESD Tab
VERBOSE: Processing Scripts Tab
VERBOSE: Processing Access Tab
VERBOSE: Processing Task Task3
VERBOSE: Processing General Tab
VERBOSE: Processing Schedule Tab
VERBOSE: Processing vDisks Tab
VERBOSE: Processing ESD Tab
VERBOSE: Processing Scripts Tab
VERBOSE: Processing Access Tab
VERBOSE: Processing all device collections in site
VERBOSE: Processing Collection PVS61Collection
VERBOSE: Processing General Tab
VERBOSE: Processing Security Tab
VERBOSE: Processing Auto-Add Tab
VERBOSE: Processing each collection process for each device
VERBOSE: Processing Device TestVM3
VERBOSE: Processing General Tab
VERBOSE: Processing vDisks Tab
VERBOSE: Processing all bootstrap files for this device
VERBOSE: Processing Authentication Tab
VERBOSE: Processing Personality Tab
VERBOSE: Processing all site views in site
VERBOSE: Processing all PVS Farm Views
VERBOSE: Processing Stores
VERBOSE: Processing Store PVS61Store
VERBOSE: Processing General Tab
VERBOSE: Processing Servers Tab
VERBOSE: Processing Server PVS61
VERBOSE: Processing Paths Tab
VERBOSE: Finishing up Word document
VERBOSE: Set Cover Page Properties
VERBOSE: Update the Table of Contents
VERBOSE: Save and Close document and Shutdown Word
PS C:\webster>

How to use this script?

I saved the script as PVS_Inventory_V2.ps1 in the C:\PSScripts folder.  From the PowerShell prompt, change to the C:\PSScripts folder, or the folder where you saved the script.  From the PowerShell prompt, type in:

.\PVS_Inventory_V2.ps1 and press Enter.

A word about Word

  1. Word must be installed
  2. After installation, Word should be opened, at least once, before you run the script
  3. It is better to do File, Options, OK before running the script

The script does very strange things if the last two items are not done.  All kinds of errors are generated by the script if Word has not been opened at least once.  The second time the script is run (without Word haven been opened), fewer errors are generated.  The third time the script is run, it runs without errors.

Word 2013 is the worst.  If Word 2013 is installed and never opened before running the script, a popup box is shown asking to set file extension defaults.  It does not matter if Never ask me again is selected and Yes or No is clicked, the popup box will return until Word 2013 is opened and closed.

I am assuming there are registry keys and values that need to be set for the Word comObject to operate properly.

Bottom Line: If you just installed Word, open Word and close Word before running the script.

If you have any suggestions for the script, please let me know.  Send an e-mail to webster@carlwebster.com.

NOTE: This script is continually updated.  You can always find the most current version by going to http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

Copies of all the Cover Pages, from the XenApp scripts, can be found here:

https://dl.dropbox.com/u/43555945/Word2007SampleCoverPages.zip

https://dl.dropbox.com/u/43555945/Word2010SampleCoverPages.zip

https://dl.dropbox.com/u/43555945/Word2013SampleCoverPages.zip

You just finished reading Documenting a Citrix Provisioning Services Farm with Microsoft PowerShell and Word – Version 2 on Carl Webster. Please consider leaving a comment!


Using My Citrix PVS PowerShell Documentation Script with Remoting

$
0
0

I needed to figure out how to run my latest PVS documentation script without having Microsoft Word installed on the PVS server.  This turned out to be much simpler than I thought it would be.  There are only four steps involved.

  1. From the computer to run the script, start a PowerShell session as Administrator
  2. Add-PSSnapin McliPSSnapin
  3. Mcli-Run SetupConnection -p Server=PVSServerName
  4. .\PVS_Inventory_V2.ps1 -verbose

The results of my session on my Windows 7 VM against my Windows Server 2008 R2 PVS 6.1 server VM:

PS C:\webster> $env:computername
WIN7
PS C:\webster> Add-PSSnapin McliPSSnapin
PS C:\webster> Mcli-Run SetupConnection -p Server=PVS61
Run succeeded.
PS C:\webster> .\PVS_Inventory_V2.ps1 -verbose
VERBOSE: checking for McliPSSnapin
VERBOSE: Getting PVS version info
VERBOSE: Build PVS farm values
VERBOSE: Setting up Word
VERBOSE: Create Word comObject. If you are not running Word 2007, ignore the next message.
VERBOSE: The object written to the pipeline is an instance of the type "Microsoft.Office.Interop.Word.ApplicationClass"
from the component's primary interop assembly. If this type exposes different members than the IDispatch members,
scripts written to work with this object might not work if the primary interop assembly is not installed.
VERBOSE: Running Microsoft Word 2010
VERBOSE: Validate company name
VERBOSE: Validate cover page
VERBOSE: Company Name: Webster's Lab
VERBOSE: Cover Page : Motion
VERBOSE: User Name : administrator
VERBOSE: Farm Name : PVS61Farm
VERBOSE: Title : Inventory Report for the PVS61Farm Farm
VERBOSE: Filename : C:\webster\PVS61Farm.docx
VERBOSE: Load Word Templates
VERBOSE: Create empty word doc
VERBOSE: disable spell checking
VERBOSE: insert new page, getting ready for table of contents
VERBOSE: table of contents
VERBOSE: set the footer
VERBOSE: get the footer and format font
VERBOSE: Footer text
VERBOSE: add page numbering
VERBOSE: return focus to main document
VERBOSE: move to the end of the current document
VERBOSE: Processing PVS Farm Information
VERBOSE: Processing Security Tab
VERBOSE: Processing Groups Tab
VERBOSE: Processing Licensing Tab
VERBOSE: Processing Options Tab
VERBOSE: Processing vDisk Version Tab
VERBOSE: Processing Status Tab
VERBOSE: Processing Sites
VERBOSE: Processing Site PVS61Site
VERBOSE: Processing Security Tab
VERBOSE: Processing Options Tab
VERBOSE: Processing vDisk Update Tab
VERBOSE: Processing Servers in Site PVS61Site
VERBOSE: Processing Server PVS61
VERBOSE: Processing General Tab
VERBOSE: Processing Network Tab
VERBOSE: Processing Stores Tab
VERBOSE: Processing Stores for server
VERBOSE: Processing Store Store
VERBOSE: Processing Options Tab
VERBOSE: Processing Logging Tab
VERBOSE: Processing Server Tab on Advanced button
VERBOSE: Processing Network Tab on Advanced button
VERBOSE: Processing Pacing Tab on Advanced button
VERBOSE: Processing Device Tab on Advanced button
VERBOSE: Processing Bootstrap files
VERBOSE: Processing Bootstrap files for Server PVS61
VERBOSE: Processing General Tab
VERBOSE: Processing Options Tab
VERBOSE: Processing all vDisks in site
VERBOSE: Processing vDisk Update Management
VERBOSE: Processing all device collections in site
VERBOSE: Processing Collection PVS61Collection
VERBOSE: Processing General Tab
VERBOSE: Processing Security Tab
VERBOSE: Processing Auto-Add Tab
VERBOSE: Processing each collection process for each device
VERBOSE: Processing all site views in site
VERBOSE: Processing all PVS Farm Views
VERBOSE: Processing Stores
VERBOSE: Processing Store Store
VERBOSE: Processing General Tab
VERBOSE: Processing Servers Tab
VERBOSE: Processing Server PVS61
VERBOSE: Processing Paths Tab
VERBOSE: Finishing up Word document
VERBOSE: Set Cover Page Properties
VERBOSE: Update the Table of Contents
VERBOSE: Save and Close document and Shutdown Word
PS C:\webster>

That is it, that is all there is to it.

Hope this help.

Webster

You just finished reading Using My Citrix PVS PowerShell Documentation Script with Remoting on Carl Webster. Please consider leaving a comment!

PVS V2 Documentation Script Has Been Updated 22-APR-2013

$
0
0

While at a customer site recently that had a fairly large PVS 6.1 implementation, I was dissatisfied with the Table of Contents for the Word document.  I thought some of the Section Headings needed to be changed so the Table of Contents “looked” better.  I also thought there should be more detail, especially for the Servers, vDisks and Device Collections.  I also found a way around the incompatibilities between Set-StrictMode –Version 2 and the way I was saving the Word file.

Since I wrote the article on how to use remoting with the PVS script, I decided to go ahead and add the capability to configure remoting to the script.  The necessitated the need for an additional parameter AdminAddress.  AdminAddress is the name of the PVS server to remote the script against.

If you fat-finger the PVS server name for the AdminAddress parameter, the PVS PowerShell cmdlet that configures remoting will throw up a whole heaping helping of garbage on your screen before I can catch the error and end the script.

To use the new AdminAddress parameter:


.\PVS_Inventory_V2.ps1 -CompanyName "Citrix Customer" -CoverPage Cubicles -UserName "Carl Webster" -AdminAddress PVS1 -verbose

The changes I made to the V2 PVS script are very minor.  I changed the internal version number to 2.01 but left the filename unchanged.

Table of Contents from the original V2 script.

Table of Contents Before Script Update

Table of Contents Before Script Update

Table of Contents from the 2.01 script.

Table of Contents After Script Update

Table of Contents After Script Update

If you have any suggestions for the script, please let me know.  Send an e-mail to webster@carlwebster.com.

NOTE: This script is continually updated.  You can always find the most current version by going to http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

Thanks

Webster

You just finished reading PVS V2 Documentation Script Has Been Updated 22-APR-2013 on Carl Webster. Please consider leaving a comment!

PVS V2 Documentation Script Has Been Updated 07-JUN-2013

$
0
0

A reader, Corey Tracey, emailed me and told me I missed the vDisk Load Balancing menu item for PVS 6.x.  OOPS!  That is now fixed.

Here is what I missed for vDisk Pool:

Load Balancing menu

Load Balancing menu

vDisk Load Balancing

vDisk Load Balancing

This was already in the report for PVS 5.x but for PVS 6.x was moved out of the vDisk Properties and onto a separate menu level.

The changes I made to the V2 PVS script are very minor.  I changed the internal version number to 2.02 but left the filename unchanged.

If you have any suggestions for the script, please let me know.  Send an e-mail to webster@carlwebster.com.

NOTE: This script is continually updated.  You can always find the most current version by going to http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

You just finished reading PVS V2 Documentation Script Has Been Updated 07-JUN-2013 on Carl Webster. Please consider leaving a comment!

PVS V2 Documentation Script Has Been Updated 17-JUN-2013

$
0
0

A reader, Corey Tracey, emailed me and asked me if there was way to run the PVS V2 script from one computer against multiple untrusted domains that each contain a PVS Farm.  Turns out there was a way but it was not an easy task.

The PVS PowerShell documentation shows the McliRun –SetupConnection has parameters that will handle Corey’s request.  From the Citrix Provisioning Services  6.1 PowerShell Programming Guide:

Setup of the SOAP Server Communication

Unless the defaults are fine, use this command to set the values for the SOAP Server connection:

Mcli-Run SetupConnection -p name=value[, name2=value2]

Setup the SOAP server connection that will be used for the MCLI and PowerShell command line interfaces.

-p

Parameters needed for this Run.

Optional

server          Server used for the connection.  Default=localhost

port             Port used for the connection.  Default=8000

user             User used for the connection.  Default=Current user

domain       User domain used for the connection.  Default=Current user

password    User password used for the connection.  Default=Current user

Unfortunately, the pathetic piece of crap that Citrix calls the PVS PowerShell implementation made this much more difficult than it should have been to implement.  I really hope one of these days  Citrix will fix their pathetic PowerShell implementations for both PVS and XenDesktop.  Citrix should have and could have done a better job with their PowerShell work.    The teams at Citrix who create these PowerShell implementations should have and take more pride in their work.

There are two ways to enter the new parameters.  All three parameters (User, Domain, Password) can be entered or just the User.  If  just the User is entered, the script will prompt for Domain and Password.

Corey tested this on his multiple untrusted domains and said the script worked flawlessly.

The changes I made to the V2 PVS script are very minor.  I changed the internal version number to 2.03 but left the filename unchanged.

If you have any suggestions for the script, please let me know.  Send an e-mail to webster@carlwebster.com.

NOTE: This script is continually updated.  You can always find the most current version by going to http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

You just finished reading PVS V2 Documentation Script Has Been Updated 17-JUN-2013 on Carl Webster. Please consider leaving a comment!

Provisioning Services 7 and Server 2012 Group Managed Service Account

$
0
0

Citrix released Provisioning Services version 7 (PVS7) with support for running on Microsoft Windows Server 2012.  Server 2012 has a really nice new feature called Group Managed Service  Accounts (gMSA).  Even though Citrix had to test installing PVS7 on Server 2012, I found out that Citrix never tested using gMSA for the Stream or SOAP services.  This article is my attempt to see if PVS7 will allow the use of a gMSA for the Stream and SOAP services.

I have absolutely no idea if PVS7 running on Server 2012 will work with a gMSA or not.  Citrix says it should work but the articles I have read from Microsoft make it seem like the application must be written to support and work with gMSA.  You will find out the same time I do whether this experiment will work.

To get more information on gMSA, please read this TechNet article.

There are three requirements to use a gMSA:

  1. At least one Windows Server 2012 Domain Controller.
  2. A Windows Server 2012 or Windows 8 computer with the ActiveDirectory PowerShell module, to create/manage the gMSA.
  3. A Windows Server 2012 or Windows 8 domain member to run/use the gMSA.

I installed a Server 2012 Domain Controller into my lab environment and I will use it to create and manage the gMSA.

Step 1: Create the Key Distribution Services (KDS) Root Key

The KDS Root Key is used by the KDS service on domain controller to generate passwords.  On my Server 2012 Domain Controller, I will run from an elevated PowerShell session:

Add-KDSRootKey –EffectiveImmediately

Figure 1

Figure 1

The TechNet article says the key can take up to 10 hours to replicate and take effect.  Since I only have one Server 2012 domain controller and only two domain controllers in my lab, I am not worried about the replication time.  By the way, it took almost one hour in my lab before the key was usable!

Step 2: Create and configure the gMSA

I am going to create a Security Group containing my two PVS7 servers.  This security group will contain the computer accounts allowed to use the gMSA.

Figure 2

Figure 2

Figure 3

Figure 3

Figure004

Next, my two PVS7 servers need to be restarted to know they were added to the security group.

From the elevated PowerShell session on my Server 2012 domain controller, I run:

New-ADServiceAccount –Name PVS7StreamSOAP –DNSHostName PVS7StreamSOAP.websterslab.com –PrincipalsAllowedToRetrieveManagedPassword “PVS7gMSAGroup”

Note: The Name is a NetBIOS name that must not be more than 15 characters.

Figure 5

Figure 5

The gMSA now appears in the Managed Service Accounts OU in Active Directory Users and Computers.

Figure 6

Figure 6

Step3: Configure the gMSA on the PVS7 host

Note: The following requires the Active Directory module for Windows PowerShell be installed on the PVS7 host.  It can be uninstalled after the test is successful.

From an elevated PowerShell session on the PVS7 server, I will run the following two cmdlets:

Install-AdServiceAccount PVS7StreamSOAP

Test-AdServiceAccount PVS7StreamSOAP

Figure 7

Figure 7

The Test-AdServiceAccount should return True.  If it returns False, a verbose error message should be included.

Now for the time of truth.  Is this going to work in PVS7 or not.  Start the Provisioning Services Configuration Wizard and go to the User account screen.  The TechNet article says the trick is to use a “$” after the gMSA and leave the password blank.

Figure 8

Figure 8

Let’s see what happens when I click Next?????

What do you know, it let me continue, but we are not done yet.

Figure 8

Figure 8

DOH!!!  I guess PVS7 will NOT work with Server 2012’s Group Managed service Accounts after all!  Total Bummer.

Figure 10

Figure 10

Figure 11

Figure 11

Figure 12

Figure 12

Citrix should fix this pronto.  Actually, this should have been in PVS7 from the initial design for Server 2012 support.  gMSA offers several features that would be very useful in a PVS implementation.  Too bad Citrix doesn’t support gMSA at this time.  I hope this gets fixed fast.

Thanks

Webster

You just finished reading Provisioning Services 7 and Server 2012 Group Managed Service Account on Carl Webster. Please consider leaving a comment!

Documenting a Citrix Provisioning Services Farm with Microsoft PowerShell and Word – Version 3

$
0
0

Now that Citrix has released Provisioning Services (PVS) 7, it was time to update the PVS documentation script to add support for PVS 7.  This article documents the changes made to the script.

To start off with, this updated script would not have been possible without a hard-working, dedicated group of testers.

  • Anton van Pelt
  • Chris Staton
  • Dane Young
  • David Figueroa
  • Jarian Gibson
  • Kees Baggerman
  • Martin Therkelsen
  • Rene Vester
  • Robin Plomp
  • Stephane Thirion
  • Thomas Gamull

PVS 7 includes four new items.  The XenDesktop Setup Wizard adds Local write cache disk and Boot mode as seen in Figure 1.

Figure 1

Figure 1

There are also Streaming IP addresses and Management IP  as shown in Figure 2.

Figure 2

Figure 2

Citrix also added the text (minutes:seconds) to two items in the Advanced button of the properties of the Server as shown in Figures 3 and 4.

Figure 3

Figure 3

Figure 4

Figure 4

This necessitated the need for a Function to convert seconds to minutes:seconds.

Function SecondsToMinutes
{
	Param( $xVal )

	If( [int]$xVal -lt 60 )
	{
		Return "0:$xVal"
	}
	$xMinutes = ([int]($xVal / 60)).ToString()
	$xSeconds = ([int]($xVal % 60)).ToString().PadLeft(2, "0")
	Return "$xMinutes`:$xSeconds"
}

Previous versions of PVS also displayed the time selected in the slider as minutes:seconds but the (minutes:seconds) text is not there in the GUI.

There was other glaring glitch I noticed when the testers from outside the USA sent me their sample reports.  My Word 2007/2010/2013 are set for Default Tab Stops of ½ inch.  But I noticed that some reports had tab stops of 3/8 inch, some 5/8 inch and also 7/8 inch.  That was driving me crazy since all the reports looked different.  After much trial and error, I found the solution was to use PowerShell to set the DefaultTabStop property of the Word document.

$Word.ActiveDocument.DefaultTabStop = 36

The setting is configured in points where 72 points is 1 inch and 36 points is ½ inch. This setting, so far, has worked in all the sample reports sent to me by testers in five different countries.

Once I figured out how to set the DefaultTabStop, I was able to get all the items in the report to align properly.  Thanks to all the testers for putting up with a flurry of script changes over two days to get every section (that the testers had data for) aligned properly.

Please let me know if you spot anything not aligning properly.

Since this is a major change to the script, the version number has changed to V3.  V4 development is already under way.

If you have any suggestions for the script, please let me know.  Send an e-mail to webster@carlwebster.com.

NOTE: This script is continually updated.  You can always find the most current version by going to http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

Thanks

Webster

You just finished reading Documenting a Citrix Provisioning Services Farm with Microsoft PowerShell and Word – Version 3 on Carl Webster. Please consider leaving a comment!

PVS V3 Documentation Script and Support for PVS 7.1

$
0
0

The PVS V3 documentation script has been tested with Provisioning Services 7.1 running on Windows Server 2012 R2 and ran with no issues.  Since Server 2012 R2 comes with PowerShell V4, that means that script ran with no issues with PowerShell V4.

PS C:\webster> (Get-WmiObject -class Win32_OperatingSystem).Caption
Microsoft Windows Server 2012 R2 Datacenter
PS C:\webster> $host.version.major
4
PS C:\webster> .\pvs_inventory_v3.ps1 -verbose
VERBOSE: checking for McliPSSnapin
Loading Windows PowerShell snap-in: McliPSSnapIn
VERBOSE: Getting PVS version info
VERBOSE: Build PVS farm values
VERBOSE: Setting up Word
VERBOSE: Create Word comObject.  If you are not running Word 2007, ignore the next message.
VERBOSE: The object written to the pipeline is an instance of the type “Microsoft.Office.Interop.Word.ApplicationClass”
from the component’s primary interoperability assembly. If this type exposes different members than the IDispatch
members, scripts that are written to work with this object might not work if the primary interoperability assembly is
not installed.
VERBOSE: Running Microsoft Word 2013
VERBOSE: Validate company name
VERBOSE: Validate cover page
VERBOSE: Company Name: The Accidental Citrix Admin
VERBOSE: Cover Page  : Motion
VERBOSE: User Name   : Administrator
VERBOSE: Farm Name   : PVS71Farm
VERBOSE: Title       : Inventory Report for the PVS71Farm Farm
VERBOSE: Filename    : C:\webster\PVS71Farm.docx
VERBOSE: Script version: 3.0
VERBOSE: Load Word Templates
VERBOSE: Create empty word doc
VERBOSE: disable spell checking
VERBOSE: insert new page, getting ready for table of contents
VERBOSE: table of contents
VERBOSE: set the footer
VERBOSE: get the footer and format font
VERBOSE: Footer text
VERBOSE: add page numbering
VERBOSE: return focus to main document
VERBOSE: move to the end of the current document
VERBOSE: Processing PVS Farm Information
VERBOSE: Processing Security Tab
VERBOSE: Processing Groups Tab
VERBOSE: Processing Licensing Tab
VERBOSE: Processing Options Tab
VERBOSE: Processing vDisk Version Tab
VERBOSE: Processing Status Tab
VERBOSE: Processing Sites
VERBOSE: Processing Site PVS71Site
VERBOSE: Processing Security Tab
VERBOSE: Processing Options Tab
VERBOSE: Processing vDisk Update Tab
VERBOSE: Processing Servers in Site PVS71Site
VERBOSE: Processing Server PVS71
VERBOSE: Processing General Tab
VERBOSE: Processing Network Tab
VERBOSE: Processing Stores Tab
VERBOSE: Processing Stores for server
VERBOSE: Processing Store PVS71Store
VERBOSE: Processing Options Tab
VERBOSE: Processing Server Tab on Advanced button
VERBOSE: Processing Network Tab on Advanced button
VERBOSE: Processing Pacing Tab on Advanced button
VERBOSE: Processing Device Tab on Advanced button
VERBOSE: Processing Bootstrap files
VERBOSE: Processing Bootstrap files for Server PVS71
VERBOSE: Processing General Tab
VERBOSE: Processing Options Tab
VERBOSE: Processing all vDisks in site
VERBOSE: Processing vDisk test
VERBOSE: Processing Properties General Tab
VERBOSE: Processing Identification Tab
VERBOSE: Processing Auto Update Tab
VERBOSE: Processing vDisk Load Balancing Menu
VERBOSE: Processing vDisk Update Management
VERBOSE: Processing all device collections in site
VERBOSE: Processing Collection PVS71Collection
VERBOSE: Processing General Tab
VERBOSE: Processing Security Tab
VERBOSE: Processing Auto-Add Tab
VERBOSE: Processing each collection process for each device
VERBOSE: Processing Device testdevice
VERBOSE: Processing General Tab
VERBOSE: Processing vDisks Tab
VERBOSE: Processing all bootstrap files for this device
VERBOSE: Processing Authentication Tab
VERBOSE: Processing Personality Tab
VERBOSE: Processing all site views in site
VERBOSE: Processing virtual hosts (PVS7)
VERBOSE: Processing all PVS Farm Views
VERBOSE: Processing Stores
VERBOSE: Processing Store PVS71Store
VERBOSE: Processing General Tab
VERBOSE: Processing Servers Tab
VERBOSE: Processing Server PVS71
VERBOSE: Processing Paths Tab
VERBOSE: Finishing up Word document
VERBOSE: Set Cover Page Properties
VERBOSE: Update the Table of Contents
VERBOSE: Save and Close document and Shutdown Word
PS C:\webster>

You just finished reading PVS V3 Documentation Script and Support for PVS 7.1 on Carl Webster. Please consider leaving a comment!


Citrix Provisioning Services, Bluecat DHCP Appliance and PXE-E32: TFTP Open Timeout Error

$
0
0

At a recent XenDesktop and PVS project we ran into an issue where even though DHCP Options 66 and 67 were configured, we could not get rid of the PXE-E32: TFTP open timeout error.  This short article describes the resolution.

This project was for XenDesktop 7.1 and PVS 7.1 using Bluecat DHCP/DNS appliances.  There are a couple of search hits that mention this specific issue with Bluecat DHCP where DHCP Option 66 is never returned in the DHCP Offer packet.  We made sure of the following:

  • All PVS servers had the correct IP addresses, subnet mask and gateway
  • The boot configuration file in both PVS sites was configured with the correct subnet mask
  • The VLAN was configured with the right subnet mask
  • DHCP was configured with the right subnet mask and gateway
  • DHCP Options 66 and 67 were configured correctly

We did find some subnet misconfiguration issues and all subnet masks were corrected.  We then reran the PVS Configuration Wizard and make sure the correct subnet mask was used for the boot configuration information.  But we still received the PXE-E32: TFTP open timeout error.

We then installed Wireshark on the PVS server used for Option 66.  After receiving the timeout, we stopped the Wireshark capture and analyzed the DHCP packets.  What we noticed was that there was no Option 66 in the DHCP Offer packets.  DHCP Option 67 was there but without Option 66 the target device had no IP Address to go to for Option 67.  The customer placed a support call to Bluecat and found out that the Bluecat DHCP appliances do not support Option 66 or Option 67.  Bluecat has their own proprietary options that act like Options 66 and 67.  Once the proprietary options were set on the Bluecat DHCP appliance, the PXE-E32: TFTP open timeout error was gone, the target device received the proper information for the TFTP Server and boot file and the project was able to proceed.

Unfortunately the Bluecat support knowledgebase is behind a paid login so you will not find this information anywhere.  I hope this short post will help others out there looking to resolve the missing DHCP Option 66 offer when a Bluecat DHCP appliance is used.

 

UPDATE 10-Jan-2014: The customer gave me permission to include the settings that need to be set on the Bluecat DHCP appliance.  These are not DHCP Options, just fields on the Bluecat:

  • Nextserver
  • Filename

 

Thanks

Webster

You just finished reading Citrix Provisioning Services, Bluecat DHCP Appliance and PXE-E32: TFTP Open Timeout Error on Carl Webster. Please consider leaving a comment!

PVS V4.1 Documentation Script Has Been Updated 2-FEB-2014

$
0
0

I received a message on Twitter from the very smart and always helpful Shane Kleinert (@ShaneKleinert you should follow him) asking if my Provisioning Services (PVS) documentation script had the vDisk Versions and Audit Trail information. I was sure it did until I checked and saw that I had never added that information to my script and no one, until now, had noticed or asked about it. Of course, I had to add those two items to my script. This article describes the process.

I downloaded the latest PVS 7.1 PowerShell Programmers Guide and started looking for where to find the proper MCLI-GET command to use. I finally found it in MCLI-Get DiskVersion. The only problem was that it requires three parameters and my PVSObject function can only handle one parameter. Parameters passed to the MCLI-Get wrapper are comma delimited (with no spaces allowed) and PowerShell then treats that as an array. So I had to put the code to handle getting DiskVersion directly into the script since I couldn’t find a way around the comma delimited parameters treated as an array issue.

There are two items I have yet to find in the PVS PowerShell Programmers Guide: Boot production devices from version and which version is the current booting version (the one with the green checkmark).

vDisk Versions

vDisk Versions

If you know how to get those two pieces of information, please let me know and I will add them to the script and give you credit.

The code to handle vDisk Versions:

#process Versions menu
#get versions info
Write-Verbose "$(Get-Date): `t`t`tProcessing vDisk Versions"
$VersionsObjects = @()
$error.Clear()
$MCLIGetResult = Mcli-Get DiskVersion -p diskLocatorName="$($Disk.diskLocatorName)",storeName="$($disk.storeName)",siteName="$($disk.siteName)"
If($error.Count -eq 0)
{
	#build versions object
	$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
	$DiskVersions = $PluralObject
	
	If($DiskVersions -ne $Null)
	{
		WriteWordLine 0 1 "vDisk Versions"
		ForEach($DiskVersion in $DiskVersions)
		{
			Write-Verbose "$(Get-Date): `t`t`t`tProcessing vDisk Version $($DiskVersion.version)"
			WriteWordLine 0 2 "Version`t`t`t`t`t: " $DiskVersion.version
			WriteWordLine 0 2 "Created`t`t`t`t`t: " $DiskVersion.createDate
			If(![String]::IsNullOrEmpty($DiskVersion.scheduledDate))
			{
				WriteWordLine 0 2 "Released`t`t`t`t: " $DiskVersion.scheduledDate
			}
			WriteWordLine 0 2 "Devices`t`t`t`t`t: " $DiskVersion.deviceCount
			WriteWordLine 0 2 "Access`t`t`t`t`t: " -NoNewLine
			Switch ($DiskVersion.access)
			{
				0 {WriteWordLine 0 0 "Production"}
				1 {WriteWordLine 0 0 "Maintenance"}
				2 {WriteWordLine 0 0 "Maintenance Highest Version"}
				3 {WriteWordLine 0 0 "Override"}
				4 {WriteWordLine 0 0 "Merge"}
				5 {WriteWordLine 0 0 "Merge Maintenance"}
				6 {WriteWordLine 0 0 "Merge Test"}
				7 {WriteWordLine 0 0 "Test"}
				Default {WriteWordLine 0 0 "Access could not be determined: $($DiskVersion.access)"}
			}
			WriteWordLine 0 2 "Type`t`t`t`t`t: " -NoNewLine
			Switch ($DiskVersion.type)
			{
				0 {WriteWordLine 0 0 "Base"}
				1 {WriteWordLine 0 0 "Manual"}
				2 {WriteWordLine 0 0 "Automatic"}
				3 {WriteWordLine 0 0 "Merge"}
				4 {WriteWordLine 0 0 "Merge Base"}
				Default {WriteWordLine 0 0 "Type could not be determined: $($DiskVersion.type)"}
			}
			If(![String]::IsNullOrEmpty($DiskVersion.description))
			{
				WriteWordLine 0 2 "Properties`t`t`t`t: " $DiskVersion.description
			}
			WriteWordLine 0 2 "Can Delete`t`t`t`t: "  -NoNewLine
			Switch ($DiskVersion.canDelete)
			{
				0 {WriteWordLine 0 0 "No"}
				1 {WriteWordLine 0 0 "Yes"}
			}
			WriteWordLine 0 2 "Can Merge`t`t`t`t: "  -NoNewLine
			Switch ($DiskVersion.canMerge)
			{
				0 {WriteWordLine 0 0 "No"}
				1 {WriteWordLine 0 0 "Yes"}
			}
			WriteWordLine 0 2 "Can Merge Base`t`t`t: "  -NoNewLine
			Switch ($DiskVersion.canMergeBase)
			{
				0 {WriteWordLine 0 0 "No"}
				1 {WriteWordLine 0 0 "Yes"}
			}
			WriteWordLine 0 2 "Can Promote`t`t`t`t: "  -NoNewLine
			Switch ($DiskVersion.canPromote)
			{
				0 {WriteWordLine 0 0 "No"}
				1 {WriteWordLine 0 0 "Yes"}
			}
			WriteWordLine 0 2 "Can Revert back to Test`t`t`t: "  -NoNewLine
			Switch ($DiskVersion.canRevertTest)
			{
				0 {WriteWordLine 0 0 "No"}
				1 {WriteWordLine 0 0 "Yes"}
			}
			WriteWordLine 0 2 "Can Revert back to Maintenance`t: "  -NoNewLine
			Switch ($DiskVersion.canRevertMaintenance)
			{
				0 {WriteWordLine 0 0 "No"}
				1 {WriteWordLine 0 0 "Yes"}
			}
			WriteWordLine 0 2 "Can Set Scheduled Date`t`t`t: "  -NoNewLine
			Switch ($DiskVersion.canSetScheduledDate)
			{
				0 {WriteWordLine 0 0 "No"}
				1 {WriteWordLine 0 0 "Yes"}
			}
			WriteWordLine 0 2 "Can Override`t`t`t`t: "  -NoNewLine
			Switch ($DiskVersion.canOverride)
			{
				0 {WriteWordLine 0 0 "No"}
				1 {WriteWordLine 0 0 "Yes"}
			}
			WriteWordLine 0 2 "Is Pending`t`t`t`t: "  -NoNewLine
			Switch ($DiskVersion.isPending)
			{
				0 {WriteWordLine 0 0 "No, version Scheduled Date has occurred"}
				1 {WriteWordLine 0 0 "Yes, version Scheduled Date has not occurred"}
			}
			WriteWordLine 0 2 "Replication Status`t`t`t: " -NoNewLine
			Switch ($DiskVersion.goodInventoryStatus)
			{
				0 {WriteWordLine 0 0 "Not available on all servers"}
				1 {WriteWordLine 0 0 "Available on all servers"}
				Default {WriteWordLine 0 0 "Replication status could not be determined: $($DiskVersion.goodInventoryStatus)"}
			}
			WriteWordLine 0 2 "Disk Filename`t`t`t`t: " $DiskVersion.diskFileName
			WriteWordLine 0 0 ""
		}
	}
}
Else
{
	WriteWordLine 0 0 "Disk Version information could not be retrieved"
	WriteWordLine 0 0 "Error returned is " $error[0].FullyQualifiedErrorId.Split(',')[0].Trim()
}

Here is what the vDisk Versions part of the report looks like for my lab.

vDisk Versions Report

vDisk Versions Report

Next up was getting the Audit Trail data.

Audit Trail

Audit Trail

This is retrieved using MCLI-GET AuditTrail. This also required three parameters with two of them being Start and End dates. That required me adding two more parameters to my script: StartDate and EndDate. The dates are entered in MM/DD/YYYY format but MCLI-GET AuditTrail requires the dates in YYYY/MM/DD format. The default, by both MCLI-GET AuditTrail and the script, is to include only the previous seven days of audit trail data.

The audit trail data is put into a Word table to get more data per page. In order for the table to fit in the width of the page I removed the Number and Domain columns and changed the font size to 9 points.

In the PVS console, you get to the Audit Trail report at the Farm level but MCLI-GET AuditTrail does not have a way to retrieve the data for the Farm??? I decided to put it as the last item, on a new page, in the Site section of the report.

The new parameters:

.PARAMETER StartDate
	Start date, in MM/DD/YYYY format, for the Audit Trail report.
	Default is today's date minus seven days.
.PARAMETER EndDate
	End date, in MM/DD/YYYY format, for the Audit Trail report.
	Default is today's date.


.EXAMPLE
	PS C:\PSScript > .\PVS_Inventory_V41.ps1 -StartDate "01/01/2014" -EndDate "01/31/2014" -verbose
	
	Will use all Default values.
	HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo\Company="Carl Webster"
	$env:username = Administrator
	AdminAddress = LocalHost

	Carl Webster for the Company Name.
	Sideline for the Cover Page format.
	Administrator for the User Name.
	LocalHost for AdminAddress.
	Will display verbose messages as the script is running.
	Will return all Audit Trail entries from "01/01/2014" through "01/31/2014".


	[parameter(
	Position = 9, 
	Mandatory=$False)
	] 
	[Datetime]$StartDate = ((Get-Date -displayhint date).AddDays(-7)),

	[parameter(
	Position = 10, 
	Mandatory=$False)
	] 
	[Datetime]$EndDate = (Get-Date -displayhint date)

The code to handle the audit trail data is 300 lines so I will snip out some lines for this article.

#add Audit Trail
Write-Verbose "$(Get-Date): `t`t`tProcessing Audit Trail"
$AuditTrailObjects = @()
$error.Clear()

#the audittrail call requires the dates in YYYY/MM/DD format
$Sdate = '{0:yyyy/MM/dd}' -f $StartDate
$Edate = '{0:yyyy/MM/dd}' -f $EndDate
$MCLIGetResult = Mcli-Get AuditTrail -p siteName="$($PVSSite.siteName)",beginDate="$($SDate)",endDate="$($EDate)"
If($error.Count -eq 0)
{
	#build audit trail object
	$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
	$Audits = $PluralObject
	
	If($Audits -ne $Null)
	{
		$selection.InsertNewPage()
		WriteWordLine 2 0 "Audit Trail"
		WriteWordLine 0 0 "Audit Trail for dates $($StartDate) through $($EndDate)"
		$TableRange   = $doc.Application.Selection.Range
		[int]$Columns = 6
		If($Audits -is [array])
		{
			[int]$Rows = $Audits.Count +1
		}
		Else
		{
			[int]$Rows = 2
		}
		Write-Verbose "$(Get-Date): `t`t`t`tAdd Audit Trail table to doc"
		$Table = $doc.Tables.Add($TableRange, $Rows, $Columns)
		$table.Style = "Table Grid"
		$table.Borders.InsideLineStyle = 0
		$table.Borders.OutsideLineStyle = 1
		$Table.Cell(1,1).Shading.BackgroundPatternColor = $wdColorGray15
		$Table.Cell(1,1).Range.Font.Bold = $True
		$Table.Cell(1,1).Range.Font.size = 9
		$Table.Cell(1,1).Range.Text = "Date/Time"
		$Table.Cell(1,2).Shading.BackgroundPatternColor = $wdColorGray15
		$Table.Cell(1,2).Range.Font.Bold = $True
		$Table.Cell(1,2).Range.Font.size = 9
		$Table.Cell(1,2).Range.Text = "Action"
		$Table.Cell(1,3).Shading.BackgroundPatternColor = $wdColorGray15
		$Table.Cell(1,3).Range.Font.Bold = $True
		$Table.Cell(1,3).Range.Font.size = 9
		$Table.Cell(1,3).Range.Text = "Type"
		$Table.Cell(1,4).Shading.BackgroundPatternColor = $wdColorGray15
		$Table.Cell(1,4).Range.Font.Bold = $True
		$Table.Cell(1,4).Range.Font.size = 9
		$Table.Cell(1,4).Range.Text = "Name"
		$Table.Cell(1,5).Shading.BackgroundPatternColor = $wdColorGray15
		$Table.Cell(1,5).Range.Font.Bold = $True
		$Table.Cell(1,5).Range.Font.size = 9
		$Table.Cell(1,5).Range.Text = "User"
		$Table.Cell(1,6).Shading.BackgroundPatternColor = $wdColorGray15
		$Table.Cell(1,6).Range.Font.Bold = $True
		$Table.Cell(1,6).Range.Font.size = 9
		$Table.Cell(1,6).Range.Text = "Path"
		[int]$xRow = 1
		[int]$Cnt = 0
		ForEach($Audit in $Audits)
		{
			$xRow++
			$Cnt++
			Write-Verbose "$(Get-Date): `t`t`tAdding row for audit trail item # $Cnt"
			If($xRow % 2 -eq 0)
			{
				$Table.Cell($xRow,1).Shading.BackgroundPatternColor = $wdColorGray05
				$Table.Cell($xRow,2).Shading.BackgroundPatternColor = $wdColorGray05
				$Table.Cell($xRow,3).Shading.BackgroundPatternColor = $wdColorGray05
				$Table.Cell($xRow,4).Shading.BackgroundPatternColor = $wdColorGray05
				$Table.Cell($xRow,5).Shading.BackgroundPatternColor = $wdColorGray05
				$Table.Cell($xRow,6).Shading.BackgroundPatternColor = $wdColorGray05
			}
			$Table.Cell($xRow,1).Range.Font.size = 9
			$Table.Cell($xRow,1).Range.Text = $Audit.time
			$Tmp = ""
			Switch([int]$Audit.action)
			{
				1 { $Tmp = "AddAuthGroup"}
				2 { $Tmp = "AddCollection"}
				3 { $Tmp = "AddDevice"}
				4 { $Tmp = "AddDiskLocator"}
				5 { $Tmp = "AddFarmView"}
				6 { $Tmp = "AddServer"}
				7 { $Tmp = "AddSite"}
				8 { $Tmp = "AddSiteView"}
				9 { $Tmp = "AddStore"}
				10 { $Tmp = "AddUserGroup"}
				# SNIP 140 lines of code
				7033 { $Tmp = "SetListUserGroupCustomPropertyAdd"}				
			}
			$Table.Cell($xRow,2).Range.Font.size = 9
			$Table.Cell($xRow,2).Range.Text = $Tmp
			$Tmp = ""
			Switch ($Audit.type)
			{
				0 {$Tmp = "Many"}
				1 {$Tmp = "AuthGroup"}
				2 {$Tmp = "Collection"}
				3 {$Tmp = "Device"}
				4 {$Tmp = "Disk"}
				5 {$Tmp = "DeskLocator"}
				6 {$Tmp = "Farm"}
				7 {$Tmp = "FarmView"}
				8 {$Tmp = "Server"}
				9 {$Tmp = "Site"}
				10 {$Tmp = "SiteView"}
				11 {$Tmp = "Store"}
				12 {$Tmp = "System"}
				13 {$Tmp = "UserGroup"}
				Default { {$Tmp = "Undefined"}}
			}
			$Table.Cell($xRow,3).Range.Font.size = 9
			$Table.Cell($xRow,3).Range.Text = $Tmp
			$Table.Cell($xRow,4).Range.Font.size = 9
			$Table.Cell($xRow,4).Range.Text = $Audit.objectName
			$Table.Cell($xRow,5).Range.Font.size = 9
			$Table.Cell($xRow,5).Range.Text = $Audit.userName
			$Table.Cell($xRow,6).Range.Font.size = 9
			$Table.Cell($xRow,6).Range.Text = $Audit.path
		}
		$table.AutoFitBehavior(1)

		#return focus back to document
		Write-Verbose "$(Get-Date): `t`tReturn focus back to document"
		$doc.ActiveWindow.ActivePane.view.SeekView=$wdSeekMainDocument

		#move to the end of the current document
		Write-Verbose "$(Get-Date): `tMove to the end of the current document"
		$selection.EndKey($wdStory,$wdMove) | Out-Null
		Write-Verbose "$(Get-Date):"
	}
}

The Audit Trail report for my lab.

Audit Trail Report

Audit Trail Report

Script version is now 4.12. And thanks to Shane, the script is now 500 lines longer! Man that was a lot of late night typing. :)

NOTE: This script is continually updated. You can always find the most current version by going to http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

Thanks

Webster

You just finished reading PVS V4.1 Documentation Script Has Been Updated 2-FEB-2014 on Carl Webster. Please consider leaving a comment!

Citrix XenDesktop 7.5, Provisioning Services 7.1 and the XenDesktop Setup Wizard with Write Cache and Personal vDisk Drives

$
0
0

The original article I wrote for XenDesktop 7.1 and PVS 7.1 has proven to be extremely popular.  Several people have asked for an article that uses XenDesktop 7.5.  This article will show the same process as the original article but use XenDesktop 7.5 and show what differences there are, if any. Recently I worked on a project where the customer required the use of a Write Cache drive and a Personal vDisk (PvD) drive with XenDesktop 7.1 using Provisioning Services (PVS) 7.1.  Getting information on the process to follow was not easy and, as usual, the Citrix documentation was sorely lacking in details.  As with most things involving XenDesktop and or PVS, there is NO one way or one right way to do anything.  This article will give you detailed information on the process I worked out and documented and now updated for XenDesktop 7.5. This article is not about the pros and cons of PvD.  It is simply about what process can be used to create virtual desktops that require the use of a Write Cache drive and PvD.  I will not be discussing the overhead of PvD or the delay it brings to the startup, shutdown and restart processes or the I/O overhead, the storage impact or the storage I/O requirements or what is needed for High Availability or Disaster Recovery needs for PvD. Assumptions:

  1. PVS 7.1 is installed, configured and a farm created.
  2. XenDesktop 7.5 is installed and a Site created and configured.
  3. Hosting resources are configured in Studio.
  4. PXE, TFTP and DHCP are configured as needed.

All servers in my lab are running Microsoft Windows Server 2012 R2 fully patched.  The lab consists of:

  • 1 PVS 7.1 server
  • 1 server running Studio
  • 1 SQL 2012 SP1 Server
  • 1 Windows 7 SP1 VM

I am using XenServer 6.2 fully patched for my hosting environment.  There are separate Storage Repositories for the Virtual Machines (VM), PvD and Write Cache as shown in Figure 1.

Figure 1

Figure 1

The Hosting Resources are configured in Studio as shown in Figure 2.

Figure 2

Figure 2

To start off, in my lab I created my Organization Unit (OU) structure in Active Directory (AD) for my domain WebstersLab.com as shown in Figure 3.

Figure 3

Figure 3

One of the reasons to use PvD is to allow users to install applications.  In order to do this I created an AD security group, shown in Figure 4, that will contain the AD user accounts and that AD security group will be made a member of the local Administrators security group.

Figure 4

Figure 4

Three AD user accounts were created, shown in Figure 5, for the three different PvD users for this article.

Figure 5

Figure 5

Those three test user accounts were placed in the LocalAdmins AD security group as shown in Figure 6.

Figure 6

Figure 6

Most organizations that use XenDesktop to serve virtual desktops or servers require that Event Logs persist between reboots or the security team sits in the corner crying.  Other items that may need to persist between desktop/VM reboots are antivirus definition files and engine updates.  To accomplish these a Group Policy with Preferences is used.  Why not manually change the file system and registry?  Because the XenDesktop setup wizard completely ignores all the careful work done by creating folders on the Write Cache drive.  When the Write Cache and PvD drives are created, they are empty and will NOT carry over ANY of the manual work done before hand.  So just forget about doing any of the items usually done by pre creating a Write Cache drive. The Write Cache drive is always created as Drive D and the PvD is created with the drive letter assigned during the Wizard. My Group Policy with Preferences is linked at the OU that will contain the computer accounts created by the XenDesktop Setup Wizard.  These are the settings in the policy used for this lab.

  • Computer Configuration\Policies\Administrative Templates\Windows Components\Event Log Service\Application\Control the location of the log file – Enabled with a value of D:\EventLogs
  • Computer Configuration\Policies\Administrative Templates\Windows Components\Event Log Service\Security\Control the location of the log file – Enabled with a value of D:\EventLogs
  • Computer Configuration\Policies\Administrative Templates\Windows Components\Event Log Service\System\Control the location of the log file – Enabled with a value of D:\EventLogs
  • Computer Configuration\Preferences\Folder – Action: Update, Path: D:\EventLogs
  • Computer Configuration\Preferences\Control Panel Settings\Local Users and Groups – Action: Update, Group name: Administrators (built-in), Members: ADD, <DomainName>\<Security Group Name>
  • User Configuration\Policies\Administrative Templates\Start Menu and Taskbar\Remove the Action Center icon – Enabled
  • These settings will:
  • Keep the user from getting all those popups from the Action Center
  • Create the EventLogs folder on drive D (the Write Cache drive)
  • Redirect the Application, Security and System event logs to the new D:\EventLogs folder
  • Add the domain security group that contains use accounts who should be local admins to the desktop’s local Administrators group

Next up is to create a Windows 7 VM to be used as the Master or Golden image.  Do just basic configuration of the VM at this time.  Do not install any applications at this time. Citrix provides a PDF explaining how to optimize a Windows 7 image. http://support.citrix.com/servlet/KbServlet/download/25161-102-648285/XD%20-%20Windows%207%20Optimization%20Guide.pdf Once the basic VM is built there are four things that need done before joining the VM to the domain.

  1. Fix the WMI error that is the Application event log.  I know it is not a critical error but I am OCD and simply must have error free event logs.  Run the Mr. FixIt (this one actually works) from http://support.microsoft.com/kb/2545227.
  2. Install the hotfix for using a VMXNet3 network card in ESXi.  Request and install the hotfix from http://support.microsoft.com/kb/2550978.
  3. From an elevated command prompt, run WinRM QuickConfig.  This allows the desktops to work with Citrix Director.
  4. Disable Task Offload by creating the following registry key:
  5. HKLM\CurrentControlSet\Services\TCPIP\Parameters\
  6. Key: “DisableTaskOffload” (dword)
  7. Value: 1

The Write Cache drive will become drive D when it is created so before installing any software change the CD drive letter from D to another letter.  I use Z. The VM is ready to join the domain.  After joining the domain, shutdown the VM. Now two hard drives need to be added to the VM.  One for the Write Cache drive and the other for the PvD drive.  NOTHING will be done to these drives, they are just sub holders so Windows knows there should be two additional drives.  The Write Cache and PvD drive should (dare I say must) be different sizes or strange things can happen.  If they are the same size, it is possible the write cache file and page file can be placed on the PvD drive and not the Write Cache drive.  To make your life easier, keep the drives different sizes.  For this article, I will use a 10GB Write Cache drive and a 20GB PvD drive. Make sure the new drives are created in the proper storage locations as shown in Figures 7 through 9.

Figure 7

Figure 7

Figure 8

Figure 8

Figure 9

Figure 9

Power on the VM, login with a domain account, start Computer Management and click on Disk Management as shown in Figure 10.

Figure 10

Figure 10

Click OK to initialize the two new drives as shown in Figure 11.

Figure 11

Figure 11

The two new drives appear in Disk Management as shown in Figure 12.

Figure 12

Figure 12

Leave the drives unformatted and exit Computer Management. At this time, any software and updates needed can be installed.  After all software and updates are installed, mount the PVS 7.1 ISO to the VM, open My Computer and double-click the CD.  When the PVS installer starts, click Target Device Installation on both screens as shown in Figures 13 and 14. Note:  As this article was written, there is an update available for the PVS 7.1 Target Device Software.  You may need to check if there is an update available for your language and bitness of your client VM.  To install the Target Device Software update, please see this article.

Figure 13

Figure 13

 

Figure 14

Figure 14

Note: At this point, the installation process is the same for the Target Device Software from the ISO file and the updated software you may download from Citrix.  I am installing the update for this article. Follow the Installation Wizard to install the PVS Target Device Software. On the last page of the Installation Wizard, leave Launch Imaging Wizard selected and click Finish as shown in Figure 15.

Figure 15

Figure 15

You can exit the PVS Installer screen and unmount/disconnect the PVS 7.1 ISO from the VM’s CD drive. Click Next on the Imaging Wizard as shown in Figure 16.

Figure 16

Figure 16

Enter the name or IP address of a PVS Server, select the option for Credentials and click Next as shown in Figure 17.

Figure 17

Figure 17

To Create new vDisk, click Next as shown in Figure 18.

Figure 18

Figure 18

Enter a vDisk name, Store, vDisk type and click Next .as shown in Figure 19.

Figure 19

Figure 19

Select the licensing type and click Next as shown in Figure 20.

Figure 20

Figure 20

Verify only the C drive is selected and click Next as shown in Figure 21.

Figure 21

Figure 21

Enter a Target device name, select the MAC address, select the target device Collection and click Next as shown in Figure 22.

Figure 22

Figure 22

Click Optimize for Provisioning Services as shown in Figure 23.

Figure 23

Figure 23

Verify all checkboxes are selected and click Next as shown in Figure 24.

Figure 24

Figure 24

Depending on the .Net Framework versions installed on the VM, the optimization process could take from less than a second to over an hour.  Once the process has completed click Finish as shown in Figure 25.

Figure 25

Figure 25

The vDisk is created as shown in Figure 26.

Figure 26

Figure 26

Once the vDisk is created, a Reboot popup appears as shown in Figure 27.  DO NOT reboot at this time.  Depending on your hypervisor, you may need to shutdown to make the next change.  The VM needs to be configured to boot from the network first and the hard drive second.  If this change can be made while the VM is running, make the change and click Yes.  If not, click No, shutdown the VM, make the change and power the VM on to continue.

Figure 27

Figure 27

Before we continue, what did the Imaging Wizard do inside of PVS? First, a vDisk was created as shown in Figure 28.

Figure 28

Figure 28

Second, a Target Device was created, as shown in Figure 29, with the MAC address of the VM, linked to the vDisk just created and the Target Device is configured to boot from its hard disk because the vDisk is empty right now.

Figure 29

Figure 29

Once the VM has been configured to boot from the network first and the hard drive second, either power on the VM or click Yes to reboot the VM as previously shown in Figure 27. When the VM is at the logon screen, logon with the same domain account and the Imaging Wizard process continues as shown in Figure 30.

Figure 30

Figure 30

When the Imaging Wizard process is complete, click Finish, as shown in Figure 31, and shutdown the VM. Note: If there are any errors, click Log, review the log, correct any issues and rerun the Imaging Wizard.

Figure 31

Figure 31

What has happened is that the Imaging Wizard has now copied the contents of the VM’s C drive into the vDisk.  That means the C drive attached to the VM is no longer needed.  Detach the C drive from the VM as shown in Figures 32 and 33.  DO NOT DELETE the C drive, just detach it.

Figure 32

Figure 32

Figure 33

Figure 33

Now that the VM has no C drive, how will it boot? In the PVS console, go to the Target Device, right-click and select Properties as shown in Figure 34.

Figure 34

Figure 34

Change the Boot from to vDisk as shown in Figure 35.

Figure 35

Figure 35

The vDisk contains everything that was on the original C drive and the vDisk is still set to Private Image mode.  That means everything that is done to the vDisk is the same as making changes on the original C drive.  Any changes made now will persist.  When the vDisk is changed to Standard Image mode, the vDisk is placed in read-only mode and no changes can be made to it. Before the VM is powered on, an AD Machine Account must be created.  Right-click the target device, select Active Directory and then Create Machine Account… as shown in Figure 36.

Figure 36

Figure 36

Select the Organization unit from the dropdown list as shown in Figure 37.

Figure 37

Figure 37

Once the correct Organization unit has been selected, click Create Account as shown in Figure 38.

Figure 38

Figure 38

When the machine account is created, click Close as shown in Figure 39.  If there is an error reported, resolve the error and rerun the process.

Figure 39

Figure 39

Power on the VM and logon with domain credentials. Open Computer Management and click on Disk Management.  Here you can see the holders for the 10GB Write Cache and 20GB PvD drives and the C drive (which is the vDisk) as shown in Figure 40.

Figure 40

Figure 40

Exit Computer Management. The XenDesktop 7.5 Virtual Delivery Agent (VDA) needs to be installed.  Mount the XenDesktop 7.5 ISO to the CD.  Double-click the CD drive and the XenDesktop installation wizard starts.  Click Start for XenDesktop as shown in Figure 41. Note: At this time, PvD is only supported for desktop operating systems.  PvD will not work and is not supported for XenApp 7.5.

Figure 41

Figure 41

Select Virtual Delivery Agent for Windows Desktop OS as shown in Figure 42.

Figure 42

Figure 42

Select Create a Master Image and click Next as shown in Figure 43.

Figure 43

Figure 43

Select the appropriate HDX 3D Pro option and click Next as shown in Figure 44.

Figure 44

Figure 44

Verify Citrix Receiver is selected and click Next as shown in Figure 45.

Figure 45

Figure 45

Enter the Fully Qualified Domain Name of a XenDesktop 7.5 Controller, click Test connection and, if the test is successful (a green check mark is displayed), click Add as shown in Figures 46 and 47.  Repeat until all XenDesktop 7.5 Controllers are entered.  Click Next when all Controllers are added.

Figure 46

Figure 46

Figure 47

Figure 47

Verify all options are selected and click Next as shown in Figure 48.

Figure 48

Figure 48

Select the appropriate firewall rules option and click Next as shown in Figure 49.

Figure 49

Figure 49

Click Install as shown in Figure 50.

Figure 50

Figure 50

The VDA installation starts as shown in Figure 51.

Figure 51

Figure 51

When the VDA installation completes, verify Restart machine is selected and click Finish as shown in Figure 52.

Figure 52

Figure 52

Disconnect/unmount the XenDesktop 7.5 ISO from the CD.

Note: Citrix updates the Personal vDisk software often.  At the time this article was released, 14-Jul-2014, there was no update to the Personal vDisk software.

To check for an available update, in your browser, go to http://www.mycitrix.com and logon with MyCitrix.com credentials.

Click on Downloads, select XenDesktop and Components from the two dropdowns.  See if there is any update for XenDesktop 7.5.  If there is, download and install the Personal vDisk update.

Log back in to the desktop with domain credentials. By default, PvD uses two drive letters: V and P.  V is hidden and is a merged view of the C drive with the PvD drive.  If drive V is already used, the drive letter can be changed. If needed, change the hidden PvD drive letter:

  • Key : HKEY_LOCAL_MACHINE\Software\Citrix\personal vDisk\Config
  • Value : VHDMountPoint [REG_SZ]
  • Set this to the drive letter of your choice. Ensure that “:\” is appended to the end of your entry (Example: X:\ )

Everything is now complete. Before running the PvD Inventory, follow your standard procedure for sealing the image.  This process is unique to every environment.  For my lab, I have no antivirus software and I am not using WSUS so I have no registry keys to clear out. Manually run the PvD Inventory.  Click Start, All Programs, Citrix, Update personal vDisk as shown in Figure 53.

Figure 53

Figure 53

The PvD inventory starts.  Leave Shut down the system when update is complete selected as shown in Figure 54.

Figure 54

Figure 54

After the inventory completes, the VM is shutdown. Make a copy of the VM and create a template of the copy.  That way the original VM is still available just in case. When making the template, make sure the template is stored on a storage location that is available when running the XenDesktop Setup Wizard.  Since the C drive was detached, that leaves the Write Cache and PvD storage locations.  If you do not, an error “<host resource> has no available templates defined that are fully accessible by all hosts” is displayed during the XenDesktop Setup Wizard. In the PVS console, click on the vDisk Pool node, right-click the vDisk and select Properties as shown in Figure 55.

Figure 55

Figure 55

Change the Access mode to Standard image and Cache type to Cache on device hard drive as shown in Figure 56. Note: If you leave the Cache type at the default of Cache on server, when you run the XenDesktop Setup Wizard there will not be an option to configure the Write Cache drive size. Note: I am using Cache on device hard drive for this article.  With PVS 7.1, Cache in device RAM with overflow on hard disk is now the popular option.  I highly recommend you read the following two articles by Dan Allen before making a decision on the Cache Type to use:

  1. Turbo Charging your IOPS with the new PVS Cache in RAM with Disk Overflow Feature! – Part One
  2. Turbo Charging your IOPS with the new PVS Cache in RAM with Disk Overflow Feature! – Part Two

 

Figure 56

Figure 56

Right-click the Site and select XenDesktop Setup Wizard as shown in Figure 57.

Figure 57

Figure 57

Click Next as shown in Figure 58.

Figure 58

Figure 58

Enter the name of a XenDesktop 7.5 Controller and click Next as shown in Figure 59.

Figure 59

Figure 59

Select the host resource from those configured in Citrix Studio and click Next as shown in Figure 60.

Figure 60

Figure 60

Enter the logon credentials for the host resource and click OK as shown in Figure 61.

Figure 61

Figure 61

Select the appropriate template and click Next as shown in Figure 62.

Figure 62

Figure 62

Select the vDisk and click Next as shown in Figure 63.

Figure 63

Figure 63

Select whether to Create a new catalog or Use an existing catalog and click Next as shown in Figure 64.  If you Create a new catalog, enter a Catalog name and Description.

Figure 64

Figure 64

Select Windows Desktop Operating System and click Next as shown in Figure 65.

Figure 65

Figure 65

Since we are using PvD, select The same (static) desktop, also select Save changes and store them on a separate personal vDisk and click Next as shown in Figure 66.

Figure 66

Figure 66

Make the appropriate choices.  For this lab, I am creating 3 VMs (desktops) with 2 vCPUs, 2 GB RAM, a 10GB write cache disk, a 20 GB PvD disk and changing the PvD drive to Y.  Click Next as shown in Figure 67. Note: If you do not see the option Local write cache disk that means you left the vDisk at the default of Cache on server.  Exit this wizard, correct the vDisk properties and rerun the wizard.

Figure 67

Figure 67

Select Create new accounts to have new AD computer accounts created and click Next as shown in Figure 68.

Figure 68

Figure 68

Select the Domain, OU, Account naming scheme and click Next as shown in Figure 69.

Figure 69

Figure 69

Click Finish, as shown in Figure 70, and the wizard will begin creating VMs, desktops and target devices.

Figure 70

Figure 70

When the wizard is complete, click Done as shown in Figure 71.

Figure 71

Figure 71

Looking at the Device Collect in the PVS console shows the three target devices with only one powered on at this time as seen in Figure 72.

Figure 72

Figure 72

Looking in Active Directory Users and Computers shows the new computer accounts as seen in Figure 73.

Figure 73

Figure 73

In Citrix Studio, right-click on the Machine Catalogs node and select Refresh.  The new Machine Catalog created by the XenDesktop Setup Wizard is shown in Figure 74.

Figure 74

Figure 74

Currently there is no Delivery Group to deliver the desktops.  Right-click the Delivery Groups node in Citrix Studio and select Create Delivery Group as shown in Figure 75.

Figure 75

Figure 75

Click Next as shown in Figure 76.

Figure 76

Figure 76

Select the Machine Catalog and the number of machines to be added from the catalog to this delivery group and click Next as shown in Figure 77.

Figure 77

Figure 77

Select Desktops and click Next as shown in Figure 78.

Figure 78

Figure 78

Click Add users… as shown in Figure 79.

Figure 79

Figure 79

Use the Select Users or Groups dialog to add users and click OK as shown in Figure 80.

Figure 80

Figure 80

Click Next as shown in Figure 81.

Figure 81

Figure 81

Select the appropriate StoreFront option and click Next as shown in Figure 82.

Figure 82

Figure 82

Enter a Delivery Group name, Display name, an optional Delivery Group description for users and click Finish as shown in Figure 83.

Figure 83

Figure 83

From here, there are many options that can be configured.  For this lab, I edited the Delivery Group and set both Weekdays and Weekend peak hours to 24 hours as shown in Figure 84.

Figure 84

Figure 84

Every XenDesktop project I have been on, the customer wants all desktops powered on at all times.  To do this, on a Controller start a PowerShell session and enter the following commands as shown in Figure 85: add-pssnapin *citrix* Get-brokerdesktopgroup | set-brokerdesktopgroup -PeakBufferSizePercent 100 Note: I had a reader leave me a comment on the original article that said this setting does not apply to user assigned desktops.  But, I never got more than one desktop to start (out of the three in my lab) until I set the PeakBufferSizePercent.  As soon as I entered that command, within a few seconds the other two desktops powered on.

Figure 85

Figure 85

Exit the PowerShell session. After a few minutes, all the desktops will power on.  The desktops will reboot, I think, two times before they are ready for users to login. Back in the PVS console, the vDisk will show three connections and all three target devices will be powered on as shown in Figures 86 and 87.

Figure 86

Figure 86

Figure 87

Figure 87

Now let us look at how the Write Cache and PvD drives work. All three desktops are powered on.  I will log in as a different user into each desktop. All three users are presented with the standard Windows 7 desktop configured during the creation of the master image VM as shown in Figure 88.

Figure 88

Figure 88

Before we take a look at user customization and personalization, let’s see what is on the Write Cache and PvD drives.  I had to show system and hidden files and operating system files. Figure 89 shows the Write Cache drive which shows the write cache file, page file and the EventLogs folder.

Figure 89

Figure 89

Figure 90 shows there is not much of anything useful to see on the PvD drive.

Figure 90

Figure 90

Back in Citrix Studio, refresh the Delivery Group and you will see there are now Sessions in use with no Unregistered or Disconnected machines as shown in Figure 91.

Figure 91

Figure 91

Double-click the Delivery Group to see detailed information as shown in Figure 92.

Figure 92

Figure 92

The first user is Ms. Know-It-All who probably knows Windows 7 better than the helpdesk team.  She configures her desktop to get all the Windows 7 “frilly” stuff out of her way as shown in Figure 93.

Figure 93

Figure 93

The second user is Ms. Tree Hugger who wants a pretty picture for her background as shown in Figure 94.

Figure 94

Figure 94

The third user is Ms. Artsy Fartsy who wants a background that changes as shown in Figure 95.

Figure 95

Figure 95

Now that each user has customized their desktop, reboot each desktop, log back in to each desktop and verify the user’s customizations persisted. What about installing software?  User1 installed NotePad++ since she knows more than you do anyways, User2 installed Google Chrome to save the world from Internet Exploder and User3 installed IrfanView so she could do some artsy fartsy type work.  The three desktops are shown in Figures 96 through 98.

Figure 96

Figure 96

 

Figure 97

Figure 97

 

Figure 98

Figure 98

Now that each user has installed an application, reboot each desktop, log back in to each desktop and verify the user’s installed application persisted. Since we are using PvD to allow users to install applications, where are the applications installed? Looking at User1, we can see that Notepad++ was installed to c:\Program Files\Notepad++ as shown in Figure 99.

Figure 99

Figure 99

User2′s Google Chrome is installed to C:\Program Files\Google\Chrome as shown in Figure 100.

Figure 100

Figure 100

User3′s IrfanView is installed to C:\Program Files\IrfanView as shown in Figure 101.

Figure 101

Figure 101

The C drive view is a combination of the hidden drive, V by default, and C.  When users install applications they will install as usual to the C drive.  There is no need to install to the visible PvD drive, P by default. How is the master image updated if an application needs to be installed that all users need?  Simple, in the PVS console create a Maintenance version, update it and then make it available to users. In the PVS console, right-click the vDisk and select Versions as shown in Figure 102.

Figure 102

Figure 102

Click New as shown in Figure 103.

Figure 103

Figure 103

A new Maintenance version of the vDisk is created as shown in Figure 104.  Click Done.

Figure 104

Figure 104

In the PVS console, go to the Device Collection the original master target device is in, right-click the target device and click Properties as shown in Figure 105.

Figure 105

Figure 105

Change the Type from Production to Maintenance and click OK as shown in Figure 106.

Figure 106

Figure 106

In the hypervisor, start that VM and open the VM’s console.  An option to boot into either the Production vDisk or the Maintenance vDisk is shown.  Select the Maintenance vDisk as shown in Figure 107.

Figure 107

Figure 107

What has happened is that the target device has been configured to boot from a Maintenance image and during the bootup communication, the PVS server recognized the MAC address and offered the target device the maintenance vDisk to boot from.  The maintenance vDisk is in Read/Write mode so changes can be made to the vDisk. Login to the desktop with domain credentials.  I installed Adobe Acrobat Reader as shown in Figure 108. Note: Whatever software is installed, verify that any license agreements and popups are acknowledged and any other configurations needed are done before sealing the image and running the PvD Inventory.  For Acrobat, I acknowledged the license agreement and disabled updater.

Figure 108

Figure 108

Before running the PvD Inventory, follow your standard procedure for sealing the image.  This process is unique to every environment.  For my lab, I have no antivirus software and I am not using WSUS so I have no registry keys to clear out. Manually run the PvD Inventory.  Click Start, All Programs, Citrix, Update personal vDisk as shown in Figure 109.

Figure 109

Figure 109

The PvD inventory starts.  Leave Shut down the system when update is complete selected as shown in Figure 110.

Figure 110

Figure 110

After the inventory completes, the VM is shutdown. Once the VM has shut down, in the PVS console, right-click the vDisk and select Versions as shown in Figure 111.

Figure 111

Figure 111

Select the Maintenance version and click Promote as shown in Figure 112.

Figure 112

Figure 112

Select Production, Immediate and click OK as shown in Figure 113.

Figure 113

Figure 113

The updated vDisk is now available for use as shown in Figure 114.  Click Done.

Figure 114

Figure 114

Restart the desktops for them to start using the updated vDisk.  The desktops will automatically reboot after a few minutes.  This is normal.  Wait until this reboot is complete before allowing the users access to the desktop. Log in to each desktop and verify the new application is available and the user’s original customizations and installed applications persisted after the update. The three desktops are shown in Figures 115 through 117.

Figure 115

Figure 115

Figure 116

Figure 116

Figure 117

Figure 117

And there you have it, one way to do a XenDesktop 7.5 with personal vDisk process. Citrix lists four ways to do this process in eDocs, three with PVS and one with MCS.  http://support.citrix.com/proddocs/topic/provisioning-7/pvs-inventory-vdisks-pvd.html I think it is strange they have MCS listed as a process in the PVS documentation but that is beside the point. I hope this detailed process explanation will help you in working with PvD with XenDesktop 7.5 and PVS 7.1. Thanks Webster

You just finished reading Citrix XenDesktop 7.5, Provisioning Services 7.1 and the XenDesktop Setup Wizard with Write Cache and Personal vDisk Drives on Carl Webster. Please consider leaving a comment!

HP Moonshot – Lessons Learned and Tips from My First HP Moonshot and Citrix XenDesktop Proof of Concept

$
0
0

Recently, I was involved in my first HP Moonshot Proof of Concept (PoC). HP Moonshot is a fairly new technology that can be used to provide hosted desktops to users with Citrix XenDesktop 7.x.  If you are not familiar with Moonshot, I would recommend you watch this excellent video by Dane Young at the Experts 2 Experts Virtualization Conference from May 2014 in Los Angeles.  Citrix and HP also have excellent blogs and articles as well that you can review. In this article, I will show you some of the lessons I learned and some tips for working with Moonshot.

#1: Physical Delivery is Different

Forget most of what you know about delivering virtual desktops when working with Moonshot.  Moonshot desktops are physical and require a new way of thinking if you have not worked with delivering streamed images to physical computers before.

  1. Moonshot, with XenDesktop, works with Citrix Provisioning Services (PVS) only.
  2. There is no hypervisor needed for Moonshot desktops.
  3. No Hosting connection is created in Citrix Studio.
  4. The XenDesktop Setup Wizard nor the Streaming VM Wizard in PVS are used.

These four concepts were definitely new to the Citrix Support people I worked with.  It took quite of bit of patience on my part to instruct them on using PVS and XenDesktop with physical desktops.

#2: Get Organized; Get a Tool

I used Devolutions Remote Desktop Manager to make my life easier.  I configured PuTTY sessions for the Moonshot chassis and both Moonshot switches as well as Remote Desktop sessions for many of the nodes and the Citrix and Microsoft infrastructure servers as shown in Figure 1.

Figure 1

Figure 1

This allowed me to have access to all my sessions from a tabbed interface instead of having multiple PuTTY and Remote Desktop sessions scattered over my desktop.

Before We Get to Items #3, 4 and 5

Read items 3, 4 and 5 and then I will explain why they are in this article.

#3: NIC Teaming…Not So Good

If multiple networks and or VLANs are used and VLAN tagging is used, do not even think of using Broadcom NIC Teaming.  If CTX140338 had mentioned that limitation, we would not have lost days of work trying to get NIC teaming to work.  CTX140338 simply states, “This is an enhancement to facilitate NIC teaming with the latest Broadcom NICs used in HP Moonshot systems.”  If one line had been added that stated “NIC teaming is supported only if a single network with no VLAN tagging is used,” we would have known from the start of the PoC to not use NIC teaming.

HP and Citrix are working to resolve the VLAN tagging issue so please refer to the latest HP Getting Started Guide for the most up-to-date information.

More on this in #5 below.

#4: Don’t Click Cancel

If you are using just a single network with no VLAN tagging and you want to use NIC teaming, from our experience, the end-user experience will not pass the smell test.  That means, while NIC teaming “works”, the end-user experience leaves much to be desired.  Following the instructions on page 117 in the HP ConvergedSystem 100 for Hosted Desktops Getting Started Guide, the NIC teaming configuration is backed up and then restored after the vDisk is streamed.  What I found out is that during the restore, when the team is created and configured the desktop loses connection to the PVS server.  That means the user will see a message saying the connection to the desktop has been lost and will be retried in 30 seconds.  The user will also be given two choices: Retry or Cancel.  This will be a helpdesk nightmare, especially if the user clicks Cancel. In my testing, I found two things will happen if you let StoreFront and Studio handle the process:

  • After about two minutes, the desktop starts.
  • After about three minutes, you realize nothing has happened, and the user must click the desktop’s icon to get it to launch.

Bottom line, if you are willing to have users and helpdesk staff hate you, use NIC teaming.  If you are willing to add confusion to the desktop startup process, use NIC teaming.  If you are willing to add two to six minutes to the login and desktop startup process, use NIC teaming.

HP is working on improving the NIC teaming functionality and vast changes are around the corner.

#5: NIC Teaming + HP Velocity

Note: What is HP Velocity? HP Velocity is a software solution that improves the user experience for remote desktop and virtualized applications by addressing common network bottlenecks, such as packet loss, network latency and WiFi congestion.

If you still want to use NIC teaming AND you are using HP thin clients with HP Velocity installed, do NOT install the HP Velocity driver in your image. HP Velocity and the Broadcom NIC teaming software do not play well together.  When you configure the NIC team, as soon as you click Commit Changes, your image is unrecoverable.  It appears the Velocity driver creates a loop and the Broadcom software cannot recover.  The only way to recover is to reload Windows and rebuild your image.

As soon as we figured out there was a conflict between the Velocity software and the Broadcom software, HP Labs, the Velocity team and others at HP immediately became involved in getting the issue resolved and a fix was made available.

The HP Velocity team is aware of the issue and is developing a fix for Moonshot.  The issue revolves around the physical and virtual “bond” building a loopback with the Velocity driver. The HP Velocity team has a fix available now, but it requires booting Windows into Safe Mode.  Since Moonshot is a headless system, there is no way to have Windows boot into Safe Mode. The HP Lab team was able to provide a quick work around by providing a custom installer that corrects the issue (albeit beta code); however, a permanent fix is under development.

Explaining Items #3, 4 and 5

Item 3, 4 and 5 exist only because:

  1. The customer wanted to use HP Velocity, and
  2. We did not know HP Velocity and Broadcom NIC teaming had not been tested together by HP, and
  3. We did not know that the PVS Target Device Software did not support how we wanted to use NIC teaming, and
  4. If we had known we couldn’t use NIC teaming, then we could have used HP Velocity and
  5. Not bothered with NIC teaming, and then
  6. Items 3, 4 and 5 would have been nonevents and never written about.

#6: Persistent ≠ Persistent

What the Moonshot documentation calls a Persistent Desktop is not what XenDesktop calls a Persistent Desktop.

With XenDesktop, a Persistent Desktop is one in which a user’s settings and or user installed applications persist between reboots.  A Moonshot Persistent Desktop is where Windows Deployment Services (WDS) installs a full Windows build on every node in the Moonshot chassis.  The Moonshot Persistent Desktops are then managed like regular physical Windows desktops.

#7: Update Passwords

One of the first things to be done after the Moonshot chassis is powered on is to update the firmware.   But before you can update the firmware, passwords are needed for the two switches’ Admin and Enable accounts.  After those passwords are set, you can run the new HPSum.bat file to update all the firmware.  HPSum.bat is the new automated way to update Moonshot’s firmware and is included in the Moonshot Component Pack.  If the switch Admin and Enable passwords are not set, the HPSum process will run but at the end will report it was unable to verify the passwords and you will have just lost 1.5 to 5.25 hours of time.  Update the passwords first, next run HPSum.bat and then continue on with the Chassis and Switch configurations.

It takes roughly five minutes per device to update the firmware.  The minimum number of cartridges in a Moonshot chassis is 15 plus the 2 switches and the Moonshot chassis or 18 devices.  18 * 5 = 90 minutes to update firmware.  30 cartridges plus the 2 switches and the Moonshot chassis (33 * 5 = 165 minutes) will take 2.75 hours to update firmware.  A full chassis will take 5.25 hours.  Those times are based on what we saw.  Your mileage may vary.

#8: CPU Speed

Once the firmware has been updated, set the CPU Speed for all nodes.

set node power off shutdown all
set node options cpu 1.8 all
set node power on all

If you are not sure what CPU speed settings are available, set it to a wrong value and the correct values will be displayed as shown in Figure 2.

Figure 2

Figure 2

#9: Documentation

The Moonshot documentation does not always match the Moonshot help text.  I found several misstatements that I was able to report to my Citrix contact who then reported them to the HP Moonshot team. I was told that HP would correct the documentation. For example, Powercap mode 1 is not the default.  For us, Mode 0 was the default.    If you have four power supplies, use Powercap Mode 2.

set chassis powercap mode 2

#10: Answer Files

Moonshot requires WDS to install the Windows images onto the nodes.  Windows System Image Manager (SIM) is used to manage the Client and Image unattended answer files provided by HP.  Moonshot is a headless system so there is no video, keyboard or mouse to interact with a full Windows installation process.  The two answer files are necessary but troubleshooting them can be a royal PITA.  I recommend you use a regular Windows VM to do a test install of the customized Moonshot Windows installation.  You do not care if the Windows installation actually runs, you are worried about getting past the point where the answer files are no longer used.  Once Windows is installed to the VM, you know the answer files “should” work and you can proceed to installing Windows onto the first Moonshot node.

HP recommends using SIM so that any passwords entered are stored encrypted in the answer files.

A few issue we ran across:

  • The answer files contain several XXXXXXXX lines that need to be replaced with the registered organization and user name.  Even though we had that information entered, the image still had the XXXXXXXX for registered company and user.
  • Even though we had the necessary credentials entered and the checkbox selected in WDS to enable joining the image to the domain, the domain was never joined.
  • The time zone was never set.

Note: Make sure the Product Key you enter matches the ISO file type.  For example, a Volume License ISO file will not work with an MSDN Product Key.  If the product key does not match the ISO type, the following error (formatted for this article) is given:

Error message:
2014-09-05 05:00:00, Info         IBSLIB PublishCriticalError:
Publishing critical error message
[Windows could not parse or process the unattend answer file
for pass [specialize].
The settings specified in the answer file cannot be applied.
The error was detected while processing settings for component
[Microsoft-Windows-Shell-Setup].]"

This is an easy error to spot if a regular VM is used to test the answer files.

#11: Registry Hacks for PVS

Again, since Moonshot is a headless system, using PVS Maintenance and Test versions will be a royal PITA unless you use the registry setting described in CTX135299 on every PVS server.  It is either that or give every Maintenance and Test user PuTTY access to the Moonshot chassis so they can access the virtual serial port on the node the Maintenance and Test target devices are attached to.

Rather than have to manually set a registry key on every PVS server, I would prefer an option in the PVS console to make this change.

#12: No Storms Here

Two of the main issues XenDesktop architects, engineers and administrators dread with virtual desktops are boot storms and login storms.  Those two items are no longer a concern with Moonshot.  If you did:

set node power on all

in a Moonshot chassis with 180 nodes, the power on sequence will not allow all 180 nodes to power on at the same time.  Each Moonshot node has a dedicated quad-core processer, dedicated 8GB of RAM, dedicated 32Gb or 64Gb of SSD local storage and two dedicated network ports.  The one thing every node shares is the BIOS.  I have been given a description of how the power -on sequence works but since that information is proprietary, I cannot share it.  If I get permission, I will update this article with the power-on sequence of events.

#13: Virtual Serial Port

In order to view a node’s boot process, Moonshot provides a Virtual Serial Port (VSP). This allows you to see the node’s power on sequence and the initial non-gui Windows boot process. After working for two weeks, the VSP stopped working. Fortunately, the solution is very simple and non-disruptive to any powered on nodes and desktops.

To view the VSP for a node:

set node power on <node>
connect node vsp <node>

If nothing appears in the VSP, there is a very simple fix.  Enter the following command:

reset cm

Note: “cm” is Chassis Manager.

That command will not affect any cartridges or any nodes currently running.  After a few minutes, you can reconnect to the Moonshot chassis using PuTTY and the VSP is back working.

#14: Changing the Drive Letter of the Write Cache Drive

By default, PVS assigns drive D to the write cache drive.  For a Moonshot node, its integrated SSD is disk 0 and, as disk drives do in Windows, has a unique ID.  If there is an application that requires the use of drive D then the write cache drive letter must be changed.  Using a hypervisor, adding an extra drive to a Virtual Machine (VM), creating a template and using that template when running the XenDesktop Setup Wizard makes changing the write cache drive to use a different drive letter fairly easy. No so when using physical devices.

Since each disk 0 has a unique ID, changing the drive letter of the write cache drive on the node used to create the master image does not make the drive letter change on another node whose disk 0 has its own unique id.  Citrix has an article that explains how to remedy this situation, for the most part.  If only one vDisk is ever created using only one node as the master, then the solution Citrix offers will work.  Their solution will not work if there are multiple vDisks created and or nodes need to boot from multiple vDisks whose master image uses different drive letters for the write-cache drive.

In Moonshot, if I create a master image using the node C1N1, its disk 0 will have a unique id.  If in that master image I change the write cache drive to letter W, the only way any other node will pick up the use of the letter W for the write cache drive is to change the unique id of its disk 0 to match the unique id from disk 0 in the master node.  Not really a big deal.  I can create a script or process that changes the unique id of disk 0 on say C5N1  to match the unique id of disk 0 from C1N1.  Now what if I need to create another master image, for testing purposes, on C16N1?  C16N1’s disk 0 will have its own unique id.  Now I cannot boot C5N1 from the vDisk created from C16N1 as the unique id that was replaced on disk 0 does not match the disk id of C16N1’s disk 0.  The write cache drive is now back to the default letter D and the application will not work because what should have been drive D is now drive E.

I don’t know many places that use only one vDisk for every device or every desktop offered to users.  I can see this effecting the ability drag and drop a vDisk on a device collection.  If the new vDisk has a different unique id for disk 0 than what the target device (Moonshot node) is already configured for, any application that requires specific files on the custom drive D will not work.

Maybe I am making a mountain out of a mole hill but this can be an issue when there are many vDisks and thousands or tens of thousands of nodes/desktops.

In the end, for this PoC, the customer decided to let PVS handle the D drive and will change their application configuration to use a different drive letter. It proved far easier to change the application than to change a default behavior of PVS.

You may be wondering what Write Cache option was selected for this PoC. We went with Cache to device RAM with overflow to disk and memory usage was set to 1024MB.

#15: Arghhh!

I will end with the two most frustrating things I encountered on this project.

1.  Dealing with Citrix support!!!!!

Talk about driving a person to want to drink something stronger than a Ginger Ale!!!  Sheez, dealing with Citrix support on Moonshot/PVS/XenDesktop issues is a lesson in futility because they apparently have not been trained in this area. Example:

Me: My desktops are not registering.

Ctx: OK, let’s rerun the XenDesktop Setup Wizard.

Me: My desktops are physical, there is no hypervisor involved.

Ctx: But you said you were using VSphere?

Me: Yes, we are using VSphere for the Citrix infrastructure like the Controller, StoreFront, Director and PVS.

Ctx: So there is a hypervisor involved!

Me: For the infrastructure, yes.  For the desktops, no.  We are using HP Moonshot which is physical so there is no hypervisor in use for the desktops.

Ctx: How can you use a hypervisor for the infrastructure but not for the desktops?  Why would you do that?

Me: Because XenDesktop and PVS work with physical devices.

Ctx: Since you do have VSphere, let’s rerun the XenDesktop Setup Wizard.

Me: You’ve got to be kidding me!!!

By the way, the issue with my desktops not registering was that in Studio only the machine account SID was showing, not the machine account name.  To resolve the issue, I:

    • Deleted the machines from the Delivery Group and Machine Catalog,
    • Deleted the Machine Accounts from Active Directory (AD) via PVS,
    • Created new Machine Accounts in AD via PVS, and
    • Added the Machines back in to the Machine Catalog and Delivery Group.

I know I should probably cut Citrix Support some slack since Moonshot is so new, right?  But, PVS and XenDesktop have supported streaming to physical devices for quite a while.  I know PVS has supported streaming to physical devices for a long time.  My first three PVS projects five years ago were using PVS 5.x to stream to physical XenApp servers.  My contention is that Citrix Support should be very familiar with using PVS to stream to physical devices with no hypervisor involved in the process.

 2.  NIC Teaming

For now, just say no!

Overall impressions:

I like Moonshot.  I like the hardware.  I like the concept.  I am amazed that HP can put that many “desktops” in one chassis and not have the chassis melt from all the heat.

For the use cases where it can be used, I believe it is a cost-effective and energy saving solution.  Having up to 180 desktops with dedicated CPU, memory, storage and networking in under 5U is quite impressive.  HP’s documentation, while not perfect, is very well done.  Their documentation (and videos) assumes a lot of knowledge and understanding the reader may not have.  I am already looking forward to my next Moonshot PoC.

I want to end by saying thanks to Tony Sanchez of Citrix (@TonySanchez_CTX), Dane Young of Atlantis (@YoungTech) and Jarian Gibson (@JarianGibson) of Choice Solutions for going way beyond the call of duty in helping me prepare for this project.  The Citrix and CTP communities rock.

I also want to thank Technical & Scientific Application, Inc. (TSA) for hiring me to do this PoC.  The people at TSA (@TSAIncorporated) I worked with on this project are some of the smartest and most helpful people I have ever come across.  Greg Tinker (@TinkerTwinsTech), William Howard and Harrison Travis are just freakishly smart.  Landon Fokens, well he’s a sales person.  What can I say except he sure paid for a lot of lunches? :)

I am not allowed to mention the customer but S.B. (@SBoggs), you are a superstar.  Thanks for putting up with all the stress and the NIC teaming nightmares, I mean, issues.

Thanks

Webster

You just finished reading HP Moonshot – Lessons Learned and Tips from My First HP Moonshot and Citrix XenDesktop Proof of Concept on Carl Webster. Please consider leaving a comment!

Citrix XenDesktop 7.6, Provisioning Services 7.6 and the XenDesktop Setup Wizard with Write Cache and Personal vDisk Drives

$
0
0

The original articles I wrote for XenDesktop 7.1 and PVS 7.1 and XenDesktop 7.5 and PVS 7.1 have proven to be extremely popular. This article will show the same process as the original articles but use XenDesktop 7.6 and PVS 7.6 and show what differences XenDesktop 7.6 and PVS 7.6 bring to the process.

Introduction

A while back, I worked on a project where the customer required the use of a Write Cache drive and a Personal vDisk (PvD) drive with XenDesktop 7.1 using Provisioning Services (PVS) 7.1. Getting information on the process to follow was not easy and, as usual, the Citrix documentation was sorely lacking in details. As with most things involving XenDesktop and or PVS, there is NO one way or one right way to do anything. This article will give you detailed information on the process I worked out and documented and now updated for XenDesktop 7.6 and PVS 7.6.

Assumptions:

  1. PVS 7.6 is installed, configured and a farm created.
  2. XenDesktop 7.6 is installed and a Site created and configured.
  3. Hosting resources are configured in Studio.
  4. PXE, TFTP and DHCP are configured as needed.

This article is not about the pros and cons of PvD. It is simply about what process can be used to create virtual desktops that require the use of a Write Cache drive and PvD. I will not be discussing the overhead of PvD or the delay it brings to the startup, shutdown and restart processes or the I/O overhead, the storage impact or the storage I/O requirements or what is needed for High Availability or Disaster Recovery needs for PvD.

Lab Setup

All servers in my lab are running Microsoft Windows Server 2012 R2 fully patched. The lab consists of:

  • 1 PVS 7.6 server
  • 1 XenDesktop 7.6 Controller running Studio
  • 1 SQL 2012 SP1 Server
  • 1 Windows 7 SP1 VM

I am using XenServer 6.2 fully patched for my hosting environment. There are separate Storage Repositories for the Virtual Machines (VM), PvD and Write Cache as shown in Figure 1.

Update: This has been tested with XenServer 6.5 with no changes or issues.

Figure 1

Figure 1

The Hosting Resources are configured in Studio as shown in Figure 2.

Figure 2

Figure 2

To start off, in my lab I created my Organization Unit (OU) structure in Active Directory (AD) for my domain, WebstersLab.com, as shown in Figure 3.

Figure 3

Figure 3

One of the reasons to use PvD is to allow users to install applications. In order to do this I created an AD security group, shown in Figure 4, that will contain the AD user accounts and that AD security group will be made a member of the local Administrators security group.

Figure 4

Figure 4

Three AD user accounts were created, shown in Figure 5, for the three different PvD users for this article.

Figure 5

Figure 5

Those three test user accounts were placed in the LocalAdmins AD security group as shown in Figure 6.

Figure 6

Figure 6

Most organizations that use XenDesktop to serve virtual desktops or servers require that Event Logs persist between reboots or the security team sits in the corner crying. Other items that may need to persist between desktop/VM reboots are antivirus definition files and engine updates. To accomplish these a Group Policy with Preferences is used. Why not manually change the file system and registry? Because the XenDesktop setup wizard completely ignores all the careful work done by creating folders on the Write Cache drive. When the Write Cache and PvD drives are created, they are empty and will NOT carry over ANY of the manual work done before hand. So just forget about doing any of the items usually done by pre creating a Write Cache drive. The Write Cache drive is always created as Drive D and the PvD is created with the drive letter assigned during the Wizard. My Group Policy with Preferences is linked at the OU that will contain the computer accounts created by the XenDesktop Setup Wizard. These are the settings in the policy used for this lab.

  • Computer Configuration\Policies\Administrative Templates\Windows Components\Event Log Service\Application\Control the location of the log file – Enabled with a value of D:\EventLogs\Application.evtx
  • Computer Configuration\Policies\Administrative Templates\Windows Components\Event Log Service\Security\Control the location of the log file – Enabled with a value of D:\EventLogs\Security.evtx
  • Computer Configuration\Policies\Administrative Templates\Windows Components\Event Log Service\System\Control the location of the log file – Enabled with a value of D:\EventLogs\System.evtx
  • Computer Configuration\Preferences\Folder – Action: Update, Path: D:\EventLogs
  • Computer Configuration\Preferences\Control Panel Settings\Local Users and Groups – Action: Update, Group name: Administrators (built-in), Members: ADD, <DomainName>\<Security Group Name>
  • User Configuration\Policies\Administrative Templates\Start Menu and Taskbar\Remove the Action Center icon – Enabled

These settings will:

  • Keep the user from getting popups from the Action Center
  • Create the EventLogs folder on drive D (the Write Cache drive)
  • Redirect the Application, Security and System event logs to the new D:\EventLogs folder
  • Add the domain security group that contains use accounts who should be local admins to the desktop’s local Administrators group

Create the Virtual Machine

Next up is to create a Windows 7 VM to be used as the Master or Golden image. Do just basic configuration of the VM at this time. Do not install any applications at this time.

Citrix provides a PDF explaining how to optimize a Windows 7 image. http://support.citrix.com/servlet/KbServlet/download/25161-102-648285/XD%20-%20Windows%207%20Optimization%20Guide.pdf

Once the basic VM is built there are four things that need done before joining the VM to the domain.

  1. Fix the WMI error that is the Application event log. I know it is not a critical error but I am OCD and simply must have error free event logs. Run the Mr. FixIt (this one actually works) from http://support.microsoft.com/kb/2545227.
  2. Install the hotfix for using a VMXNet3 network card in ESXi. Request and install the hotfix from http://support.microsoft.com/kb/2550978.
  3. From an elevated command prompt, run WinRM QuickConfig. This allows the desktops to work with Citrix Director.
  4. Disable Task Offload by creating the following registry key:
    1. HKLM\System\CurrentControlSet\Services\TCPIP\Parameters\
    2. Key: “DisableTaskOffload” (dword)
    3. Value: 1

The Write Cache drive will become drive D when it is created so before installing any software change the CD drive letter from D to another letter. I use Z.

The VM is ready to join the domain. After joining the domain, shutdown the VM.

Now two hard drives need to be added to the VM. One for the Write Cache drive and the other for the PvD drive. NOTHING will be done to these drives, they are just stub holders so Windows knows there should be two additional drives. The Write Cache and PvD drive must be different sizes or strange things can happen. If they are the same size, it is possible the write cache file and page file can be placed on the PvD drive and not the Write Cache drive. To make your life easier, keep the drives different sizes with the PvD drive being larger. For this article, I will use a 10GB Write Cache drive and a 20GB PvD drive. Make sure the new drives are created in the proper storage locations as shown in Figures 7 through 9.

Figure 7

Figure 7

Figure 8

Figure 8

Figure 9

Figure 9

Power on the VM, login with a domain account, start Computer Management and click on Disk Management as shown in Figure 10.

Figure 10

Figure 10

Click OK to initialize the two new drives as shown in Figure 11.

Figure 11

Figure 11

The two new drives appear in Disk Management as shown in Figure 12.

Figure 12

Figure 12

Leave the drives unformatted and exit Computer Management.

Install PVS Target Device Software

At this time, any software and updates needed can be installed. After all software and updates are installed, mount the PVS 7.6 ISO to the VM, open My Computer and double-click the CD.

When the PVS installer starts, click Target Device Installation on both screens as shown in Figures 13 and 14.

Figure 13

Figure 13

 

Figure 14

Figure 14

Follow the Installation Wizard to install the PVS Target Device Software. On the last page of the Installation Wizard, leave Launch Imaging Wizard selected and click Finish as shown in Figure 15.

Figure 15

Figure 15

You can exit the PVS Installer screen and unmount/disconnect the PVS 7.6 ISO from the VM’s CD drive.

Click Next on the Imaging Wizard as shown in Figure 16.

Figure 16

Figure 16

Enter the name or IP address of a PVS Server, select the option for Credentials and click Next as shown in Figure 17.

Figure 17

Figure 17

To Create new vDisk, click Next as shown in Figure 18.

Figure 18

Figure 18

Enter a vDisk name, Store, vDisk type and click Next .as shown in Figure 19.

Figure 19

Figure 19

Select the licensing type and click Next as shown in Figure 20.

Figure 20

Figure 20

Verify only the C drive is selected and click Next as shown in Figure 21.

Figure 21

Figure 21

Enter a Target device name, select the MAC address, select the target device Collection and click Next as shown in Figure 22.

Figure 22

Figure 22

Click Optimize for Provisioning Services as shown in Figure 23.

Figure 23

Figure 23

Verify all checkboxes are selected and click OK as shown in Figure 24.

Figure 24

Figure 24

Depending on the .Net Framework versions installed on the VM, the optimization process could take from less than a second to over an hour.

Once the process has completed click Finish as shown in Figure 25.

Figure 25

Figure 25

The vDisk is created.

Once the vDisk is created, a Reboot popup appears as shown in Figure 26. DO NOT reboot at this time. Depending on your hypervisor, you may need to shutdown to make the next change. The VM needs to be configured to boot from the network first and the hard drive second. If this change can be made while the VM is running, make the change and click Yes. If not, click No, shutdown the VM, make the change and power the VM on to continue.

Figure 26

Figure 26

Before we continue, what did the Imaging Wizard do inside of PVS? First, a vDisk was created as shown in Figure 27.

Figure 27

Figure 27

Second, a Target Device was created, as shown in Figure 28, with the MAC address of the VM, linked to the vDisk just created and the Target Device is configured to boot from its hard disk because the vDisk is empty right now.

Figure 28

Figure 28

Once the VM has been configured to boot from the network first and the hard drive second, either power on the VM or click Yes to reboot the VM as previously shown in Figure 26. When the VM is at the logon screen, logon with the same domain account and the Imaging Wizard process continues as shown in Figure 29.

Figure 29

Figure 29

When the Imaging Wizard process is complete, click Finish, as shown in Figure 30, and shutdown the VM.

Note: If there are any errors, click Log, review the log, correct any issues and rerun the Imaging Wizard.

Figure 30

Figure 30

Configure the vDisk in PVS

What has happened is that the Imaging Wizard has now copied the contents of the VM’s C drive into the vDisk. That means the C drive attached to the VM is no longer needed. Detach the C drive from the VM as shown in Figures 31 and 32. DO NOT DELETE the C drive, just detach it.

Figure 31

Figure 31

Figure 32

Figure 32

Now that the VM has no C drive, how will it boot? In the PVS console, go to the Target Device, right-click and select Properties as shown in Figure 33.

Figure 33

Figure 33

Change the Boot from to vDisk as shown in Figure 34.

Figure 34

Figure 34

The vDisk contains everything that was on the original C drive and the vDisk is still set to Private Image mode. That means everything that is done to the vDisk is the same as making changes on the original C drive. Any changes made now will persist. When the vDisk is changed to Standard Image mode, the vDisk is placed in read-only mode and no changes can be made to it. Before the VM is powered on, an AD Machine Account must be created. Right-click the target device, select Active Directory and then Create Machine Account… as shown in Figure 35.

Figure 35

Figure 35

Select the Organization unit from the dropdown list as shown in Figure 36.

Figure 36

Figure 36

Once the correct Organization unit has been selected, click Create Account as shown in Figure 37.

Figure 37

Figure 37

When the machine account is created, click Close as shown in Figure 38. If there is an error reported, resolve the error and rerun the process.

Figure 38

Figure 38

Power on the VM and logon with domain credentials. Open Computer Management and click on Disk Management. Here you can see the holders for the 10GB Write Cache and 20GB PvD drives and the C drive (which is the vDisk) as shown in Figure 39.

Figure 39

Figure 39

Exit Computer Management.

You can also verify the VM has booted from the vDisk by checking the Virtual Disk Status icon in the Notification Area as shown in Figure 40.

Figure 40

Figure 40

As shown in Figure 41, the Virtual Disk Status shows:

  • The vDisk status is Active,
  • The IP address of the PVS server streaming the vDisk,
  • That the Target Device is booting from the vDisk,
  • The name of the vDisk, and
  • The vDisk is in Read/Write mode.
Figure 41

Figure 41

Exit the Virtual Disk Status.

Install the Virtual Delivery Agent

The XenDesktop 7.6 Virtual Delivery Agent (VDA) needs to be installed. Mount the XenDesktop 7.6 ISO to the CD. Double-click the CD drive and the XenDesktop installation wizard starts. Click Start for XenDesktop as shown in Figure 42.

Note: At this time, PvD is only supported for desktop operating systems. PvD will not work and is not supported for XenApp 7.6.

Figure 42

Figure 42

Select Virtual Delivery Agent for Windows Desktop OS as shown in Figure 43.

Figure 43

Figure 43

Select Create a Master Image and click Next as shown in Figure 44.

Figure 44

Figure 44

Select the appropriate HDX 3D Pro option and click Next as shown in Figure 45.

Figure 45

Figure 45

Verify Citrix Receiver is selected and click Next as shown in Figure 46.

Figure 46

Figure 46

Enter the Fully Qualified Domain Name of a XenDesktop 7.6 Controller, click Test connection and, if the test is successful (a green check mark is displayed), click Add as shown in Figures 47 and 48. Repeat until all XenDesktop 7.6 Controllers are entered. Click Next when all Controllers are added.

Figure 47

Figure 47

Figure 48

Figure 48

Verify all options are selected and click Next as shown in Figure 49.

Figure 49

Figure 49

Select the appropriate firewall rules option and click Next as shown in Figure 50.

Figure 50

Figure 50

Click Install as shown in Figure 51.

Figure 51

Figure 51

The VDA installation starts as shown in Figure 52.

Figure 52

Figure 52

When the VDA installation completes, verify Restart machine is selected and click Finish as shown in Figure 53.

Figure 53

Figure 53

Disconnect/unmount the XenDesktop 7.6 ISO from the VM.

Update Virtual Delivery Agent Software

Citrix updates the VDA software often. At the time this article was released, 23-Dec-2014, there was one Public update to the VDA software (ICAWS760WXnn005 where nn is either 32 or 64 for the bitness of your desktop OS).

To check for recommended available updates, in your browser, go to XenDesktop 7.6 Recommended Updates.

Click on Support, select XenDesktop from the dropdown. Change All Versions to XenDesktop 7.6, click on Software Updates and then Public. See if there is any update for XenDesktop 7.6. If there is, download and install the VDA update.

After the VM restarts, log back in to the desktop with domain credentials.

Update Personal vDisk Software

Citrix updates the Personal vDisk software often. At the time this article was released, 23-Dec-2014, there was no update to the Personal vDisk software.

To check for an available update, in your browser, go to http://www.mycitrix.com and logon with MyCitrix.com credentials.

Click on Downloads, select XenDesktop and Components from the two dropdowns. See if there is any update for XenDesktop 7.6. If there is, download and install the Personal vDisk update.

Log back in to the desktop with domain credentials.

Configure Personal vDisk

By default, PvD uses two drive letters: V and P. V is hidden and is a merged view of the C drive with the PvD drive. If drive V is already used, the drive letter can be changed.

If needed, change the hidden PvD drive letter:

  • Key : HKEY_LOCAL_MACHINE\Software\Citrix\personal vDisk\Config
  • Value : VHDMountPoint [REG_SZ]
  • Set this to the drive letter of your choice. Ensure that “:\” is appended to the end of your entry (Example: X:\ )

Both user profile data and applications and machine settings are stored in the PvD. By default, this is a 50/50 split if the PvD size is at least 4GB or larger.  The percent to be allocated for applications and machine settings can be configured by setting the following registry value:

  • KEY: HKEY_LOCAL_MACHINE\Software\Citrix\personal vDisk\Config
  • VALUE: PercentOfPvDForApps
    • By default, this value is set to 50
    • Changing this to 80 will result in the V: drive being allocated 80% of the PvD disk

Note: This value must be changed before the PvD is placed into production.

Everything is now complete. Before running the PvD Inventory, follow your standard procedure for sealing the image. This process is unique to every environment. For my lab, I have no antivirus software and I am not using WSUS so I have no registry keys to clear out. Manually run the PvD Inventory. Click Start, All Programs, Citrix, Update personal vDisk as shown in Figure 54.

Figure 54

Figure 54

The PvD inventory starts. Leave Shut down the system when update is complete selected as shown in Figure 55.

Figure 55

Figure 55

After the inventory completes, the VM is shutdown.

PVS XenDesktop Setup Wizard

Make a copy of the VM and create a template of the copy. That way the original VM is still available just in case.

When making the template, make sure the template is stored on a storage location that is available when running the XenDesktop Setup Wizard. Change the template to boot from network only.

Since the C drive was detached, that leaves the Write Cache and PvD storage locations. If you do not, an error “<host resource> has no available templates defined that are fully accessible by all hosts” is displayed during the XenDesktop Setup Wizard. In the PVS console, click on the vDisk Pool node, right-click the vDisk and select Properties as shown in Figure 56.

Figure 56

Figure 56

Change the Access mode to Standard image and Cache type to Cache on device hard drive as shown in Figure 57.

Note: If you leave the Cache type at the default of Cache on server, when you run the XenDesktop Setup Wizard there will not be an option to configure the Write Cache drive size.

Note: I am using Cache on device hard drive for this article. With PVS 7.6, Cache in device RAM with overflow on hard disk is now the popular option. I highly recommend you read the following two articles by Dan Allen before making a decision on the Cache Type to use:

  1. Turbo Charging your IOPS with the new PVS Cache in RAM with Disk Overflow Feature! – Part One
  2. Turbo Charging your IOPS with the new PVS Cache in RAM with Disk Overflow Feature! – Part Two
Figure 57

Figure 57

Right-click the Site and select XenDesktop Setup Wizard as shown in Figure 58.

Figure 58

Figure 58

Note: If you get an error popup that states “No Standard Image vDisk exists in this Site”, that simply means the vDisk is still in Private Image mode.

Click Next as shown in Figure 59.

Figure 59

Figure 59

Enter the name of a XenDesktop 7.6 Controller and click Next as shown in Figure 60.

Figure 60

Figure 60

Select the host resource from those configured in Citrix Studio and click Next as shown in Figure 61.

Figure 61

Figure 61

Enter the logon credentials for the host resource and click OK as shown in Figure 62.

Figure 62

Figure 62

Select the appropriate template and VDA version and or functionality desired and click Next as shown in Figure 63.

Figure 63

Figure 63

Select the vDisk and click Next as shown in Figure 64.

Figure 64

Figure 64

Select whether to Create a new catalog or Use an existing catalog and click Next as shown in Figure 65. If you Create a new catalog, enter a Catalog name and Description.

Note: The wizard creates a Machine Catalog in XenDesktop and a Device Collection in PVS with the Catalog name entered here.

Figure 65

Figure 65

Select Windows Desktop Operating System and click Next as shown in Figure 66.

Figure 66

Figure 66

Since we are using PvD, select The same (static) desktop, also select Save changes and store them on a separate personal vDisk and click Next as shown in Figure 67.

Figure 67

Figure 67

Make the appropriate choices.

For this lab, I am creating 3 VMs (desktops) with 2 vCPUs, 2 GB RAM, a 10GB write cache disk, a 20 GB PvD disk and changing the PvD drive to Y. Click Next as shown in Figure 68.

Note: If you do not see the option Local write cache disk that means you left the vDisk at the default of Cache on server. Exit this wizard, correct the vDisk properties and rerun the wizard.

Figure 68

Figure 68

Select Create new accounts to have new AD computer accounts created and click Next as shown in Figure 69.

Figure 69

Figure 69

Select the Domain, OU, Account naming scheme and click Next as shown in Figure 70.

Figure 70

Figure 70

Verify the Summary information, click Finish, as shown in Figure 71, and the wizard will begin creating the following:

  • Virtual Machines
  • AD computer accounts
  • Target Devices
  • Machine Catalog in XenDesktop Studio
Figure 71

Figure 71

When the wizard is complete, click Done as shown in Figure 72.

Figure 72

Figure 72

Looking at the Device Collection in the PVS console (you may need to right-click the Site and select Refresh) shows the three target devices with only one powered on at this time as seen in Figure 73.

Figure 73

Figure 73

Looking in Active Directory Users and Computers shows the new computer accounts as seen in Figure 74.

Figure 74

Figure 74

Create XenDesktop Delivery Group

In Citrix Studio, right-click on the Machine Catalogs node and select Refresh. The new Machine Catalog created by the XenDesktop Setup Wizard is shown in Figure 75.

Figure 75

Figure 75

Currently there is no Delivery Group to deliver the desktops. Right-click the Delivery Groups node in Citrix Studio and select Create Delivery Group as shown in Figure 76.

Figure 76

Figure 76

Click Next as shown in Figure 77.

Figure 77

Figure 77

Select the Machine Catalog and the number of machines to be added from the catalog to this delivery group and click Next as shown in Figure 78.

Figure 78

Figure 78

Select Desktops and click Next as shown in Figure 79.

Figure 79

Figure 79

Click Add… as shown in Figure 80.

Figure 80

Figure 80

Use the Select Users or Groups dialog to add users and click OK as shown in Figure 81.

Figure 81

Figure 81

Click Next as shown in Figure 82.

Figure 82

Figure 82

Select the appropriate StoreFront option and click Next as shown in Figure 83.

Figure 83

Figure 83

Enter a Delivery Group name, Display name, an optional Delivery Group description for users and click Finish as shown in Figure 84.

Figure 84

Figure 84

From here, there are many options that can be configured. For this lab, I edited the Delivery Group and set both Weekdays and Weekend peak hours to 24 hours as shown in Figure 85.

Figure 85

Figure 85

Every XenDesktop project I have been on, the customer wants all desktops powered on at all times. To do this, on a Controller start a PowerShell session and enter the following commands as shown in Figure 86:

add-pssnapin *citrix*

Get-brokerdesktopgroup | set-brokerdesktopgroup -PeakBufferSizePercent 100

Note: I had a reader leave me a comment on the original article that said this setting does not apply to user assigned desktops. But, I never got more than one desktop to start (out of the three in my lab) until I set the PeakBufferSizePercent. As soon as I entered that command, within a few seconds the other two desktops powered on.

Figure 86

Figure 86

Exit the PowerShell session. After a few minutes, all the desktops will power on. The desktops will reboot, I think, two times before they are ready for users to login. Back in the PVS console, the vDisk will show three connections and all three target devices will be powered on as shown in Figures 87 and 88.

Figure 87

Figure 87

Figure 88

Figure 88

Understanding How Personal vDisk Works

Now let us look at how the Write Cache and PvD drives work.

All three desktops are powered on. I will log in as a different user into each desktop.

All three users are presented with the standard Windows 7 desktop configured during the creation of the master image VM as shown in Figure 89.

Figure 89

Figure 89

Before we take a look at user customization and personalization, let’s see what is on the Write Cache and PvD drives. I had to show system and hidden files and operating system files. Figures 90 and 91 show the Write Cache drive which shows the write cache file, page file and the EventLogs folder.

Figure 90

Figure 90

Figure 91

Figure 91

Figure 92 shows there is not much of anything useful to see on the PvD drive.

Figure 92

Figure 92

Back in Citrix Studio, refresh the Delivery Group and you will see there are now Sessions in use with no Unregistered or Disconnected machines as shown in Figure 93.

Figure 93

Figure 93

Double-click the Delivery Group to see detailed information as shown in Figure 94.

Figure 94

Figure 94

The first user is Ms. Know-It-All who probably knows Windows 7 better than the helpdesk team. She configures her desktop to get all the Windows 7 “frilly” stuff out of her way as shown in Figure 95.

Figure 95

Figure 95

The second user is Ms. Tree Hugger who wants a pretty cool picture for her background as shown in Figure 96.

Figure 96

Figure 96

The third user is Ms. Astrophysicist who needs a picture of her Tesla as her background as shown in Figure 97.

Figure 97

Figure 97

Now that each user has customized their desktop, reboot each desktop, log back in to each desktop and verify the user’s customizations persisted.

User Installed Software

What about installing software? User1 installed NotePad++ since she knows more than you do anyways, User2 installed Google Chrome to save the world from Internet Exploder and User3 installed Mathematica so she could do some physics work. The three desktops are shown in Figures 98 through 100.

Figure 98

Figure 98

Figure 99

Figure 99

Figure 100

Figure 100

Now that each user has installed an application, reboot each desktop, log back in to each desktop and verify the user’s installed application persisted. Since we are using PvD to allow users to install applications, where are the applications installed? Looking at User1, we can see that Notepad++ was installed to c:\Program Files\Notepad++ as shown in Figure 101.

Figure 101

Figure 101

User2’s Google Chrome is installed to C:\Program Files\Google\Chrome\Application as shown in Figure 102.

Figure 102

Figure 102

User3’s Mathematica is installed to C:\Program Files\Wolfram Research\Mathematica\10.0 as shown in Figure 103.

Figure 103

Figure 103

The C drive view is a combination of the hidden drive, V by default, and C. When users install applications they will install as usual to the C drive. There is no need to install to the visible PvD drive, P by default.

Updating the Master Image

How is the master image updated if an application needs to be installed that all users need? Simple, in the PVS console create a Maintenance version, update it, test it and then make it available to users. In the PVS console, right-click the vDisk and select Versions as shown in Figure 104.

Figure 104

Figure 104

Click New as shown in Figure 105.

Figure 105

Figure 105

A new Maintenance version of the vDisk is created as shown in Figure 106. Click Done.

Figure 106

Figure 106

In the PVS console, go to the Device Collection the original master target device is in, right-click the target device and click Properties as shown in Figure 107.

Figure 107

Figure 107

Change the Type from Production to Maintenance and click OK as shown in Figure 108.

Note: In a production environment, you would have a dedicated Target Device to use for Maintenance versions of vDisks.

Figure 108

Figure 108

In the hypervisor, start that VM and open the VM’s console. An option to boot into either the Production version or the Maintenance version is shown. Select the Maintenance version as shown in Figure 109.

Figure 109

Figure 109

What has happened is that the target device has been configured to boot from a Maintenance image and during the bootup communication, the PVS server recognized the MAC address and offered the target device the maintenance vDisk to boot from. The maintenance vDisk is in Read/Write mode so changes can be made to the vDisk. Login to the desktop with domain credentials. I installed Adobe Acrobat Reader as shown in Figure 110.

Note: Whatever software is installed, verify that any license agreements and popups are acknowledged and any other configurations needed are done before sealing the image and running the PvD Inventory. For example, in Acrobat Reader I acknowledged the license agreement and disabled updater.

Figure 110

Figure 110

Before running the PvD Inventory, follow your standard procedure for sealing the image. This process is unique to every environment. For my lab, I have no antivirus software and I am not using WSUS so I have no registry keys to clear out. Manually run the PvD Inventory. Click Start, All Programs, Citrix, Update personal vDisk as shown in Figure 111.

Figure 111

Figure 111

The PvD inventory starts. Leave Shut down the system when update is complete selected as shown in Figure 112.

Figure 112

Figure 112

After the inventory completes, the VM is shutdown. Once the VM has shut down, in the PVS console, right-click the vDisk and select Versions as shown in Figure 113.

Figure 113

Figure 113

Select the Maintenance version and click Promote as shown in Figure 114.

Figure 114

Figure 114

PVS 7.6 adds the ability to now have a Test version for a vDisk that uses PvD.  This was not possible prior to version 7.6.

Select Test and click OK as shown in Figure 115.

Figure 115

Figure 115

The vDisk version is promoted to Test, as shown in Figure 116. Click Done.

Figure 116

Figure 116

In the PVS console, go to the Device Collection the original master target device is in, right-click the target device and click Properties as shown in Figure 117.

Figure 117

Figure 117

Change the Type from Maintenance to Test and click OK as shown in Figure 118.

Note: In a production environment, you would have dedicated Target Devices to use for Test versions of vDisks.

Figure 118

Figure 118

In the hypervisor, start that VM and open the VM’s console. An option to boot into either the Production version or the Test version is shown. Select the Test version as shown in Figure 119.

Figure 119

Figure 119

What has happened is that the target device has been configured to boot from a Maintenance image and during the bootup communication, the PVS server recognized the MAC address and offered the target device the maintenance vDisk to boot from. The maintenance vDisk is in Read/Write mode so changes can be made to the vDisk. Login to the desktop with domain credentials.

There are several things to notice with the Test version of the vDisk:

  1. The application that was installed for all users is there (Figure 120),
  2. The vDisk is in Read-only mode (Figure 121), but
  3. The write cache is located on the PVS server (Figure 122) because,
  4. There is no Write Cache drive (Figure 123),
  5. There is no PvD drive attached (also Figure 123), but
  6. The stub holders for the write cache and PvD drives are still there (Figure 124).
Figure 120

Figure 120

Figure 121

Figure 121

Figure 122

Figure 122

Figure 123

Figure 123

Figure 124

Figure 124

Once testing is completed, shutdown the VM.

Once the VM has shut down, in the PVS console, right-click the vDisk and select Versions as shown in Figure 125.

Figure 125

Figure 125

Select the Test version and click Promote as shown in Figure 126.

Figure 126

Figure 126

Select Immediate and click OK as shown in Figure 127.

Figure 127

Figure 127

The updated vDisk is now available for use as shown in Figure 128. Click Done.

Figure 128

Figure 128

Verify the Master Image Update

Restart the desktops for them to start using the updated vDisk. The desktops will automatically reboot after a few minutes. This is normal. Wait until this reboot is complete before allowing the users access to the desktop. Log in to each desktop and verify the new application is available and the user’s original customizations and installed applications persisted after the update. The three desktops are shown in Figures 129 through 131.

Figure 129

Figure 129

Figure 130

Figure 130

Figure 131

Figure 131

And there you have it, one way to do a XenDesktop 7.6 with Personal vDisk process.

Citrix lists four ways to do this process in eDocs, three with PVS and one with MCS. http://support.citrix.com/proddocs/topic/provisioning-7/pvs-inventory-vdisks-pvd.html

I think it is strange they have MCS listed as a process in the PVS documentation but that is beside the point.

I hope this detailed process explanation will help you in working with PvD with XenDesktop 7.6 and PVS 7.6.

There is a PDF available of this article for $1.99.

Thanks

 

Webster

You just finished reading Citrix XenDesktop 7.6, Provisioning Services 7.6 and the XenDesktop Setup Wizard with Write Cache and Personal vDisk Drives on Carl Webster. Please consider leaving a comment!

Citrix XenDesktop 7.6, Provisioning Services 7.6 and the XenDesktop Setup Wizard with Boot Device Manager, Write Cache and Personal vDisk Drives

$
0
0

Ever since the first article in this series came out in January 2014, I have been asked by numerous people to add an article that includes Boot Device Manager (BDM).  Since I am here but to serve, I am finally getting around to updating the process to include BDM.

Introduction

As with most things involving XenDesktop and or PVS, there is NO one way or one right way to do anything. This article will give you detailed information on the process I worked out and documented and now updated to include Boot Device Manager.

Assumptions:

  1. PVS 7.6 is installed, configured and a farm created.
  2. XenDesktop 7.6 is installed and a Site created and configured.
  3. Hosting resources are configured in Studio.
  4. PXE, TFTP and DHCP are configured as needed.

Note: While with BDM, PXE, TFTP and DHCP Options 66 and 67 are not needed, they are needed for the initial running of the PVS Imaging Wizard.

Lab Setup

All servers in my lab are running Microsoft Windows Server 2012 R2 fully patched. The lab consists of:

  • 1 PVS 7.6 server
  • 1 XenDesktop 7.6 Controller running Studio
  • 1 SQL 2012 SP1 Server
  • 1 Windows 7 SP1 VM

I am using XenServer 6.2 fully patched for my hosting environment. There are separate Storage Repositories for the Virtual Machines (VM), Personal vDisk (PvD) and Write Cache as shown in Figure 1.

Update: This has been tested with XenServer 6.5 with no changes or issues.

Note: The partition for BDM is created when the XenDesktop Setup Wizard is run and is created in the same Storage Repository as the Write Cache drive.

Figure 1

Figure 1

The Hosting Resources are configured in Studio as shown in Figure 2.

Figure 2

Figure 2

To start off, in my lab I created my Organization Unit (OU) structure in Active Directory (AD) for my domain, WebstersLab.com, as shown in Figure 3.

Figure 3

Figure 3

One of the reasons to use PvD is to allow users to install applications. In order to do this I created an AD security group, shown in Figure 4, that will contain the AD user accounts and that AD security group will be made a member of the local Administrators security group.

Figure 4

Figure 4

Three AD user accounts were created, shown in Figure 5, for the three different PvD users for this article.

Figure 5

Figure 5

Those three test user accounts were placed in the LocalAdmins AD security group as shown in Figure 6.

Figure 6

Figure 6

Most organizations that use XenDesktop to serve virtual desktops or servers require that Event Logs persist between reboots or the security team sits in the corner crying. Other items that may need to persist between desktop/VM reboots are antivirus definition files and engine updates. To accomplish these a Group Policy with Preferences is used. Why not manually change the file system and registry? Because the XenDesktop setup wizard completely ignores all the careful work done by creating folders on the Write Cache drive. When the Write Cache and PvD drives are created, they are empty and will NOT carry over ANY of the manual work done before hand. So just forget about doing any of the items usually done by pre creating a Write Cache drive. The Write Cache drive is always created as Drive D and the PvD is created with the drive letter assigned during the Wizard. My Group Policy with Preferences is linked at the OU that will contain the computer accounts created by the XenDesktop Setup Wizard. These are the settings in the policy used for this lab.

  • Computer Configuration\Policies\Administrative Templates\Windows Components\Event Log Service\Application\Control the location of the log file – Enabled with a value of D:\EventLogs\Application.evtx
  • Computer Configuration\Policies\Administrative Templates\Windows Components\Event Log Service\Security\Control the location of the log file – Enabled with a value of D:\EventLogs\Security.evtx
  • Computer Configuration\Policies\Administrative Templates\Windows Components\Event Log Service\System\Control the location of the log file – Enabled with a value of D:\EventLogs\System.evtx
  • Computer Configuration\Preferences\Folder – Action: Update, Path: D:\EventLogs
  • Computer Configuration\Preferences\Control Panel Settings\Local Users and Groups – Action: Update, Group name: Administrators (built-in), Members: ADD, <DomainName>\<Security Group Name>
  • User Configuration\Policies\Administrative Templates\Start Menu and Taskbar\Remove the Action Center icon – Enabled

These settings will:

  • Keep the user from getting popups from the Action Center
  • Create the EventLogs folder on drive D (the Write Cache drive)
  • Redirect the Application, Security and System event logs to the new D:\EventLogs folder
  • Add the domain security group that contains use accounts who should be local admins to the desktop’s local Administrators group

Create the Virtual Machine

Next up is to create a Windows 7 VM to be used as the Master or Golden image. Do just basic configuration of the VM at this time. Do not install any applications at this time.

Citrix provides a PDF explaining how to optimize a Windows 7 image. http://support.citrix.com/servlet/KbServlet/download/25161-102-648285/XD%20-%20Windows%207%20Optimization%20Guide.pdf

Once the basic VM is built there are four things that need done before joining the VM to the domain.

  1. Fix the WMI error that is the Application event log. I know it is not a critical error but I am OCD and simply must have error free event logs. Run the Mr. FixIt (this one actually works) from http://support.microsoft.com/kb/2545227.
  2. Install the hotfix for using a VMXNet3 network card in ESXi. Request and install the hotfix from http://support.microsoft.com/kb/2550978.
  3. From an elevated command prompt, run WinRM QuickConfig. This allows the desktops to work with Citrix Director.
  4. Disable Task Offload by creating the following registry key:
    1. HKLM\System\CurrentControlSet\Services\TCPIP\Parameters\
    2. Key: “DisableTaskOffload” (dword)
    3. Value: 1

The Write Cache drive will become drive D when it is created so before installing any software change the CD drive letter from D to another letter. I use Z.

The VM is ready to join the domain. After joining the domain, shutdown the VM.

Now two hard drives need to be added to the VM. One for the Write Cache drive and the other for the PvD drive. NOTHING will be done to these drives, they are just stub holders so Windows knows there should be two additional drives. The Write Cache and PvD drive must be different sizes or strange things can happen. If they are the same size, it is possible the write cache file and page file can be placed on the PvD drive and not the Write Cache drive. To make your life easier, keep the drives different sizes with the PvD drive being larger. For this article, I will use a 10GB Write Cache drive and a 20GB PvD drive. Make sure the new drives are created in the proper storage locations as shown in Figures 7 through 9.

PVS uses the different disk sizes to determine which disk to use for the Write Cache.  The smaller of the two disks is used for the Write Cache.

Figure 7

Figure 7

Figure 8

Figure 8

Figure 9

Figure 9

Power on the VM, login with a domain account, start Computer Management and click on Disk Management as shown in Figure 10.

Figure 10

Figure 10

Click OK to initialize the two new drives as shown in Figure 11.

Figure 11

Figure 11

The two new drives appear in Disk Management as shown in Figure 12.

Figure 12

Figure 12

Leave the drives unformatted and exit Computer Management.

Install PVS Target Device Software

At this time, any software and updates needed can be installed. The Citrix Virtual Delivery Agent will be installed later.  After all software and updates are installed, mount the PVS 7.6 ISO to the VM, open My Computer and double-click the CD.

When the PVS installer starts, click Target Device Installation on both screens as shown in Figures 13 and 14.

Figure 13

Figure 13

Figure 14

Figure 14

Follow the Installation Wizard to install the PVS Target Device Software. On the last page of the Installation Wizard, leave Launch Imaging Wizard selected and click Finish as shown in Figure 15.

Figure 15

Figure 15

You can exit the PVS Installer screen and unmount/disconnect the PVS 7.6 ISO from the VM’s CD drive.

Click Next on the Imaging Wizard as shown in Figure 16.

Figure 16

Figure 16

Enter the name or IP address of a PVS Server, select the option for Credentials and click Next as shown in Figure 17.

Figure 17

Figure 17

To Create new vDisk, click Next as shown in Figure 18.

Figure 18

Figure 18

Enter a vDisk name, Store, vDisk type and click Next .as shown in Figure 19.

Figure 19

Figure 19

Select the licensing type and click Next as shown in Figure 20.

Figure 20

Figure 20

Verify only the C drive is selected and click Next as shown in Figure 21.

Figure 21

Figure 21

Enter a Target device name, select the MAC address, select the target device Collection and click Next as shown in Figure 22.

Figure 22

Figure 22

Click Optimize for Provisioning Services as shown in Figure 23.

Figure 23

Figure 23

Verify all checkboxes are selected and click OK as shown in Figure 24.

Figure 24

Figure 24

Depending on the .Net Framework versions installed on the VM, the optimization process could take from less than a second to over an hour.

Once the process has completed click Finish as shown in Figure 25.

Figure 25

Figure 25

The vDisk is created.

Once the vDisk is created, a Reboot popup appears as shown in Figure 26. DO NOT reboot at this time. Depending on your hypervisor, you may need to shutdown to make the next change. The VM needs to be configured to boot from the network first and the hard drive second. If this change can be made while the VM is running, make the change and click Yes. If not, click No, shutdown the VM, make the change and power the VM on to continue.

Figure 26

Figure 26

Before we continue, what did the Imaging Wizard do inside of PVS? First, a vDisk was created as shown in Figure 27.

Figure 27

Figure 27

Second, a Target Device was created, as shown in Figure 28, with the MAC address of the VM, linked to the vDisk just created and the Target Device is configured to boot from its hard disk because the vDisk is empty right now.

Figure 28

Figure 28

Once the VM has been configured to boot from the network first and the hard drive second, either power on the VM or click Yes to reboot the VM as previously shown in Figure 26. When the VM is at the logon screen, logon with the same domain account and the Imaging Wizard process continues as shown in Figure 29.

Figure 29

Figure 29

When the Imaging Wizard process is complete, click Finish, as shown in Figure 30, and shutdown the VM.

Note: If there are any errors, click Log, review the log, correct any issues and rerun the Imaging Wizard.

Figure 30

Figure 30

Configure the vDisk in PVS

What has happened is that the Imaging Wizard has now copied the contents of the VM’s C drive into the vDisk. That means the C drive attached to the VM is no longer needed. Detach the C drive from the VM as shown in Figures 31 and 32. DO NOT DELETE the C drive, just detach it.

Figure 31

Figure 31

Figure 32

Figure 32

Now that the VM has no C drive, how will it boot? In the PVS console, go to the Target Device, right-click and select Properties as shown in Figure 33.

Figure 33

Figure 33

Change the Boot from to vDisk as shown in Figure 34.

Figure 34

Figure 34

The vDisk contains everything that was on the original C drive and the vDisk is still set to Private Image mode. That means everything that is done to the vDisk is the same as making changes on the original C drive. Any changes made now will persist. When the vDisk is changed to Standard Image mode, the vDisk is placed in read-only mode and no changes can be made to it. Before the VM is powered on, an AD Machine Account must be created. Right-click the target device, select Active Directory and then Create Machine Account… as shown in Figure 35.

Figure 35

Figure 35

Select the Organization unit from the dropdown list as shown in Figure 36.

Figure 36

Figure 36

Once the correct Organization unit has been selected, click Create Account as shown in Figure 37.

Figure 37

Figure 37

When the machine account is created, click Close as shown in Figure 38. If there is an error reported, resolve the error and rerun the process.

Figure 38

Figure 38

Power on the VM and logon with domain credentials. Open Computer Management and click on Disk Management. Here you can see the holders for the 10GB Write Cache and 20GB PvD drives and the C drive (which is the vDisk) as shown in Figure 39.

Figure 39

Figure 39

Exit Computer Management.

You can also verify the VM has booted from the vDisk by checking the Virtual Disk Status icon in the Notification Area as shown in Figure 40.

Figure 40

Figure 40

As shown in Figure 41, the Virtual Disk Status shows:

  • The vDisk status is Active,
  • The IP address of the PVS server streaming the vDisk,
  • That the Target Device is booting from the vDisk,
  • The name of the vDisk, and
  • The vDisk is in Read/Write mode.
Figure 41

Figure 41

Exit the Virtual Disk Status.

Install the Virtual Delivery Agent

The XenDesktop 7.6 Virtual Delivery Agent (VDA) needs to be installed. Mount the XenDesktop 7.6 ISO to the CD. Double-click the CD drive and the XenDesktop installation wizard starts. Click Start for XenDesktop as shown in Figure 42.

Note: At this time, PvD is only supported for desktop operating systems. PvD will not work and is not supported for XenApp 7.6.

Figure 42

Figure 42

Select Virtual Delivery Agent for Windows Desktop OS as shown in Figure 43.

Figure 43

Figure 43

Select Create a Master Image and click Next as shown in Figure 44.

Figure 44

Figure 44

Select the appropriate HDX 3D Pro option and click Next as shown in Figure 45.

Figure 45

Figure 45

Verify Citrix Receiver is selected and click Next as shown in Figure 46.

Figure 46

Figure 46

Enter the Fully Qualified Domain Name of a XenDesktop 7.6 Controller, click Test connection and, if the test is successful (a green check mark is displayed), click Add as shown in Figures 47 and 48. Repeat until all XenDesktop 7.6 Controllers are entered. Click Next when all Controllers are added.

Figure 47

Figure 47

Figure 48

Figure 48

Verify all options are selected and click Next as shown in Figure 49.

Figure 49

Figure 49

Select the appropriate firewall rules option and click Next as shown in Figure 50.

Figure 50

Figure 50

Click Install as shown in Figure 51.

Figure 51

Figure 51

The VDA installation starts as shown in Figure 52.

Figure 52

Figure 52

When the VDA installation completes, verify Restart machine is selected and click Finish as shown in Figure 53.

Figure 53

Figure 53

Disconnect/unmount the XenDesktop 7.6 ISO from the VM.

Update Virtual Delivery Agent Software

Citrix updates the VDA software often. At the time this article was released, 30-Dec-2014, there was one Public update to the VDA software (ICAWS760WXnn005 where nn is either 32 or 64 for the bitness of your desktop OS).

To check for recommended available updates, in your browser, go to XenDesktop 7.6 Recommended Updates.

Click on Support, select XenDesktop from the dropdown. Change All Versions to XenDesktop 7.6, click on Software Updates and then Public. See if there is any update for XenDesktop 7.6. If there is, download and install the VDA update.

After the VM restarts, log back in to the desktop with domain credentials.

Update Personal vDisk Software

Citrix updates the Personal vDisk software often. At the time this article was released, 30-Dec-2014, there was no update to the Personal vDisk software.

To check for an available update, in your browser, go to http://www.mycitrix.com and logon with MyCitrix.com credentials.

Click on Downloads, select XenDesktop and Components from the two dropdowns. See if there is any update for XenDesktop 7.6. If there is, download and install the Personal vDisk update.

Log back in to the desktop with domain credentials.

Configure Personal vDisk

By default, PvD uses two drive letters: V and P. V is hidden and is a merged view of the C drive with the PvD drive. If drive V is already used, the drive letter can be changed.

If needed, change the hidden PvD drive letter:

  • Key : HKEY_LOCAL_MACHINE\Software\Citrix\personal vDisk\Config
  • Value : VHDMountPoint [REG_SZ]

Set this to the drive letter of your choice. Ensure that “:\” is appended to the end of your entry (Example: X:\ )

Both user profile data and applications and machine settings are stored in the PvD. By default, this is a 50/50 split if the PvD size is at least 4GB or larger.  The percent to be allocated for applications and machine settings can be configured by setting the following registry value:

  • KEY: HKEY_LOCAL_MACHINE\Software\Citrix\personal vDisk\Config
  • VALUE: PercentOfPvDForApps
    • By default, this value is set to 50
    • Changing this to 80 will result in the V: drive being allocated 80% of the PvD disk

Note: This value must be changed before the PvD is placed into production.

Everything is now complete. Before running the PvD Inventory, follow your standard procedure for sealing the image. This process is unique to every environment. For my lab, I have no antivirus software and I am not using WSUS so I have no registry keys to clear out. Manually run the PvD Inventory. Click Start, All Programs, Citrix, Update personal vDisk as shown in Figure 54.

Figure 54

Figure 54

The PvD inventory starts. Leave Shut down the system when update is complete selected as shown in Figure 55.

Figure 55

Figure 55

After the inventory completes, the VM is shutdown.

PVS XenDesktop Setup Wizard

Make a copy of the VM and create a template of the copy. That way the original VM is still available when needed in the future.

When making the template, make sure the template is stored on a storage location that is available when running the XenDesktop Setup Wizard. Change the template to boot from network only.

Since the C drive was detached, that leaves the Write Cache and PvD storage locations. If you do not, an error “<host resource> has no available templates defined that are fully accessible by all hosts” is displayed during the XenDesktop Setup Wizard. In the PVS console, click on the vDisk Pool node, right-click the vDisk and select Properties as shown in Figure 56.

Figure 56

Figure 56

Change the Access mode to Standard image and Cache type to Cache on device hard drive as shown in Figure 57.

Note: If you leave the Cache type at the default of Cache on server, when you run the XenDesktop Setup Wizard there will not be an option to configure the Write Cache drive size.

Note: I am using Cache on device hard drive for this article. With PVS 7.6, Cache in device RAM with overflow on hard disk is now the popular option. I highly recommend you read the following two articles by Dan Allen before making a decision on the Cache Type to use:

  1. Turbo Charging your IOPS with the new PVS Cache in RAM with Disk Overflow Feature! – Part One
  2. Turbo Charging your IOPS with the new PVS Cache in RAM with Disk Overflow Feature! – Part Two
Figure 57

Figure 57

Right-click the Site and select XenDesktop Setup Wizard as shown in Figure 58.

Figure 58

Figure 58

Note: If you get an error popup that states “No Standard Image vDisk exists in this Site”, that simply means the vDisk is still in Private Image mode.

Click Next as shown in Figure 59.

Figure 59

Figure 59

Enter the name of a XenDesktop 7.6 Controller and click Next as shown in Figure 60.

Figure 60

Figure 60

Select the host resource from those configured in Citrix Studio and click Next as shown in Figure 61.

Figure 61

Figure 61

Enter the logon credentials for the host resource and click OK as shown in Figure 62.

Figure 62

Figure 62

Select the appropriate template and VDA version and or functionality desired and click Next as shown in Figure 63.

Figure 63

Figure 63

Select the vDisk and click Next as shown in Figure 64.

Figure 64

Figure 64

Select whether to Create a new catalog or Use an existing catalog and click Next as shown in Figure 65. If you Create a new catalog, enter a Catalog name and Description.

Note: The wizard creates a Machine Catalog in XenDesktop and a Device Collection in PVS with the Catalog name entered here.

Figure 65

Figure 65

Select Windows Desktop Operating System and click Next as shown in Figure 66.

Figure 66

Figure 66

Since we are using PvD, select The same (static) desktop, also select Save changes and store them on a separate personal vDisk and click Next as shown in Figure 67.

Figure 67

Figure 67

Make the appropriate choices.

For this lab, I am creating 3 VMs (desktops) with 2 vCPUs, 2 GB RAM, a 10GB write cache disk, a 20 GB PvD disk, changing the PvD drive to Y and selecting BDM disk. Click Next as shown in Figure 68.

Note: If you do not see the option Local write cache disk that means you left the vDisk at the default of Cache on server. Exit this wizard, correct the vDisk properties and rerun the wizard.

Figure 68

Figure 68

Select Create new accounts to have new AD computer accounts created and click Next as shown in Figure 69.

Figure 69

Figure 69

Select the Domain, OU, Account naming scheme and click Next as shown in Figure 70.

Figure 70

Figure 70

Verify the Summary information, click Finish, as shown in Figure 71, and the wizard will begin creating the following:

  • Virtual Machines
  • AD computer accounts
  • Target Devices
  • Machine Catalog in XenDesktop Studio
  • BDM
Figure 71

Figure 71

When the wizard is complete, click Done as shown in Figure 72.

Figure 72

Figure 72

Looking at the Device Collection in the PVS console (you may need to right-click the Site and select Refresh) shows the three target devices as seen in Figure 73.

Note: In the previous articles, each of the new target devices always booted automatically, one at a time,  with no intervention on my part.  That did not happen with BDM.

Figure 73

Figure 73

Looking in Active Directory Users and Computers shows the new computer accounts as seen in Figure 74.

Figure 74

Figure 74

In the hypervisor, look at the storage for one of new virtual machines.  You will see a BDM partition has been created as shown in Figure 75.

Figure 75

Figure 75

Change each of the new VMs to boot only from the hard drive.

Power on each of the new VMs.  As shown in Figure 76, the VMs will boot from BDM.

Each VM will power on and then shutdown.  This is normal.

Note: In the previous articles, each of the VMs powered on and shutdown automatically with no intervention on my part.  This did not happen with BDM.

Figure 76

Figure 76

Add Machines to Machine Catalog

In Citrix Studio, right-click on the Machine Catalogs node and select Refresh. The new Machine Catalog created by the XenDesktop Setup Wizard is shown in Figure 77.

Figure 77

Figure 77

Note: In the previous articles, I did not have to manually add the machines to the Machine Catalog before I created the Delivery Group.

Click Add Machines in the right Actions pane as shown in Figure 78.

Figure 78

Figure 78

Enter the IP address of the PVS server and click Connect as shown in Figure 79.

Figure 79

Figure 79

Select the Device Collection that contains the new machines and click Next as shown in Figure 80.

Figure 80

Figure 80

Review the Summary information and click Finish as shown in Figure 81.

Figure 81

Figure 81

The machines are added to the Machine Catalog as shown in Figure 82.

Figure 82

Figure 82

Create XenDesktop Delivery Group

Currently there is no Delivery Group to deliver the desktops. Right-click the Delivery Groups node in Citrix Studio and select Create Delivery Group as shown in Figure 83.

Figure 83

Figure 83

Click Next as shown in Figure 84.

Figure 84

Figure 84

Select the Machine Catalog and the number of machines to be added from the catalog to this delivery group and click Next as shown in Figure 85.

Figure 85

Figure 85

Select Desktops and click Next as shown in Figure 86.

Figure 86

Figure 86

Click Add… as shown in Figure 87.

Figure 87

Figure 87

Use the Select Users or Groups dialog to add users and click OK as shown in Figure 88.

Figure 88

Figure 88

Click Next as shown in Figure 89.

Figure 89

Figure 89

Select the appropriate StoreFront option and click Next as shown in Figure 90.

Figure 90

Figure 90

Enter a Delivery Group name, Display name, an optional Delivery Group description for users and click Finish as shown in Figure 91.

Figure 91

Figure 91

From here, there are many options that can be configured. For this lab, I edited the Delivery Group and set both Weekdays and Weekend peak hours to 24 hours as shown in Figure 92.

Figure 92

Figure 92

Every XenDesktop project I have been on, the customer wants all desktops powered on at all times. To do this, on a Controller start a PowerShell session and enter the following commands as shown in Figure 93:

add-pssnapin *citrix*

Get-brokerdesktopgroup | set-brokerdesktopgroup -PeakBufferSizePercent 100

Note: I had a reader leave me a comment on the original article that said this setting does not apply to user assigned desktops. But, I never got more than one desktop to start (out of the three in my lab) until I set the PeakBufferSizePercent. As soon as I entered that command, within a few seconds the other two desktops powered on.

Figure 93

Figure 93

Exit the PowerShell session. After a few minutes, all the desktops will power on. Back in the PVS console, the vDisk will show three connections and all three target devices will be powered on as shown in Figures 94 and 95.

Figure 94

Figure 94

Figure 95

Figure 95

Understanding How Personal vDisk Works

Now let us look at how the Write Cache and PvD drives work.

All three desktops are powered on. I will log in as a different user into each desktop.

All three users are presented with the standard Windows 7 desktop configured during the creation of the master image VM as shown in Figure 96.

Figure 96

Figure 96

Before we take a look at user customization and personalization, let’s see what is on the Write Cache and PvD drives. I had to show system and hidden files and operating system files. Figures 97 and 98 show the Write Cache drive which shows the write cache file, page file and the EventLogs folder.

Figure 97

Figure 97

Figure 98

Figure 98

Figure 99 shows there is not much of anything useful to see on the PvD drive.

Figure 99

Figure 99

What about the BDM partition?  As shown in Figure 100, it is an 8MB partition that does not have a file system recognized by Windows and is not seen by the user.

Figure 100

Figure 100

Back in Citrix Studio, refresh the Delivery Group and you will see there are now Sessions in use with no Unregistered or Disconnected machines as shown in Figure 101.

Figure 101

Figure 101

Double-click the Delivery Group to see detailed information as shown in Figure 102.

Figure 102

Figure 102

The first user is Ms. Know-It-All who probably knows Windows 7 better than the helpdesk team. She configures her desktop to get all the Windows 7 “frilly” stuff out of her way as shown in Figure 103.

Figure 103

Figure 103

The second user is Ms. Tree Hugger who wants a pretty cool picture for her background as shown in Figure 104.

Figure 104

Figure 104

The third user is Ms. Astrophysicist who needs a picture of her Tesla as her background as shown in Figure 105.

Figure 105

Figure 105

Now that each user has customized their desktop, reboot each desktop, log back in to each desktop and verify the user’s customizations persisted.

User Installed Software

What about installing software? User1 installed NotePad++ since she knows more than you do anyways, User2 installed Google Chrome to save the world from Internet Exploder and User3 installed Mathematica so she could do some physics work. The three desktops are shown in Figures 106 through 108.

Figure 106

Figure 106

Figure 107

Figure 107

Figure 108

Figure 108

Now that each user has installed an application, reboot each desktop, log back in to each desktop and verify the user’s installed application persisted. Since we are using PvD to allow users to install applications, where are the applications installed? Looking at User1, we can see that Notepad++ was installed to c:\Program Files\Notepad++ as shown in Figure 109.

Figure 109

Figure 109

User2’s Google Chrome is installed to C:\Program Files\Google\Chrome\Application as shown in Figure 110.

Figure 110

Figure 110

User3’s Mathematica is installed to C:\Program Files\Wolfram Research\Mathematica\10.0 as shown in Figure 111.

Figure 111

Figure 111

The C drive view is a combination of the hidden drive, V by default, and C. When users install applications they will install as usual to the C drive. There is no need to install to the visible PvD drive, P by default.

Updating the Master Image

How is the master image updated if an application needs to be installed that all users need? Simple, in the PVS console create a Maintenance version, update it, test it and then make it available to users. In the PVS console, right-click the vDisk and select Versions as shown in Figure 112.

Note: The virtual machine used for updating the Master Image must not have a PvD disk attached.

Figure 112

Figure 112

Click New as shown in Figure 113.

Figure 113

Figure 113

A new Maintenance version of the vDisk is created as shown in Figure 114. Click Done.

Figure 114

Figure 114

In the PVS console, go to the Device Collection the original master target device is in, right-click the target device and click Properties as shown in Figure 115.

Figure 115

Figure 115

Change the Type from Production to Maintenance and click OK as shown in Figure 116.

Note: In a production environment, you would have a dedicated Target Device to use for Maintenance versions of vDisks.

Figure 116

Figure 116

In the hypervisor, start that VM and open the VM’s console. An option to boot into either the Production version or the Maintenance version is shown. Select the Maintenance version as shown in Figure 117.

Figure 117

Figure 117

What has happened is that the target device has been configured to boot from a Maintenance image and during the bootup communication, the PVS server recognized the MAC address and offered the target device the maintenance vDisk to boot from. The maintenance vDisk is in Read/Write mode so changes can be made to the vDisk. Login to the desktop with domain credentials. I installed Adobe Acrobat Reader as shown in Figure 118.

Note: Whatever software is installed, verify that any license agreements and popups are acknowledged and any other configurations needed are done before sealing the image and running the PvD Inventory. For example, in Acrobat Reader I acknowledged the license agreement and disabled updater.

Figure 118

Figure 118

Before running the PvD Inventory, follow your standard procedure for sealing the image. This process is unique to every environment. For my lab, I have no antivirus software and I am not using WSUS so I have no registry keys to clear out. Manually run the PvD Inventory. Click Start, All Programs, Citrix, Update personal vDisk as shown in Figure 119.

Figure 119

Figure 119

The PvD inventory starts. Leave Shut down the system when update is complete selected as shown in Figure 120.

Figure 120

Figure 120

After the inventory completes, the VM is shutdown. Once the VM has shut down, in the PVS console, right-click the vDisk and select Versions as shown in Figure 121.

Figure 121

Figure 121

Select the Maintenance version and click Promote as shown in Figure 122.

Figure 122

Figure 122

PVS 7.6 adds the ability to now have a Test version for a vDisk that uses PvD.  This was not possible prior to version 7.6.

Select Test and click OK as shown in Figure 123.

Figure 123

Figure 123

The vDisk version is promoted to Test, as shown in Figure 124. Click Done.

Figure 124

Figure 124

In the PVS console, go to the Device Collection the original master target device is in, right-click the target device and click Properties as shown in Figure 125.

Figure 125

Figure 125

Change the Type from Maintenance to Test and click OK as shown in Figure 126.

Note: In a production environment, you would have dedicated Target Devices to use for Test versions of vDisks.

Figure 126

Figure 126

In the hypervisor, start that VM and open the VM’s console. An option to boot into either the Production version or the Test version is shown. Select the Test version as shown in Figure 127.

Figure 127

Figure 127

What has happened is that the target device has been configured to boot from a Test image and during the bootup communication, the PVS server recognized the MAC address and offered the target device the Test vDisk to boot from. The Test vDisk is in Read-only mode so no changes can be made to the vDisk. Login to the desktop with domain credentials.

There are several things to notice with the Test version of the vDisk:

  1. The application that was installed for all users is there (Figure 128),
  2. The vDisk is in Read-only mode (Figure 129), but
  3. The write cache is located on the PVS server (Figure 130) because,
  4. There is no Write Cache drive (Figure 131),
  5. There is no PvD drive attached (also Figure 131), but
  6. The stub holders for the write cache and PvD drives are still there (Figure 132).
Figure 128

Figure 128

Figure 129

Figure 129

Figure 130

Figure 130

Figure 131

Figure 131

Figure 132

Figure 132

Why is there no BDM partition in Figure 132?  The BDM partition was created for the VMs created by the XenDesktop Setup Wizard.  The VM used for the Maintenance and Test versions is the original VM used to create the vDisk placed into PVS.  The original VM boots from the network so it can connect to the vDisk.

Once testing is completed, shutdown the VM.

Once the VM has shut down, in the PVS console, right-click the vDisk and select Versions as shown in Figure 133.

Figure 133

Figure 133

Select the Test version and click Promote as shown in Figure 134.

Figure 134

Figure 134

Select Immediate and click OK as shown in Figure 135.

Figure 135

Figure 135

The updated vDisk is now available for use as shown in Figure 136. Click Done.

Figure 136

Figure 136

Verify the Master Image Update

Restart the desktops for them to start using the updated vDisk. The desktops will automatically reboot after a few minutes. This is normal. Wait until this reboot is complete before allowing the users access to the desktop. Log in to each desktop and verify the new application is available and the user’s original customizations and installed applications persisted after the update. The three desktops are shown in Figures 137 through 139.

Figure 137

Figure 137

Figure 138

Figure 138

Figure 139

Figure 139

And there you have it, one way to do a XenDesktop 7.6 with Personal vDisk using BDM process.

Citrix lists four ways to do this process in eDocs, three with PVS and one with MCS. http://support.citrix.com/proddocs/topic/provisioning-7/pvs-inventory-vdisks-pvd.html

I think it is strange they have MCS listed as a process in the PVS documentation but that is beside the point.

I hope this detailed process explanation will help you in working with PvD and BDM with XenDesktop 7.6 and PVS 7.6.

There is a PDF of this article available for $1.99.

Thanks

 

Webster

 

You just finished reading Citrix XenDesktop 7.6, Provisioning Services 7.6 and the XenDesktop Setup Wizard with Boot Device Manager, Write Cache and Personal vDisk Drives on Carl Webster. Please consider leaving a comment!

Learning the Basics of Citrix Provisioning Services and XenApp 5 for Windows Server 2003

$
0
0

The three-part PVS/XenApp series was originally designed to be one part before it became a novel and needed to be split up.  This PDF is the three-parts rolled back with the necessary changes to make it one part.  The Behind the Scenes write-up is also included at the end.  The PDF is 100 pages long with all 161 screen shots.  Printing is allowed.

You just finished reading Learning the Basics of Citrix Provisioning Services and XenApp 5 for Windows Server 2003 on Carl Webster. Please consider leaving a comment!


Citrix XenDesktop 7.1, Provisioning Services 7.1 and the XenDesktop Setup Wizard with Write Cache and Personal vDisk Drives

$
0
0

73 pages long with 118 screen shots.

This a PDF of this article: http://carlwebster.com/citrix-xendesktop-7-1-provisioning-services-7-1-xendesktop-setup-wizard-write-cache-personal-vdisk-drives/

Topics covered:

  • Introduction
  • Lab Setup
  • Create the Virtual Machine
  • Install PVS Target Device Software
  • Configure the vDisk in PVS
  • Install the Virtual Delivery Agent
  • Update Personal vDisk Software
  • Configure Personal vDisk
  • PVS XenDesktop Setup Wizard
  • Create XenDesktop Delivery Group
  • Understanding How Personal vDisk Works
  • User Installed Software
  • Updating the Master Image
  • Verify the Master Image Update

You just finished reading Citrix XenDesktop 7.1, Provisioning Services 7.1 and the XenDesktop Setup Wizard with Write Cache and Personal vDisk Drives on Carl Webster. Please consider leaving a comment!

PVS V2 Documentation Script Has Been Updated 07-JUN-2013

$
0
0

A reader, Corey Tracey, emailed me and told me I missed the vDisk Load Balancing menu item for PVS 6.x.  OOPS!  That is now fixed.

Here is what I missed for vDisk Pool:

Load Balancing menu

Load Balancing menu

vDisk Load Balancing

vDisk Load Balancing

This was already in the report for PVS 5.x but for PVS 6.x was moved out of the vDisk Properties and onto a separate menu level.

The changes I made to the V2 PVS script are very minor.  I changed the internal version number to 2.02 but left the filename unchanged.

If you have any suggestions for the script, please let me know.  Send an e-mail to webster@carlwebster.com.

NOTE: This script is continually updated.  You can always find the most current version by going to http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

You just finished reading PVS V2 Documentation Script Has Been Updated 07-JUN-2013 on Carl Webster. Please consider leaving a comment!

PVS V2 Documentation Script Has Been Updated 17-JUN-2013

$
0
0

A reader, Corey Tracey, emailed me and asked me if there was way to run the PVS V2 script from one computer against multiple untrusted domains that each contain a PVS Farm.  Turns out there was a way but it was not an easy task.

The PVS PowerShell documentation shows the McliRun –SetupConnection has parameters that will handle Corey’s request.  From the Citrix Provisioning Services  6.1 PowerShell Programming Guide:

Setup of the SOAP Server Communication

Unless the defaults are fine, use this command to set the values for the SOAP Server connection:

Mcli-Run SetupConnection -p name=value[, name2=value2]

Setup the SOAP server connection that will be used for the MCLI and PowerShell command line interfaces.

-p

Parameters needed for this Run.

Optional

server          Server used for the connection.  Default=localhost

port             Port used for the connection.  Default=8000

user             User used for the connection.  Default=Current user

domain       User domain used for the connection.  Default=Current user

password    User password used for the connection.  Default=Current user

Unfortunately, the pathetic piece of crap that Citrix calls the PVS PowerShell implementation made this much more difficult than it should have been to implement.  I really hope one of these days  Citrix will fix their pathetic PowerShell implementations for both PVS and XenDesktop.  Citrix should have and could have done a better job with their PowerShell work.    The teams at Citrix who create these PowerShell implementations should have and take more pride in their work.

There are two ways to enter the new parameters.  All three parameters (User, Domain, Password) can be entered or just the User.  If  just the User is entered, the script will prompt for Domain and Password.

Corey tested this on his multiple untrusted domains and said the script worked flawlessly.

The changes I made to the V2 PVS script are very minor.  I changed the internal version number to 2.03 but left the filename unchanged.

If you have any suggestions for the script, please let me know.  Send an e-mail to webster@carlwebster.com.

NOTE: This script is continually updated.  You can always find the most current version by going to http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

You just finished reading PVS V2 Documentation Script Has Been Updated 17-JUN-2013 on Carl Webster. Please consider leaving a comment!

Provisioning Services 7 and Server 2012 Group Managed Service Account

$
0
0

Citrix released Provisioning Services version 7 (PVS7) with support for running on Microsoft Windows Server 2012.  Server 2012 has a really nice new feature called Group Managed Service  Accounts (gMSA).  Even though Citrix had to test installing PVS7 on Server 2012, I found out that Citrix never tested using gMSA for the Stream or SOAP services.  This article is my attempt to see if PVS7 will allow the use of a gMSA for the Stream and SOAP services.

I have absolutely no idea if PVS7 running on Server 2012 will work with a gMSA or not.  Citrix says it should work but the articles I have read from Microsoft make it seem like the application must be written to support and work with gMSA.  You will find out the same time I do whether this experiment will work.

To get more information on gMSA, please read this TechNet article.

There are three requirements to use a gMSA:

  1. At least one Windows Server 2012 Domain Controller.
  2. A Windows Server 2012 or Windows 8 computer with the ActiveDirectory PowerShell module, to create/manage the gMSA.
  3. A Windows Server 2012 or Windows 8 domain member to run/use the gMSA.

I installed a Server 2012 Domain Controller into my lab environment and I will use it to create and manage the gMSA.

Step 1: Create the Key Distribution Services (KDS) Root Key

The KDS Root Key is used by the KDS service on domain controller to generate passwords.  On my Server 2012 Domain Controller, I will run from an elevated PowerShell session:

Add-KDSRootKey –EffectiveImmediately

Figure 1

Figure 1

The TechNet article says the key can take up to 10 hours to replicate and take effect.  Since I only have one Server 2012 domain controller and only two domain controllers in my lab, I am not worried about the replication time.  By the way, it took almost one hour in my lab before the key was usable!

Step 2: Create and configure the gMSA

I am going to create a Security Group containing my two PVS7 servers.  This security group will contain the computer accounts allowed to use the gMSA.

Figure 2

Figure 2

Figure 3

Figure 3

Figure004

Next, my two PVS7 servers need to be restarted to know they were added to the security group.

From the elevated PowerShell session on my Server 2012 domain controller, I run:

New-ADServiceAccount –Name PVS7StreamSOAP –DNSHostName PVS7StreamSOAP.websterslab.com –PrincipalsAllowedToRetrieveManagedPassword “PVS7gMSAGroup”

Note: The Name is a NetBIOS name that must not be more than 15 characters.

Figure 5

Figure 5

The gMSA now appears in the Managed Service Accounts OU in Active Directory Users and Computers.

Figure 6

Figure 6

Step3: Configure the gMSA on the PVS7 host

Note: The following requires the Active Directory module for Windows PowerShell be installed on the PVS7 host.  It can be uninstalled after the test is successful.

From an elevated PowerShell session on the PVS7 server, I will run the following two cmdlets:

Install-AdServiceAccount PVS7StreamSOAP

Test-AdServiceAccount PVS7StreamSOAP

Figure 7

Figure 7

The Test-AdServiceAccount should return True.  If it returns False, a verbose error message should be included.

Now for the time of truth.  Is this going to work in PVS7 or not.  Start the Provisioning Services Configuration Wizard and go to the User account screen.  The TechNet article says the trick is to use a “$” after the gMSA and leave the password blank.

Figure 8

Figure 8

Let’s see what happens when I click Next?????

What do you know, it let me continue, but we are not done yet.

Figure 8

Figure 8

DOH!!!  I guess PVS7 will NOT work with Server 2012’s Group Managed service Accounts after all!  Total Bummer.

Figure 10

Figure 10

Figure 11

Figure 11

Figure 12

Figure 12

Citrix should fix this pronto.  Actually, this should have been in PVS7 from the initial design for Server 2012 support.  gMSA offers several features that would be very useful in a PVS implementation.  Too bad Citrix doesn’t support gMSA at this time.  I hope this gets fixed fast.

Thanks

Webster

You just finished reading Provisioning Services 7 and Server 2012 Group Managed Service Account on Carl Webster. Please consider leaving a comment!

Documenting a Citrix Provisioning Services Farm with Microsoft PowerShell and Word – Version 3

$
0
0

Now that Citrix has released Provisioning Services (PVS) 7, it was time to update the PVS documentation script to add support for PVS 7.  This article documents the changes made to the script.

To start off with, this updated script would not have been possible without a hard-working, dedicated group of testers.

  • Anton van Pelt
  • Chris Staton
  • Dane Young
  • David Figueroa
  • Jarian Gibson
  • Kees Baggerman
  • Martin Therkelsen
  • Rene Vester
  • Robin Plomp
  • Stephane Thirion
  • Thomas Gamull

PVS 7 includes four new items.  The XenDesktop Setup Wizard adds Local write cache disk and Boot mode as seen in Figure 1.

Figure 1

Figure 1

There are also Streaming IP addresses and Management IP  as shown in Figure 2.

Figure 2

Figure 2

Citrix also added the text (minutes:seconds) to two items in the Advanced button of the properties of the Server as shown in Figures 3 and 4.

Figure 3

Figure 3

Figure 4

Figure 4

This necessitated the need for a Function to convert seconds to minutes:seconds.

Function SecondsToMinutes
{
	Param( $xVal )

	If( [int]$xVal -lt 60 )
	{
		Return "0:$xVal"
	}
	$xMinutes = ([int]($xVal / 60)).ToString()
	$xSeconds = ([int]($xVal % 60)).ToString().PadLeft(2, "0")
	Return "$xMinutes`:$xSeconds"
}

Previous versions of PVS also displayed the time selected in the slider as minutes:seconds but the (minutes:seconds) text is not there in the GUI.

There was other glaring glitch I noticed when the testers from outside the USA sent me their sample reports.  My Word 2007/2010/2013 are set for Default Tab Stops of ½ inch.  But I noticed that some reports had tab stops of 3/8 inch, some 5/8 inch and also 7/8 inch.  That was driving me crazy since all the reports looked different.  After much trial and error, I found the solution was to use PowerShell to set the DefaultTabStop property of the Word document.

$Word.ActiveDocument.DefaultTabStop = 36

The setting is configured in points where 72 points is 1 inch and 36 points is ½ inch. This setting, so far, has worked in all the sample reports sent to me by testers in five different countries.

Once I figured out how to set the DefaultTabStop, I was able to get all the items in the report to align properly.  Thanks to all the testers for putting up with a flurry of script changes over two days to get every section (that the testers had data for) aligned properly.

Please let me know if you spot anything not aligning properly.

Since this is a major change to the script, the version number has changed to V3.  V4 development is already under way.

If you have any suggestions for the script, please let me know.  Send an e-mail to webster@carlwebster.com.

NOTE: This script is continually updated.  You can always find the most current version by going to http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

Thanks

Webster

You just finished reading Documenting a Citrix Provisioning Services Farm with Microsoft PowerShell and Word – Version 3 on Carl Webster. Please consider leaving a comment!

Viewing all 59 articles
Browse latest View live