A Platform Layer should include the platform software and settings required to deploy images in your environment, given your choice of hypervisor, provisioning service, and connection broker.
You can create two kinds of Platform Layers:
Platform Layers for publishing Layered Images (Required) - A Platform Layer for publishing is used in Image Templates to ensure that your published Layered Images include the software and settings required to run flawlessly in your environment.
Platform Layers for packaging Layers (Required in some cases) - A Platform Layer for packaging is used for creating App Layers and OS Layer Versions in your hypervisor environment. This Layer includes the hypervisor software and settings required to easily install the app or OS update on a VM in the selected hypervisor.
When creating a Platform Layer, the software installers for your platform must be available in a location that's accessible to the Packaging Machine VM where you are going to create the Layer. As summarized in the following table, the prerequisites vary based on the type of Platform Layer you choose to create.
|Type of Platform Layer||Prerequisites|
Publishing Layered Images
Software installers, and settings you use for your:
The software and settings for your:
For example, your hypervisor installer and settings.
Note: You only need a Platform Layer for packaging Layers if you are creating your Layers on a different hypervisor than the one from which you imported your OS image.
Citrix XenServer prerequisites
The packaging machine for your layer, a temporary virtual machine where you install the software to include in the layer, is created. Next, you can install the software to include in the layer.
Whether you are creating a Platform Layer or adding a version to it:
Once the software is installed on the Packaging Machine, it is important to verify that the Layer is ready to be finalized. To be ready for finalization, 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 use the Shutdown For Finalize tool:
If you are not logged into the Packaging Machine, remote log in as the user who created the machine.
Double-click the Shutdown For Finalize icon. A command line window displays messages detailing the layer verification process.
If there is an outstanding operation that must be completed before the Layer can be finalized, you are prompted to complete the process. For example, if a Microsoft NGen operation needs to complete, you may be able to expedite the NGen operation. For details, see Verifying Layers.
If you are using KMS licensing, once any pending operations are complete, be sure to rearm KMS yet again just before you shutdown. First, enter this command to verify that the Rearm count is > 0:
Then, rearm KMS:
Double-click the Shutdown For Finalize icon again to shut down the Packaging Machine.
The Layer should be ready to finalize.
During the shutdown for finalization
Layer integrity messages let you know what queued tasks must be completed before a Layer is finalized.
The new Layer or Version can only be finalized when the following conditions have been addressed:
A reboot is pending to update drivers on the boot disk - please check and reboot the Packaging Machine.
A post-installation reboot is pending - please check and reboot the Packaging Machine.
An MSI install operation is in progress - please check the Packaging Machine.
A Microsoft NGen operation is in progress in the background.
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!
Look in the Task Manager to see if an instance of MSCORSVW.EXE is running. If it is, you must allow it to complete, or re-run ngen update /force. Do not reboot to stop the task. You must allow it to complete.
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
To finalize the Layer, you import the installed software into the Platform Layer you prepared in the Management Console.
Return to the Management Console.
Select Layers > Platform Layers.
Select Finalize in the Action bar.
Monitor the Task bar to verify that the action completes successfully and that the layer is deployable.