Product Documentation

Citrix PVS connector

Jan 11, 2018

A platform layer includes the platform software and settings required to deploy images in your environment. For example, a platform layer for publishing to Citrix Provisioning Services in XenServer with XenApp as the broker would include the XenServer, Provisioning Services, and XenApp tools, and any other platform-related software.

This article explains the next steps to create a platform layer, based on your connector and platform choices. 

A platform layer includes 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 virtual machine in the selected hypervisor.

Prerequisites

When you create a platform layer, the software installers for your platform must be available in a location that's accessible to the packaging machine virtual machine 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:

  • Hypervisor
  • Provisioning service
  • Connection broker

Packaging Layers

The software and settings for your:

  • Hypervisor
    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

XenServer account and privileges

A XenServer account (new or existing) to use for App layering service.
The account must have XenServer privileges to:

  • Create and remove virtual disks.
  • Copy and delete layers on virtual disks using XenServer file APIs.

Citrix XenServer software and settings

Access to the XenServer Tools to install on the layer.

XenServer resource information

The XenServer info listed in Citrix XenServer Connector Configuration.

Prepare a new platform layer

To create a Platform Layer you prepare the layer by using the Create Platform Layer wizard, deploy a Packaging Machine in your environment, install the tools and configure the settings for Machine Creation Services, and then finalize the layer.

To create a new platform layer

Select Layers > Platform Layers and click Create Platform Layer in the Action menu on the right. The Create Platform Layer wizard opens.

In the Version Details tab:

  1. (Required) Enter a name for the New Version. This can be the software version or other identifying information.
  2. For Base Version, select the version to use as the base for the new layer version. The default is the latest version. 

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 this list.

Example: If you are creating the layer in your XenServer environment, select the XenServer connector with the information needed to access the temporary storage location where you will 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 a hypervisor, provisioning service, or connection broker, select None.

On the Packaging Disk tab, type a file name for the packaging disk, and then select the disk format. This disk is used for the Packaging Machine (the VM) where you install the tools.

On the Icon Assignment tab, select an icon to assign to the layer. This icon represents the layer in the Layers Module.

  • To use an existing image, select an image in the image box.
  • To import a new image, click Browse and select an image in PNG or JPG format.

On the Confirm and Complete tab, review the details of the App Layer, enter a comment if required, and then click Create Layer. Any comments you enter appear in the Information view Audit History.

Expand the Tasks bar at the bottom of the UI, and then double-click the Packaging Disk task to show the full task description.

After you create the Packaging Disk, the Task bar displays the location of the Packaging Disk in your environment.

localized image

Next, you can deploy the packaging machine for your layer.

Deploy a Packaging Machine

The Packaging Machine is a virtual machine where you install the tools for your selected environment.

Note

The Packaging Machine is a temporary VM that will be deleted once the new Platform Layer has been finalized.

Log into the Packaging Machine

The Task Description contains the location of the packaging machine in your environment.

  1. Log into your XenServer client.
  2. Back in the management console, use the instructions in the expanded Packaging Disk task to navigate to the packaging machine.

  3. If the packaging machine is not powered on, do so now.

Install the required platform tools

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 will need to run in the target environment.

Platform software to install

You need the installers for your hypervisor, provisioning service, and connection broker.

If you are using a supported App Layering connector to connect to your environment, you will install the provisioning service and/or connection broker software on the packaging machine that the App Layering software created in that environment. Otherwise, you will be installing the software on a virtual machine in your hypervisor of choice, moving the virtual machine to the appliance's network file share, from which you can import the VM.

Keep in mind that the state of the software before you finalize the layer is what the image will use.

  1. Remote log in to the Packaging Machine you created. Be sure to log in using the User account you used to create the OS.

  2. Install the tools that your Layered Image will need to run in your environment. This includes any hypervisor, provisioning service, and connection broker software that you're using, along with any drivers, boot-level applications, and files needed.

    If some of the installation requires a system restart, restart it manually. The packaging machine does not restart automatically.

  3. Make sure the packaging machine is in the state you want it to be in when the image is booted:

    • If the tools you install require any post-installation setup or registration, complete those steps now.
    • Remove any settings, configurations, files, mapped drives, or applications that you do not want to include on the packaging machine.

Next, you'll need to shut down the packaging machine and verify that the Platform layer is ready to finalize.

Verify the Layer and shut down the Packaging Machine

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, which appears on the packaging machine's desktop.

To use the Shutdown For Finalize tool:

  1. If you are not logged into the packaging machine, remote log in as the user who created the machine.
  2. Double-click the Shutdown For Finalize icon. A command line window displays messages detailing the layer verification process.
  3. 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, as detailed below.
  4. Once any pending operations are complete, double-click the Shutdown For Finalize icon again. This shuts down the packaging machine.

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.

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.

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.

  1. 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:

    1. Open a command prompt as Administrator.

    2. Go to the Microsoft .NET Framework directory for the version currently in use:

      cd C:\Windows\Microsoft.NET\FrameworkNN\vX.X.XXXXX

    3. 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!

    4. 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.
  2. Check the status of an NGen operation

    1. Open a command prompt as Administrator.

    2. Check status by running this command:

      ngen queue status

    3. When you receive the following status, the NGen is complete, and you can finalize the Layer.

      The .NET Runtime Optimization Service is stopped

Finalize the Layer

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:

  1. Return to the management console.
  2. Select Layers >App Layers, and then the layer you just prepared.
  3. Select Finalize in the Action bar.
  4. Monitor the Taskbar to verify that the action completes successfully and that the layer is ready to deploy.