Automation of a XenDesktop/XenApp deployment – Part 2


As I discussed during my previous blog there are many parts necessary for a fully functional Citrix XenDesktop / XenApp environment.  In this part of the series we are going to cover the Citrix Licensing server.

The blog will be shorter than the previous blog due to the fact that there is only one component to the Citrix Licensing server. However, we will also cover how to deal with a known issue during automation which is related to automation leaving the license location in the License server empty.

The command line switches for automation of the license component is again very straight forward.

XenDesktop/XenApp Licensing Server

Example – C:\{Location}\x64\XenDesktop Setup\XenDesktopServerSetup.exe /COMPONENTS LICENSESERVER /NOREBOOT /QUIET /CONFIGURE_FIREWALL

This will install the License Server portion of a XenDesktop/XenApp deployment silently and defer the reboot.  You can run this string as many times as you would like and the end result will be the same.

Based upon my experience with automation I have discovered a known issue which is that within the License Server configuration the location of the specified license file will be blank.  This can lead to issues with functionality.

Know Issue with unattended installation

We can automate address this issue through PowerShell.  Below I will outline how to do so.  The company that I work for make a software solution for managing your PowerShell solutions.  This will provide you with a centralized location for management of your scripts, and assist with WHEN the scripts will be executed.  Additionally, you can design your solution 1 time and utilizes the solution anywhere when deploying XenDesktop / XenApp.

  1. Stop the Citrix License Server service
    1. This is done through a net stop command
  2. Parse through the license server configuration xml file located at
    1. C:\Program Files (x86)\Citrix\Licensing\LS\conf\server.xml
    2. This can be done by piping the contents of the XML file into a variable
    3. $serverxml = [xml] (Get-Content -path “C:\Program Files (x86)\Citrix\Licensing\LS\conf\server.xml” )
    4. You have now captured the contents of the XML file
  3. Locate within the XML file where the license file is specified, under the following value and assign it to a variable
    1. $element = $serverxml.configuration.licenseServer.vendorDaemons.daemon
      1. Where-Object {$_.executable -eq “CITRIX”}
    2. Write the value of your licensing file into the XML file
      1. $element.license = “The location of your license file”
    3. Save the server.xml file
      1. $serverxml.Save
    4. Start the Citrix License Server service

 

Bonus points – You could also utilize this level of automation to quickly replace the licensing file within your deployment in an automated method vs. manually going through the License Server web interface.  IE – Whenever it would be time to change out your license file simply replace the file and run the script.

In my next article in the series we will be outlining the process for deployment of the Citrix Studio portion of your XenDesktop / XenApp.  If you have any tips or tricks that could be helpful.  Please share I would love to share ideas, and share any information you are aware with the rest of my readers.

Advertisements

Automation of a XenDesktop/XenApp deployment


There are many pieces involved in deploying Citrix XenDesktop/XenApp.  For simplification purposes while discussing automation, let’s focus on a single feature of a Citrix deployment- the Delivery Controller.

The Delivery Controller is responsible for delivery of either applications or desktops to end users.

The components of a Delivery Controller are:

  • Database – SQL – Pre-requisite
  • Application – Citrix Delivery Controller

Installing each of these components individually is straight forward.  The applications are packaged in such a way that you can utilize a few switches to install the software.

SQL

Example – C:\{Location}\setup.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /ACTION=install /FEATURES=SQL,Tools /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT=”NT Authority\Network Service” /SQLSYSADMINACCOUNTS=domain.local\Administrator /AGTSVCACCOUNT=”NT Authority\Network Service”

This will install SQL on a Windows Server OS silently, and create a database named MSSQLSERVER.

The same can be done with the Delivery Controller.

XenDesktop/XenApp Delivery Controller

Example – C:\{Location}\x64\XenDesktop Setup\XenDesktopServerSetup.exe /PASSIVE /NOREBOOT /CONFIGURE_FIREWALL /COMPONENTS CONTROLLER /NOSQL

This will install the Delivery Controller portion of a XenDesktop/XenApp silently, deferring the reboot and not installing SQL. You can run this string as many times as you would like and the end result will be the same.

Now, let’s get fancy.

In order for the Delivery Controller to function a “Site” must be present.  A site contains all of the data necessary for a Delivery Controller to function, and is stored in your SQL database; this includes configuration and logging information.

A site is the first step necessary to deliver resources with Citrix for your end users.  With PowerShell you can configure this without user interaction, thus enabling you to automate the deployment process.

You will need 3 databases:

  • “Site”
  • “Configuration”
  • “Logging”

 

You can utilize PowerShell to create these with the “New-XDDatabase” command.  This is a function of the “Citrix.XenDesktop.Admin.V1” PowerShell snap-in.  This will enable you to create the three database necessary for a “Site” to function properly.  Once the databases are created, you can create your “Site”.

You can utilize PowerShell to create your “Site” with the “New-XDSite” command.  This is a function of the “Citrix.XenDesktop.Admin.V1” PowerShell snap-in as well.

XDDatabase

Combining packages from Microsoft, Citrix and PowerShell, you are able to automate the process of creating your first “Site” for a critical component of your Citrix deployment, the Delivery Controller.

There are many platforms for managing, and executing your collection of automation frameworks.  Some of the popular ones are Chef, Puppet and Login AM.  It creates a logical organization structure for doing so, variables necessary and provides an interface for management.

If you are interested in finding out more about this, please get in touch with me.

Also, if you have any neat tricks with PowerShell please share them in the comment section.  Happy automating.

I will be following this post up with articles about the remaining components of Citrix.

Article 2 in the series is now live! See it here – Automation of a XenDesktop/XenApp deployment – Part 2

Article 3 online – Automation of a XenDesktop / XenApp Deployment – Part 3

Stay-Tuned-button-1024x192