Guide to building a Citrix StoreFront 3.0 Server on Citrix Workspace Cloud (CWC) Using Citrix Lifecycle Management (CLM)

Guide to building a Citrix StoreFront 3.0 Server on Citrix Workspace Cloud (CWC) Using Citrix Lifecycle Management (CLM)

Guide to building a Citrix StoreFront 3.0 Server on Citrix Workspace Cloud (CWC) Using Citrix Lifecycle Management (CLM)

This post has already been read 8646 times!

In an earlier post I wrote an article on getting started with Citrix Workspace Cloud (CWC) and Citrix Lifecycle Management (CLM).  It was a simple Windows Server Build with 7Zip installed, nice and easy!  I thought I would try and take it to the next level and start to build out some Citrix specific CLM stacks to stand up some useful components that we will need going forward.  I thought I would start with StoreFront.

This post will focus on setting up a Blueprint to fully build and configure a Citrix StoreFront 3 Server hosted in a Microsoft Azure Cloud pulling the software from an Amazon AWS S3 bucket.  Please note – this does not need to be either hosted in Azure or the software pulled from Amazon but I figured as its so cheap to host software there I would use that as an example.

Assumptions

The below is what you will need in place BEFORE following this guide:

  1. A Citrix Lifecycle Management Resource Location set up and pointing to your Microsoft Azure environment.  To do this follow my previous post.
  2. A Domain Controller running on your cloud provider.
  3. A service account with Member Server Admin rights to install the software
  4. Citrix Storefront and Microsoft Dot Net 4.5.1 software downloaded and put into your S3 bucket with “Everyone” read access set up.  (This does not need to be in AWS, it can be hosted on any web server)

Ok, So lets get into the meat of the article.  We will build out the scripts to do each task in the blueprint initially then actually assemble the blueprint later.  The task sequence we want to follow is:

  1. Build Windows Server
  2. Reboot
  3. Download Software Installers
    1. Dot Net 4.5.1
    2. Citrix StoreFront 3.0
  4. Install Windows Features
  5. Install Dot Net
  6. Reboot
  7. Install StoreFront 3.0
  8. Setup Store
  9. Configure Store

Build Windows Server and Boot

These are built in Scripted Tasks in Citrix Lifecycle Management so no need to do anything here.

Download Software Installers

To do this we will create a Scripted task to take in 2 parameters (Web URL and Local File).  This script will then connect to the Web URL and download the software to the local server.

Click New Script

01 - new script

Add the general Details for the Script

02 - add script general

Click Next and copy the following script into the window.  Credit to the Citrix Lifecycle Management team to originally writing this (just took out the bits I needed for this)

Param (
[string]$url,
[string]$localFile,
[int]$retries = 3
)
$ex = “”
for ($i=0; $i -lt $retries; $i++) {
try {
$client = New-Object System.Net.WebClient
$client.DownloadFile($url, $localFile)
return
} catch {
$ex = $_
Start-Sleep -Seconds 5
}
}
throw $ex

03 - script

Click next and add 2 parameters, one for the URL we are connecting to and one for the local file we are downloading the file to.

04 - local file

Click Next and Finish.

05 - script finish

You will now see a new script “Download Web File – Amazon S3”

00 - download s3

Install Windows Features

Again, thanks for Citrix for providing the XenDesktop PoC blueprint that we can grab the code out for this.

Click New Script

01 - new script

Fill out the general Details for Add Windows Features

06 - add windows feature

Click next and paste the following script into the script block window

Param(
[string]$ServiceName
)
$ErrorActionPreference = “Stop”
try {
Import-Module ServerManager
Add-WindowsFeature -Name $ServiceName -IncludeAllSubFeature
} catch {
$error[0]
exit 1
}

07 - add windows feature - script

Add a parameter called servicename

08 - add windows feature - parameters

Finish the script

05 - script finish

You should now see a script called “Add Windows Service”

12 - add windows service

Install Dot Net and StoreFront

To do this we need to create a script to install software onto a specific server accepting command line parameters for the exe or msi executed.

Click New Script

01 - new script

Fill out the Install Program General Details

13 - install program

Click Next and copy the following script to the script block

Param (
[string]$InstallerFile,
[string]$installargs,
)
if (-not (Test-Path $logdir)) {
New-Item -Path $logdir -ItemType Directory | Out-Null
}
$proc = Start-Process -FilePath $InstallerFile -ArgumentList $installargs -Wait
if ($proc.ExitCode -ne 0) {
throw “$InstallerFile error code $($proc.ExitCode)”
}

14 - install prog script

Add the 2 parameters to the script.  One for the Installer File and one for the arguments passed in

15 - install args

Click finish to add the script

05 - script finish

You should now see a Script for Install Program

16 - install program

Setup and Configure Store

Once again I have to refer to Eric from XenAppBlog for this article on the powershell to install and configure Storefront using powershell.  I have used his script and put it into CLM.

Click New Script

01 - new script

Fill out the configure StoreFront General Settings

01 - sf general

Click next and paste the following script into the script block

Param (
[string]$HostBaseURL,
[string]$Farmname,
[string]$Port,
[string]$TransportType,
[string]$sslRelayPort,
[string]$Servers,
[int]$LoadBalance,
[string]$FarmType
)
. “C:\Program Files\Citrix\Receiver StoreFront\Scripts\ImportModules.ps1”
Set-DSInitialConfiguration -hostBaseUrl $HostBaseURL -farmName $Farmname -port $Port -transportType $TransportType -sslRelayPort $sslRelayPort -servers $Servers -loadBalance $LoadBalance -farmType $FarmType

02 - sf script

Enter all the required parameters for the script.

NOTE: TransportType MUST be either HTTP/HTTPS/SSL and FarmType is XenApp or XenDesktop

NOTE2: Make sure you follow the CASE of the variables and values.

03 - sf - params

Click next and finish

05 - script finish

You will now see the Configure StoreFront script ready to go.

04 - configure storefront

Setting up the Blue Print

Now that you have all the scripts in place you can start to put your new blueprint together to build you a Citrix StoreFront server.

Click New Blueprint

24 - new blueprint

Give it a name, description and any tags you need.  Also ensure you have selected the environments that it can be installed on.  In this case I will be using Microsoft Azure.

01 - general

Click on the Deploy Tab.  On the left expand Cloud Step and drag server to the right hand pane.  Add any recommended config that you require and also change the name of the server step to something more meaningful.

02 - base server

Now you can build out the rest of the steps by dragging them and dropping them over to the right.

If you remember the original steps we wanted to run:

  1. Build Windows Server
  2. Reboot
  3. Download Software Installers
    1. Dot Net 4.5.1
    2. Citrix StoreFront 3.0
  4. Install Windows Features
  5. Install Dot Net 4.5.1
  6. Reboot
  7. Install StoreFront 3.0
  8. Setup Store
  9. Configure Store

We can just drag the relevant scripts to the right.

NOTE: When putting the Download Software URL and Local Location’s in remember these as you will need to put them in the Install Software script as well.  I will update the scripts to remember this in the future.

Reboot Step – Notice the selected servers.

03 - reboot step - no parameters

Download StoreFront from S3

04 download storefront

05 - download storefront params

06 - storefront download - run as

Download Dot Net from S3

07 - dot net dwld

08 - dot net install

09 - dot net run as

Add Windows Feature .Net 

10 - windows features

11 - .net params

12 - dot net run as

Install Dot Net 4.5.1

13 - net 4 install

14 - net 4 args

15 - net 4 run as

Reboot

03 - reboot step - no parameters

Install StoreFront 3.0

16 - sf - run on

17 - sf - params

18 - sf run as

Configure StoreFront 3.0

NOTE: I have left the parameters blank here to prompt the user for the values during the blueprint deployment.

19 - csf - run on

20 - csf - params

21 - csf - run as

Done.

If you save your new blueprint you will be able to deploy it to your resource location you have defined.  If you have any questions on deploying a blueprint then please see my previous post here.

Start a deployment – wait 10 minutes and you will have a nice, configured Citrix StoreFront 3.0 Server.

 

 

22 - done

Hope this helps some of you out, as always, please share and comment.

Laters
b@m

 

Leave a Reply

Your email address will not be published. Required fields are marked *