This article explains how to create a Platform layer that allows Layered Images to run flawlessly when deployed to Citrix MCS running on Citrix XenServer.
When creating a platform layer, the software installers for your platform must be available in a location that's accessible to the packaging machine (a virtual machine) where you are going to create the layer.
When you create a platform layer for publishing images to a Machine Creation Services environment, you need:
Network access to App Layering tools
Access from the platform layer packaging machine virtual machine to the OS machine tools (in the installation download package).
Citrix Virtual Delivery Agent (VDA) installed on the platform layer
Install the Citrix VDA installer for the Windows operating system you are using on the platform layer.
Citrix Delivery Controller
Install the Citrix Delivery Controller software on the server where you publish the layered image.
As part of the Connector Configuration, if you include a script to run on the newly published layered image, you need the following:
Citrix resource information
The Citrix information listed in the topic Connectors for publishing.
You need any software and settings required to install your hypervisor onto the Platform layer.
You need any installers, tools, and settings required to run your connection broker on the hypervisor you are using.
This section explains how to:
To create a platform layer, or add a new version to one
Select Layers > Platform Layers and select Create Platform Layer in the Action bar. This opens the Create Platform Layer wizard.
On the OS Layer tab, select the OS layer that you want to associate with this platform layer.
On the Connector tab, choose a Connector Configuration for the platform where you are creating this layer. If the configuration you need isn't listed, add a New Connector Configuration and select it from the list.
Example: If you create the layer in your XenServer environment, select the XenServer connector with the information needed to access the temporary storage location where you package this layer.
On the Platform Types tab, select This platform will be used for publishing Layered Images, and the hypervisor, Provisioning Service, and Connection Broker to which you will publish the layered image.
Note: If you are not using any of the items in step 5, select None. For example, if you are not using a connection broker,
On the Packaging Disk tab, enter a file name for the Packaging Disk, and select the disk format. The disk is used for the Packaging Machine (the virtual machine) where you install the tools, as described in the next two sections.
On the Icon Assignment tab, select an icon to assign to the layer. This icon represents the layer in the Layers Module.
On the Confirm and Complete tab, review the details of the app layer, enter a comment if required, and click Create Layer. Any comments you enter appear in the Information view Audit History.
Expand the Tasks bar at the bottom of the page and double-click the packaging disk task to show the full task description.
After creating the packaging disk, the Taskbar displays the location of the packaging disk in your environment.
Next, you can deploy the packaging machine for your layer.
A packaging machine is a virtual machine where you install the tools for your selected environment.
Note: The packaging machine is a temporary virtual machine that is deleted when the new platform layer is finalized.
Log into the packaging machine
The Task Description (example shown in the last step above) contains the location of the packaging machine in your environment.
This section explains how to install the platform software to be used by the platform layer. The platform software to install includes the provisioning server software and/or connection broker software that your layered images need to run in the target environment.
Keep in mind that the state of the software before you finalize the layer is what the image will use.
Remote log on to the packaging machine you created. Be sure to log on by using the user account you used to create the operating system.
Install the tools that your layered image needs to run in your environment. You can include any hypervisor, provisioning service, and connection broker software that you're using, along with any drivers, boot-level applications, and files needed.
If a system restart is required during installation, restart it manually. The packaging machine does not restart automatically.
Make sure the packaging machine is in the state you want it to be in when the image starts:
Next, you'll need to shut down the packaging machine and verify that the platform layer is ready to finalize.
Once the tools are installed on the Packaging Machine, the next step is to verify that the Layer is ready to finalize. At this point, any required post-installation processing needs to be completed. For example, a reboot may be required, or a Microsoft NGen process may need to complete.
To verify that any outstanding processes are complete, you can run the Shutdown For Finalize tool (icon below), which appears on the Packaging Machine's desktop.
To shut down the Packaging Machine so you can finalize the layer
The Layer is now ready to finalize.
Layer integrity messages you may see during the finalization process
Layer integrity messages let you know what queued tasks must be completed before a Layer is finalized.
Note: If a Microsoft NGen operation is in progress, you may be able to expedite it, as described in the next section.
Expediting a Microsoft NGen operation
NGen is the Microsoft Native Image Generator. It is part of the .NET system, and basically re-compiles .NET byte code into native images and constructs the registry entries to manage them. Windows will decide when to run NGen, based on what is being installed and what Windows detects in the configuration. When NGen is running, you must let it complete. An interrupted NGen operation can leave you with non-functioning .NET assemblies or other problems in the .NET system.
You have the choice of waiting for the NGen to complete in the background, or you can force the NGen to the foreground. You can also check the status of the NGen operation, as described below. However, every time you check the queue status, you are creating foreground activity, which might cause the background processing to temporarily pause.
Forcing the NGen to the foreground will allow you to view the progress and once the output has completed, you should be able to finalize the layer.
Force an NGen operation to the foreground.
Normally, NGen is a background operation and will pause if there is foreground activity. Bringing the task into the foreground can help the task to complete as quickly as possible. To do this:
Open a command prompt as Administrator.
Go to the Microsoft .NET Framework directory for the version currently in use:
Enter the NGen command to execute the queued items:
ngen update /force
This brings the NGen task to the foreground in the command prompt, and lists the assemblies being compiled.
Note: It’s okay if you see several "compilation failed" messages!
Check the status of an NGen operation
Open a command prompt as Administrator.
Check status by running this command:
ngen queue status
When you receive the following status, the NGen is complete, and you can finalize the Layer.
"The .NET Runtime Optimization Service is stopped."
Once the packaging machine is created, the software is installed and ready to finalize, and you have shut down the machine, you'll need to finalize the layer.
Note: When you finalize a layer, the App Layering software may delete the packaging machine so as not to incur extra cost for storage.
When the layer has been verified and is ready to finalize: