Step-by-step guide to learn how to deliver Application Layers elastically with Citrix App Layering.

More from the Lab!

 

We discussed in the previous posts of this Citrix App Layering series how to install and configure the appliance. We also reviewed how to work with OS, Platform and Application layers in App Layering. In this post, we will deliver our first Application layer elastically and optimize that layer with best practices.

More from this Citrix App Layering series

Requirements

For this lab, you need the following:

Best Practices for Elastic deployment in Citrix App Layering

  • Do not deliver the same App Layers in the image and elastically
  • Elastic is a way to deploy applications that have been layered with the same OS Layer. Do not deploy App layers on different OS Layer elastically.
  • It is not recommended to deploy Microsoft Office and Office 365 elastically.
  • You can assign Elastic Application layers to users but also computers by adding the computer object in an AD group or by publishing the layers directly to the computer object.
  • Elastic Application Layers assigned to users are mapped after the logon and can increase the duration of this step.
  • Elastic deployment is not application virtualization. Applications are not isolated. Once mapped, the layers are visible by all users connected on the same machine.
  • Enable Compatibility Mode if a layer delivered elastically is not loading properly during logon.

Deploy App layers elastically in Citrix App Layering

Elastic configuration in stored in the json files located in the layer repository:

  • ElasticLayerAssignments.json -> This file contains the information about user and group mapping to individual application layers. This file will contain and entry for each group or user ID that has assigned applications.
  • Layers.json -> This file defines the Layers in the repository and metadata about the layers used by the Citrix Elastic Layering Filter Driver.
  • MachineAssociations.json -> This file defines machine associations – You can use a computer name pattern containing wildcards to associate a set of computers with any AD group.
  • ShareAssignments.json -> This file contains the information about storage location assignments.
  • Shares.json -> This file contains the information about storage locations.

Go to ELM console > Layers > App Layers and select a layer to be delivered elastically.

Right click and select Add Assignments.

Elastic deployment - Add assignments
Elastic deployment – Add assignments

Select the version of the layer to deliver elastically.

Elastic deployment - Add assignments - Select version
Elastic deployment – Add assignments – Select version

Go next without selecting a template.

Elastic deployment - Add assignments - Select template
Elastic deployment – Add assignments – Select template

Select the AD group you want to publish to layer elastically to.

Elastic deployment - Add assignments - Select Elastic assignment
Elastic deployment – Add assignments – Select Elastic assignment

Click on Assign Layer to confirm.

Elastic deployment - Add assignments - Confirm to assign
Elastic deployment – Add assignments – Confirm to assign

ELM will update the configuration files located in the repository.

Elastic deployment - Add assignments - Updating configuration
Elastic deployment – Add assignments – Updating configuration

ElasticLayerAssignments.json has been updated:

Let’s take a look at our layer configuration:

Elastic deployment - Add assignments - Layer configuration
Elastic deployment – Add assignments – Layer configuration

The layer ID (2162690) is the same as in the elastic layer configuration file.

Logon on a virtual machine running a Layered Image previously generated with Citrix App Layering. 2016_APP_BASELINE layer should be mapped after the logon.

3 log files are available on the virtual machine with App Layering (CTX222133):

  • Windows Application Event log: In the Windows Event Viewer under Windows Logs, export the Application event log as an EVTX file.
  • Unidesk Layering Service log (ulayersvc.log): C:\ProgramData\Unidesk\Logs\ulayersvc.log
  • Unidesk LayerInfo log (layerinfo.log): %LOCALAPPDATA%\Unidesk\Logs\layerinfo.log (note, this is in the current user profile)

Elastic assignment logs are available in C:\ProgramData\Unidesk\Logs\ulayersvc.log.

Note: Logging is configured for INFO and above. To get verbose logging, edit C:\Program Files\Unidesk\Layering Services\ulayer.exe.config. Scroll down to find this block in the Log4Net Appender section:

<root>
<level value=”INFO”/>
<appender-ref ref=”LogFileAppender”/>
</root>

Change INFO to DEBUG and save.

Note: In this example, ULayer is configured for INFO logging. 

Let’s take a look at the logs to understand how App layers are mapped elastically.

The App Layering Guest Service running on the virtual machine will first poll Active Directory to get the list of AD groups. It is this service that is responsible for enumerating and mounting elastic layers right before user logon during the “userinit” process.

In this example, only 2 AD groups have been found:

  • CITRIXGURU\Domain Computers
  • CITRIXGURU\CTX_ELM_WORKERS

This last group is related to Elastic deployment as configured previously in this article.

Next the service is parsing C:\Program Files\Unidesk\Etc\ImageInfo.json to get information about the OS Layer. This file is generated during the OS layer creation.

Here is the content of the file in this example:

The App Layering Guest Service will read the content of the file to get the name of the OS Layer (OS_2016) and its layer ID (1507329).

Then the service will prepare the attachment of the layer(s) assigned the machines or users.

The layer is currently pending.

The next step is to map the disk(s), compose/merge the registry, create Windows services (if required):

In this step, you can found how long it took for the Guest Service to map the layer(s).

You will see the status of the assignment(s). Here our disk was assigned successfully.

Once the layer is mapped. The App Layering Guest Service will perform post-mapping actions such as starting service(s) included in the layer(s).

Note: App layers deployed elastically are not isolated. The content of the layers will be visible for all users connected to the machine. 

Troubleshooting Elastic Deployment in Citrix App Layering

Change the repository

You can change the Elastic Layer repository in the registry without reimaging (CTX222107).

And also change the file used for the Elastic assignments:

Restart the Guest Service or reboot the virtual machine to apply the settings.

No elastic layer assignments were specified or the specified share does not exist

This occurs when the Citrix Layering Service does not have access to the repository.

Elastic deployment - The specified share does not exist
Elastic deployment – The specified share does not exist

https://support.citrix.com/article/CTX222163

To troubleshoot, you can browse to the share via Windows Explorer and try to mount the layer(s) manually.

Elastic deployment - The specified share does not exist - Try to map it manually
Elastic deployment – The specified share does not exist – Try to map it manually

Right click on the .vhd file and select Mount.

Elastic deployment - The specified share does not exist - Mount the disk
Elastic deployment – The specified share does not exist – Mount the disk

You may be unable to mount the disk with the following error message.

Elastic deployment - The specified share does not exist - Unable to mount the disk
Elastic deployment – The specified share does not exist – Unable to mount the disk

Take a look at this article to troubleshoot this issue.

Troubleshooting App layers priorities for elastic deployment

Download App LayerPriority Utility from Citrix here (mirror).

Go to the setup tab and enter the IP address or FQDN or the ELM appliance and the root password.

Citrix App Layering Layer Priority Utility
Citrix App Layering Layer Priority Utility

Click on Save to validate the communication.

Then go to the main tab and click on Get OS Layers.

By default, layers are assigned a priority based on when they were created. The default layer priority matches the layers id within the App Layering database. Ids always get larger as layers are created.

Priorities in App Layering with Elastic Deployment
Priorities in App Layering with Elastic Deployment

In the case of App Layers delivered elastically, you only have to think about their priorities because the Platform and OS Layers are already compiled in the image. Therefore those layers will be applied first and eventually superseded by the content of the App Layers.

To change the priority of a layer.

Citrix App Layering Layer Priority Utility - Change Priority of a layer
Citrix App Layering Layer Priority Utility – Change Priority of a layer

Select a layer and click on Change Priority Val. Then enter the new priority and click on Change in the Actions menu.

Citrix App Layering Layer Priority Utility - Priority updated
Citrix App Layering Layer Priority Utility – Priority updated

The new layer priority is applied. You can apply new priorities to all App layers.

Citrix App Layering Layer Priority Utility - Priority updated
Citrix App Layering Layer Priority Utility – Priority updated

Priorities are stored in the Layers.json file located in the repository.

Click on Update JSON Files in the Actions menu to save the new configuration.

That’s all for Elastic deployment of App Layers in Citrix App Layering.

More from the Lab!