Product Documentation

Create layers

Jan 11, 2018

An OS Layer includes the software and settings for the operating system that you deploy as part of your other layers and ultimately, your Layered Images. Once you have prepared the OS disk for deployment, you can create an Operating System Layer by importing the OS disk into a new Layer.

With an OS Layer, you can install your operating system once, and update it by adding a new Version to the Layer whenever there's a new patch or update. You can deploy this layer, or a version of it, in every image you publish. This allows you to maintain one OS image and use it to provision all of your servers.

If you need to support more than one operating system, for example, if you need both Windows Server 2012 R2 and Windows Server 2008 R2, you can create more than one OS Layer. However, each App Layer is only compatible with the OS Layer you use to create it, and if you deploy two OS Layers, you will also need to deploy a compatible App Layer for each one. Further, in future releases when deploying Elastic Layers to users, those layers will only be compatible with users' desktops that use the same OS Layer.

If you can support your users with a single OS Layer, the work associated with creating and updating App Layers will be much reduced.

Each time you need to deploy operating system patches and updates, you will do so by adding a new Version to the OS Layer. You can continue to publish Layered Images using any version of the OS Layer.

The prerequisites for creating an OS Layer include:

Platform Layers

A Platform Layer is a layer that includes platform-specific configuration settings, tools, and other software required for your OS and Apps to be installed in or to run in a particular environment.

Types of Platform Layers

  • A Platform Layer for Packaging (required in some cases, see below)
  • Platform Layer for Publishing (always required)

Platform Layer for packaging layers and versions

The only time you need a Platform Layer for Packaging layers is when your OS image was created on a different hypervisor than the one where you are building your other layers. When creating an App Layer or Layer Version, or OS Versions, the purpose of the Platform Layer is to ensure that any hypervisor-related software and settings are available during the installation of the application(s) on that layer, if needed. If you choose to use a Platform Layer for Packaging a layer, the hypervisor-related software will only be used during layer packaging, and has no effect on where you can publish the layer as part of a Layered Image.

Platform Layer for publishing Layered Images

A Platform Layer for Publishing is required when you publish Layered Images. The purpose of the Platform Layer for Publishing is to include the settings and software that the Layered Image needs to be deployed in your environment. When creating a Platform Layer for Publishing, Unidesk removes unselected (and unnecessary) tools and software related to the platforms you are not publishing to. This is to prevent any unnecessary platform software from slowing down the Layered Image when it runs in the target environment.

App Layers

An App Layer is a virtual disk containing one or more applications that you can use in Layered Images. You can combine an App Layer with any other App Layers and a Platform Layer, as long as the OS Layer used to create the App Layer is selected.

With most applications, creating an App Layer is simple. In a few cases, it's best to start with tips from experienced users, so the Unidesk Forum includes Application Layer Recipes that you can search for tips about a particular application before you start. 

To create an App Layer, you use the Create App Layer wizard to deploy a Packaging Machine in your environment and install the application on the Packaging Machine, leaving the application in the state you want it to be in for users. Then you finalize the Layer. 

User Layers (Unidesk Labs)

A User Layer is a virtual disk where a user's app data and configuration settings are saved. User Layers are created when you:

  • Publish a Layered Image with Elastic Layering set to Application and User Layers.
  • Users log into their desktops on the above Layered Image.

With User Layers enabled on the Layered Image, users can install applications locally on their desktops, and the apps and their data will be saved in the User Layer.

Verifying Layers

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.

  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

Connectors for layering

When creating Layers in a Hyper-V environment, you must use NFS (the appliance's file share) instead of a Connector Configuration.

When you complete the Create Layer (or Add Version) wizard, the file will be saved to the file share. From there you must manually copy the file to your hypervisor and back to file share once the software for the Layer is installed.