You are here: Learn about Citrix App Layering [UnideskVersion Layering 4.0.8] > Layer > App Layers > NFS connector

Create an App Layer (vSphere)

In this article:

Before you start

Prepare a new App Layer

Deploy a Packaging Machine

Install the Application(s)

Verify the Layer and shut down the Packaging Machine

Finalize the Layer

An App Layer is a bootable software image (virtual disk) containing one or more applications that you can use in any number of Layered Images. When creating an Image Template to use for publishing a Layered Image, you can include an OS Layer, a Platform Layer, and any combination of App Layers, as long as the OS Layer used to create all of them is the same.

To create an App Layer, you open the Create Layer wizard, deploy a Packaging Machine in your environment, then install the application on it. Once the application is installed, you finalize the Layer.

A Packaging Machine is a VM where you install the application(s) that will be included in the Layer. Unidesk creates the Packaging Machine using the location and credentials you supply by selecting the Platform Target (hypervisor) and Connector Configuration containing this information. If you don't yet have the Connector Configuration you need, you can add a new one, as described in the steps below.

Before you start

Requirements

To create an App Layer, you need:

Optional resources

You may want to create resources to facilitate the application installation process. These resources are for temporary use during installation only, and will not be used to deliver the application.

Prerequisite Layers: What are they and do I need any?

Prerequisite Layers provide a mechanism to include existing Application Layers on the Packaging Disk when creating or adding a version to an Application Layer. Prerequisite Layers should only be used if they are required, since it is possible that the prerequisite applications will pull something into the Layer that is not required for the current application deployment, and which may cause conflict in the future. Prerequisite Layers can be required for several reasons:

Note: Some of these issues can also be handled by putting the two applications in the same layer rather than using prerequisite layers.

Platform Layer: What is it and do I need one?

A Platform Layer is a Unidesk Layer that contains the tools and hardware settings needed to either install and package an application during Layer creation, or to publish a Layered Image for provisioning servers in a specific environment. You can create a different Platform Layer for each environment in which you are creating Layers, or publishing Layered Images.

There are two types of Platform Layers you can create: Platform Layers to use for Packaging other Layers, and Platform Layers for Publishing Layered Images.

Run Once Script

You can include a Run Once script in an App Layer. This allows you to run a script the first time any Layered Image that includes the App Layer boots. If the App Layer is elastically layered, the Run Once script runs when the App Layer Disk is mounted. Run Once scripts are typically used for apps, such as MS Office, that require license activation on the first boot.

Prepare a new App Layer

  1. Select Layers > App Layers and select Create Layer in the Action bar. This opens the Create Layer wizard.

  2. On the Layer Details tab, enter a Layer Name and Version, both required values. Optionally, you can also enter other values. For details, see more about these values below.

  3. On the OS Layer tab, select the OS Layer you want to associate with this App Layer.

  4. (Optional) On the Prerequisite Layers tab, if the application you are layering requires other App Layers to be present during installation, select the Include Prerequisite Layers check box, and pick the necessary App Layer(s).

    Notes:

  5. On the Connector tab, select Network File Share.

  6. On the Platform Layer tab, you can select a Platform Layer for Packaging Layers, if you need one.

    Note: You only need a Platform Layer for Packaging this Layer if you imported your OS from a different environment than the one where you will install the software on this Layer.

  7. On the Packaging Disk tab, enter a file name for the Packaging Disk, and select the disk format. This disk will be used for the Packaging Machine (the VM) where you will install the application, as described in the next two sections.

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

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

    A Boot disk and a Packaging disk are created, and the Tasks bar displays instructions to navigate to them.

  10. Expand the Tasks bar at the bottom of the UI, and double-click the Packaging Disk task to show the full description. A message displays the location of the disks in your environment.

Next, you can deploy the Packaging Machine for your Layer.

Deploy a Packaging Machine

The Packaging Machine is a temporary VM where you install the app(s) you want to include in the Layer.

Create the Packaging Machine

The Task Description (example shown in the last step above) contains the location in your hypervisor environment where the disks for this Layer have been created.

  1. Log into your hypervisor.

  2. Back in the Unidesk Management Console, use the instructions in the expanded Packaging Disk Task shown below to navigate to the location where the Boot Disk and Packaging Disk have been created.

  3. In your hypervisor, create a VM from the Boot disk and name it Layer_NameBoot.xxx.

  4. Use the hypervisor to attach the disk called Layer_NamePkg.xxx to the VM you just created.

    Important: Both disks you exported must be attached to the IDE.

  5. Power on the VM. This is your Packaging Machine where you will install the app(s) to include in this Layer.

Install the Application(s)

Now you can install your application(s) on the Packaging Machine. Keep in mind that the state of the app before you finalize the layer is what users experience when they access it, so it's important to leave the app as you want users to see it when they log in. More guidance about this is included in the steps below.

To install the application(s):

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

  2. Install the applications, along with any drivers, boot-level applications, or files that the user will need with it.

    If an application 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 for the user:

Next, you will shut down the Packaging Machine and verify that the Layer is ready to finalize.

Verify the Layer and shut down the Packaging Machine

Once the application 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:

  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:

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 software has been installed and the Packaging Machine has been verified and shut down, you are ready to finalize the layer.

Note: When you finalize a Layer, Unidesk may delete the Packaging Machine to minimize storage space used.

When the Layer has been verified and is ready to finalize:

  1. Return to the Unidesk Management Console.
  2. Select Layers >App Layers, and then the layer you just prepared.
  3. Select Finalize in the Action bar. The Finalize wizard appears.
  4. (Optional) On the Script Path wizard tab, you can enter the path to a Run Once Script located on a server on your network.
  5. Click Finalize to finish creating the Layer.
  6. Monitor the Task bar to verify that the action completes successfully and that the Layer is ready to be deployed.

Reference: Create App Layer Wizard values