Contact Support

Customers who viewed this article also viewed

banner icon

Identify Changes in NetScaler build files with

File Integrity Monitoring

Learn More Watch Video
CTX225934 {{tooltipText}}

Citrix App Layering 4: LayerPriority Utility

download LayerPriority4.zip Why can't I download this file? Log in to Verify Download Permissions LayerPriority4.zip

Applicable Products

  • Citrix App Layering 4.x

Introduction

This utility is used to modify the layer priority of App layers.  The documentation provided here includes an explanation of what layer priority is and why you might want to change the priority as well as how you would use the utility to do so.

What is Layer Priority?

Layer Priority defines the order in which layers are searched for a file or registry settings when using elastic layers or the order layers are merged in creating a disk image.

In Citrix App Layering 4 the default layer priority matches the layers id within our database.  Ids always get larger as layers are created.  So if the first version of layer AppB was created after the first version of layer AppA, then layer AppB will be at a higher priority than layer AppA.  This means that if there is a file or registry entry in common between the two layers the file or registry entry will be used from layer AppB.

When Windows views these layers, it is from a top-down model where the highest priority wins. So if a file (or registry entry) exists in two layers, but only one can be presented to an executing Windows environment, the layer with highest priority “wins”.

Images versus Elastic Layers

Layer priority is used in two different places.  When we create an image layer priority is used both when creating the file system and when creating the registry.  The best way to think of it is that the layers are merged in this order for both file system and registry:

file

So the App Layer with priority 1 is merged into the OS layer, then the App Layer with priority 10 is merged in, then 100 and finally the Platform layer.  File or registry keys from the layers merged before are overwritten as new layers are merged in.

Then on session hosts or desktops elastic layering layer priority is applied to both the file system and the registry dynamically.  The main difference here is that the Published image is at the bottom and the User Personalization Layer is at the top with regards to priority.  The order is shown here:

file

Why would I change the priority?

You might want to change layer priority for many reasons.  Normally it is because two different layers use a common file or registry key and you find by switching the order of the layers both applications will work when originally only one did. 

Installing the Utility

The utility is easy to install.  Download the Zip, edit the properties of the zip and unblock it, unzip the files into a folder and run the HTARunAsReg reg file. This will then allow you to right-click on the HTA file and run it "As Administrator". This is required or the plink command cannot save the ELM's certificate to the registry.

Next, start the utility and click on Setup.

Enter the IP address or FQDN for the ELM.  The utility works by sending ssh commands to the Enterprise Layer Manager to query and update the layering database.  This information is used for that communication.

Then if you have not changed the appliance root password you can just click save.  This will encrypt the password to a file in the config folder of the utility that will be used to perform the queries.  If you want to be prompted each session for the password rather than storing it encrypted select the check box to always prompt before clicking save.

file

Warning

Do not run the utility if you have active tasks running in the console.  The tasks could have the database entries locked or they may adversely impacted by the change mid-way through the task.

Using the Utility

The utility is easy to use.  Open the utility and click “Get SO Layers”.  This will run a query to capture all the OS layers you have.  It will store the OS layers to use whenever you open the utility.  If you add a new OS layer just click “Get OS Layers” again.

Then to see or change the priority of a layer first choose the appropriate OS layer.  The utility will load all the layers created with that OS layer with highest priority on top.

file

Note: the Search box for layers.  This can be used to narrow the layer listing by filtering for a text string in the layer name.  For Example list all the layers that have “off” in the layer name.  To use it enter the string in the Search box and press enter or click the right arrow.

file

Select a layer to change the priority by clicking on the row and then clicking “Set Start”.

file

Then select the row to move the selected layer above and click “Set End”

file

The selected layer information will be shown at the bottom.

file

Review the selected layer information and if correct click the “Process” button.

The status of the job will be shown in the status area at the top.

file

Also the layers table will be redrawn with the new priorities shown again in priority order.

The process will update the layering database with priority changes.  However this will not update the json files located on the elastic layer share.  Many changes can be made to the database then when you are done with changes you must click on the button shown below.  This will tell the ELM to write out new JSON files for Elastic Layering.

file

Changing the layer priority for a single layer

The normal modification process will change the priority for every layer between the start and end by swapping each layers priority with the previous layer.

At times customers have requested the ability to change just the priority for a single layer.  This has been to fix problems when something went wrong in the update process.

To change the priority for a single layer click on the layer then click on “Change Priority Value”.  This will set the start and end rows at the bottom both to the selected layer. It will also expose the input field (3) for the new value.  Enter a value and Press the “Change” button (4).

file

The status of the update will be shown in the status box and the table will be updated and resorted.

Disclaimer

Remember this tool is to be used at your own discretion and is not supported by Citrix.

These software applications are provided to you as is with no representations, warranties or conditions of any kind.  You may use and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the software application may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the software application fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the software application.  In no event should the code be used to support of ultra-hazardous activities, including but not limited to life support or blasting activities.  NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SOFTWARE APPLICATION, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.  You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the code.