This post has already been read 12650 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:
- A Citrix Lifecycle Management Resource Location set up and pointing to your Microsoft Azure environment. To do this follow my previous post.
- A Domain Controller running on your cloud provider.
- A service account with Member Server Admin rights to install the software
- 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:
- Build Windows Server
- Reboot
- Download Software Installers
- Dot Net 4.5.1
- Citrix StoreFront 3.0
- Install Windows Features
- Install Dot Net
- Reboot
- Install StoreFront 3.0
- Setup Store
- 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
Add the general Details for the Script
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
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.
Click Next and Finish.
You will now see a new script “Download Web File – Amazon 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
Fill out the general Details for Add Windows Features
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
}
Add a parameter called servicename
Finish the script
You should now see a script called “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
Fill out the Install Program General Details
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)”
}
Add the 2 parameters to the script. One for the Installer File and one for the arguments passed in
Click finish to add the script
You should now see a Script for 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
Fill out the configure StoreFront General Settings
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
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.
Click next and finish
You will now see the Configure StoreFront script ready to go.
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
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.
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.
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:
- Build Windows Server
- Reboot
- Download Software Installers
- Dot Net 4.5.1
- Citrix StoreFront 3.0
- Install Windows Features
- Install Dot Net 4.5.1
- Reboot
- Install StoreFront 3.0
- Setup Store
- 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.
Download StoreFront from S3
Download Dot Net from S3
Add Windows Feature .Net
Install Dot Net 4.5.1
Reboot
Install StoreFront 3.0
Configure StoreFront 3.0
NOTE: I have left the parameters blank here to prompt the user for the values during the blueprint deployment.
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.
Hope this helps some of you out, as always, please share and comment.
Laters
b@m