Wilco van Bragt - LinkeIn Wilco van Bragt - Twitter rssa 

Running Citrix Presentation Server with Ardence OS Streaming

Introduction

Ardence's OS-streaming capabilities represent a significant step forward in the virtualization evolution. Using Ardence software, the complete operating system can be virtualized, providing many advantages in terminal servers environments. Citrix expert Brian Madden has previously published a white paper offering a conceptual view of Ardence in combination with Citrix Presentation Server. This white paper goes a step further, actually describing how to run Citrix Presentation Server with Ardence's OS-streaming software.

Ardence OS Streaming Basics




 

For those who have not read Brian Madden's white paper or who are not familiar with OS streaming, the following is a basic description of how Ardence OS-streaming works.

With operating system virtualization nothing is pre-installed or permanently loaded on the local device and no hard-disk drive is needed. Everything is run from the network using what Ardence refers to as a virtual disk (or vDisk). There can be private vDisks or shared vDisks. A private vDisk is used by one client only, just like a local hard disk. Depending on the rights assigned, the user can save information on the vDisks. Secondly, there are shared vDisks used by multiple clients at the same time. During usage, changes are saved in a special cache, but when the client is shutdown or restarted the cache will be cleared. In other words when the client is booting up it will use the default configuration available on the vDisk.

Shared vDisks are created by copying the image of one machine that is installed traditionally and then storing that mage as a file on the network. Ardence software assures that when individual clients boots each has a unique identifier in the infrastructure.

Private VDisks are of little interesting in terminal server environments, except that because you do not need hard disks there is an additional security benefit. But the standard VDisk is very interesting in a terminal server infrastructure.

Advantage of OS streaming in combination with terminal servers

  • Flexible provisioning

With Ardence OS streaming you can provision servers on-demand from bare metal, assigning any vDisks to any server in the system. When using the silo principle (also called Application Load Managed Groups) you have a separate vDisk for every silo and when one silo needs additional capacity you can add servers by assign the needed vDisk to servers from another silo that are not busy at the same moment. Because no software is preloaded or permanently installed, re-provisioning can be done on-demand.

  • Rapid software (OS/Apps) deployment

Similarly, adding a new server to your farm takes just a few minutes. Instead of installing and configuring the servers manually or via a deployment tool that will take at least a few hours, assigning an Ardence vDisk requires just a few steps before the server goes into production.

  • Servers are always 100% identical

Servers in the same silo all use the same standard vDisk. Because they are using the same vDisk the installation and configuration of the operating system/applications is identical.

  • Easy implementation of updates and hotfixes to the operating system and applications

With Ardence, an update or hotfix can added to the single standard vDisk instead of to each server. You can create a new vDisk (during normal working hours), which includes the update or hotfix and quickly test it easy by assigning the updated vDisk to one machine. If the tests are successful, this vDisk can be assigned to all the other terminal servers.

  • Easy rollback scenarios

Although the update or hotfix was tested thoroughly, during production there can be unexpected challenges. By assigning the previous working vDisk to those servers and restarting them you are back in the previous state in an easy and quick method.

  • After a restart the system is back in clean state

If you are struggling with strange behavior on a server, often a complete re-installation is the only solution. With Ardence, such a machine only needs to be restarted. At start-up the default vDisk configuration is loaded again and the machine is running as expected again.

Citrix Presentation Server 4/4.5 components are containing server name(s).

As already described in the Overview, imaging technology is used to create the vDisk. Within this vDisk the Ardence product assigns a unique computer name for each Ardence client. For Citrix Presentation Server there are several components that need some modifications to ensure that the CPS software will be unique for each Ardence client.

  • Registry

When Citrix Presentation Server is installed, the actual computer name is added to the registry at [HKLM]\Software\Citrix\IMA.

  • MF20.DNS

This file contains the ODBC configuration for connecting to the Citrix Datastore. Within the configuration the computer name is added during the installation of Citrix Presentation server.

  • Local Host cache

Every Citrix Presentation Server creates a local copy of the Citrix Datastore during the start-up. This local database is called the Local Host Cache and should be re-created if a Citrix Presentation Server will be imaged.

  • Local Resource Manager databases

Within the Enterprise Edition of Citrix Presentation Server the Resource Manager component is available. Resource Manager has the possibility to store the counters of the metrics into an SQL database for reporting. The information is stored per server in local database and at a specific time per day this information is collected and stored in the SQL database. When a Citrix Presentation Server is installed these local databases are created by the installation program with logical the computer name included in the records.

  • RadeOffline database & DSN file

New in Citrix Presentation Server 4.5 is the Streaming Server component. This component makes it possible to stream applications to Citrix Presentation Servers and workstations. For offline access of streamed applications Citrix Presentation Server is keeping record of this offline access in the RadeOffline database. This corresponding DNS file contains the computer name during the installation. Initial the database is empty (until the streaming server component is being used on that server), but because the computer name is mentioned, it is a good idea to recreate the database when using Ardence OS streaming. More information of this RadeOffline database can be found in the sources paragraph.

Preparing Citrix Presentation Server for Ardence master Imaging

When the Master Image Builder CPS Server is completely installed in the traditional way including the Ardence client software, it is time to prepare this server for creating the image on the Ardence vDisk.

The first step is to set the Citrix Services to manual. By configuring the services to manual you can make changes during the start-up of the Citrix Presentation Server when booting via Ardence OS streaming. The following services need to be set up in the manual state:

  • (Citrix) Independent Management Architecture
  • Citrix XML Service
  • Citrix WMI Service
  • Citrix SMA Service
  • Citrix MFCOM Service (CPS4.5 only) / MetaFrame COM Server (CSP4.0 only)
  • Citrix Print Manager Service
  • Citrix Health Monitoring and Recovery (CPS 4.5 only)
  • Print Spooler

Image
Figure 1: Change the Startup type to manual (CSP4.5)

The next step is to stop some Citrix services to make additional preparation possible. The following services should be stopped:

  • Citrix SMA Service
  • Citrix WMI Service
  • (Citrix) Independent Management Architecture

Image
Figure 2: Stopping the Citrix Services for preparation the server for Ardence

When the services are stopped the last steps can be carried out. This is deleting several files that are available within in the Citrix software folder containing the computer name. These files will be regenerated (with the actual computer name) during the start-up script of the server which is described later on in this article.

The following files need to be deleted:

  • "%PROGRAMFILES%\Citrix\Independent Management Architecture\MF20.DSN"
  • "%PROGRAMFILES%\Citrix\Independent Management Architecture\imalhc.ldb"
  • "%PROGRAMFILES%\Citrix\Independent Management Architecture\imalhc.mdb"
  • "%PROGRAMFILES%\Citrix\Citrix Resource Manager\LocalDB\RMLocalDatabase.ldb"
  • "%PROGRAMFILES%\Citrix\Citrix Resource Manager\LocalDB\RMLocalDatabase.mdb"

CPS 4.5 Only

  • "%PROGRAMFILES%\Citrix\Independent Management Architecture\RadeOffline.dsn"
  • "%PROGRAMFILES%\Citrix\Independent Management Architecture\radeoffline.mdb"
  • "%PROGRAMFILES%\Citrix\Independent Management Architecture\radeoffline.ldb"

Image
Figure 3: Delete the Citrix files containing the computer name

For automation of the start-up of Citrix Presentation Server within the Ardence vDisk it is good idea to create a scheduled task ,which runs at system startup, containing all the tasks as described in the following paragraph. 

Image
Figure 4: System Startup Scheduled Task for automation of startup Citrix Presentation Server.

The above mentioned steps are easy to carry out via a simple script. For convenience this script is enclosed with this whitepaper. Check the script, because it needs some modification to personalize the script for every infrastructure.

Creating the Ardence image

The machine is now ready for imaging to the Ardence vDisk. It's advisable to carry out the above mentioned tasks when I already booted the machine to the Ardence Streaming Server (in this way the scheduled task will not run on the Master Image Builder). The client image build process is exactly the same as described in the Ardence manual. After the image is created, shut down the Master Image Builder and configure the vDisk in standard mode using the Ardence Administrator Console. Once the configuration is done you can assign the vDisk to the desired Ardence client. Do not forget to register the Ardence Client within Active Directory using the Ardence console, so end-users can log in to the Citrix server using their domain account.

Personalizing the Citrix Presentation Server

When the configuration within the Ardence console is finished and the Ardence client is registered in Active Directory, the client can be started using PXE boot and be connected to the Ardence Streaming Server. To get Citrix Presentation Server working within the Ardence vDisk, several steps are required. As mentioned earlier it is good idea to also combine these steps into a script that runs at system start-up. I already prepared a script to carry out these tasks for both CPS4 as CPS 4.5. In this paragraph I will explain the steps which should be carried out in the script and how I accomplished this using scripting.

Within the registry, the new computer name needs to be filled in within the Citrix software hive in the following keys.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\IMA]
"ServerHost"="#CTXSERVER#"

[HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\IMA\RUNTIME]
"HostName"="#CTXSERVER#"

[HKEY_CLASSES_ROOT\AppID\{ED62F4E0-63C2-11D4-94D8-00C04FB0F326}]
"RemoteServerName"="#CTXSERVER#"

[HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\IMA\Logging]
"HostName"="#CTXSERVER#"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{ED62F4E0-63C2-11D4-94D8-00C04FB0F326}]
"RemoteServerName"="#CTXSERVER#"

Figure 5: Registry template for changing settings to the actual computer name. Last three keys for CPS4.5 only.

Because Ardence is taking care of the computer name for the Ardence client, the variable %computername% reflects the actual computer name. Within the script I used a template file (as displayed in figure 5) and the resource kit tool ascr.exe to replace the value #CTXSERVER# with the actual computer name using the variable %computername%. Ascr.exe scans the file for the value #SRVNAME# and replaces that part with the value of %computername% in new registry file. This registry file will be imported silently using regedit /s.

Next is to re-create the MF20.DSN. In this file at the property WSID also the actual computer name should be available. To accomplish this I created a template MF20.DSN file and again with ascr.exe a value with the actual computer name using %computername%. The output file will be stored directly in the correct folder %PROGRAMFILES%\Citrix\Independent Management Architecture. In the included script you should change value behind the property UID with the user account assigned to the database, behind the value database your actual database name (hosting the datastore) and the value behind SERVER with the actual name of your database server. If you are using NT authentication the SQL database you should also use the line TRUSTED_CONNECTION=YES, when using SQL Authentication this line can be removed. Ofcourse you could also script this part or just replace it manually.

[ODBC]
DRIVER=SQL Server
UID=*Datastore User Account*
DATABASE=*Databasename*
TRUSTED_CONNECTION=YES
WSID=#CTXSERVER#
APP=Citrix IMA
SERVER=*DB_SERVER*

Figure 6: MF20.DSN Template

If using Citrix Presentation Server 4.5, the RadeOffline.DSN should be recreated. The procedure is the same as for the MF20.DSN. With a template file and using the tool ascr.exe the property WSID will be changed to the actual computer name. The new file containing the new value will be automatically placed in the correct location (%PROGRAMFILES%\Citrix\Independent Management Architecture).

For Citrix Presentation Server to function (actually to start the Citrix Independent Management Architecture service) the local host cache and the RadeOffline database should be available. Therefore we are recreating those databases via the dsmaint utility. With the command dsmaint recreatelhc the local host cache is created again and with the command dsmaint recreaterade the RadeOffline database is recreated. The dsmaint utility will use the earlier created files to recreate these local databases.  

Now everything is in place to start the necessary (Citrix) services again. In the script the standard net start command followed by the servicename will be used to accomplish this part.

The server is ready for Publishing Applications

By starting the services, the machine is recognized in the Citrix Datastore and from now available for Publishing Applications. If you do not use dynamic provisioning (in other words you always use the same vDisk for the same Ardence Client) you add the server manually to published applications or published desktops from the Citrix consoles once.

When using Dynamic Provisioning (so the Ardence client can be part of different silos) we should accomplish that the server name is automatically added to the Published Applications and/or Published Desktop of that silo group. This can be done using Citrix MFCOM tooling. This  can be accomplished with another script that should be run after the script described above (start the Dynamic Provisioning script out of the start-up script for example).

For this script to work, a system variable should be defined in the vDisk containing a value of the servergroup like SILO1 or Desktop. The script checks the defined value and reads out the applications for that servergroup. These applications are specified in a simple text file and are parsed to the AddServer script of the Dr SDK guide together with the variable %computername%. In this way the server is added to the applications available within the Ardence VDisk.

To accomplish that the server is also removed from the application I used the ServerOffline script by Ron Oglesby which starts as a shutdown script. By specifying the server name and a path to store the Published Application information the server is removed from all Published Applications listed.

Conclusion

This Technical White Paper details what steps are required to use Ardence OS streaming in combination with Citrix Presentation Server in a standard vDisk configuration. With some scripting, the Citrix Presentation Server components can be made unique while using the same vDisk and configuration for the Ardence clients. Even Dynamic Provisioning can be easily integrated using Citrix MFCom for assigning and removing servers from Published Applications and Published Desktops.

Used Resources:

Using Ardence Disk Streaming with Citrix Servers WhitePaper by Brian Madden
Ardence Delivering Value in Citrix Presentation Server Environments Article by Ardence
Radeoffline.mdb in csp4.5 Article by Wilco van Bragt
Cloning Citrix Presentation Server 4 Knowledgebase article by Citrix
Scripting Metaframe Dr SDK Manual by Citrix
Writing a Script to take a MetaFrame Server Offline Article by Ron Oglesby

About the Author:

Wilco van Bragt is the founder and author of the VanBragt.Net Virtualization. On this website Wilco publishes SBC related product reviews, SBC related articles, reviews of freeware products, and blogs about several SBC topics and events. Various reviews and articles written by Wilco are also published on other well-known SBC websites.

Since 2000, Wilco van Bragt`s primary focus has been server based computing using primarily Microsoft and Citrix technologies. Wilco works as a technical consultant for
Login Consultants, an SBC specialist company founded in the Netherlands, on several projects with commercial companies and governments.

Wilco is a certified MCSE (NT, 2000, and 2003), CCA, CCEA (Citrix Metaframe XP, Citrix Presentation Server 4), and CCIA (both Metaframe XP and CPS 4). Wilco is also a Provision Networks VIP and a Microsoft MVP on Terminal Server.

Scripts:

Scriptset for Citrix Presentation Server 4
Scriptset for Citrix Presentation Server 4.5
Dynamic Provisioning Citrix Presentation Servers

PDF White Paper Running Citrix Presenation Server with Ardence OS StreamingCitrix Presentation Servers