An App layer includes one or more installed applications that you can use in your Layered Images. You can create any number of App Layers, each with one or more applications. When it's time to update an app, you can add a new version to the layer. When you are ready to deliver the application updates to users, you can update your Image Templates, republish your Layered Images, and provision your servers with the new Layered Image.
To create an App Layer, you open the Create Layer wizard, deploy a Packaging Machine, then install the application(s). Once the application(s) are installed, you finalize the Layer.
To create an App Layer, you need:
Before you create an App Layer, you may also want to create resources that facilitate the application installation process. These resources are for temporary use during installation only, and will not be used to deliver the application.
If the application you install affects boot-level components, you'll need to restart the Packaging Machine as part of finalizing the layer or version.
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.
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.
Select Layers > App Layers and select Create Layer in the Action bar. This opens the Create Layer wizard.
In the OS Layer tab, select the OS Layer you want to associate with this App Layer.
In 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).
In the Connector tab, choose a Platform Connector Configuration that contains the credentials for the platform where you plan to build the Layer, along with the storage location. If the configuration you need isn't listed, add a New Connector Configuration and select it from this list.
Example: If you're using the Azure environment to create the Layer, select the Azure connector with the credentials and location required to access the location where you want to build the Layer.
In the Platform Layer tab you can select a Platform Layer containing the tools and hardware settings that you need to install and package an application during Layer creation. This selection is only used during layer creation. Once created, the Layer can be used in Layered Images published to any platform.
In 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.
In the Icon Assignment tab, select an icon to assign to the layer. This icon represents the layer in the Layers Module.
In the Confirm and Complete tab, review the details of the App Layer, enter a comment if required, and click Create Layer. Any comments you enter will appear in the Information view Audit History. Once the Packaging Disk has been created, the Task bar displays a link to the Packaging Disk on the Azure portal. You will use this link to deploy the Packaging Machine.
Expand the Tasks bar at the bottom of the UI, and double-click the Packaging Disk task. The task expands to show the full task description. This description contains a link to the location in the Azure portal where the Packaging Machine for this Layer has been published.
Next, you can deploy the Packaging Machine for your Layer.
The Packaging Machine is a virtual machine where you install the app(s) you want to include in this Layer. It is strongly recommended that you use a unique Packaging Machine for each Layer. The Packaging Machine is a temporary VM that will be deleted once the Layer has been finalized.
The Task Description (example shown in the last step above) contains a link to the location in the Azure portal where the Packaging Machine for this Layer has been published.
To create your Packaging Machine in Azure, begin with the expanded Packaging Disk Task shown in the last step above.
In the expanded Packaging Disk Task shown below, copy the full URL and paste it into the web browser where you logged into the Azure portal. This opens the Microsoft Azure portal to the Custom deployment template where you can create the virtual machine that you will use as your Packaging Machine.
Note: We recommend copying the full URL instead of using the Click here link.
On the Custom deployment panel, complete the required fields for customizing your Azure parameters.
IMPORTANT: Be sure that the value for the Resource group location matches the Storage account location that you configured in the Platform Connector Configuration. If these locations are not the same, the Packaging Machine will fail to deploy and you will have to reattempt deployment. If your deployment does fail, you can simply re-paste the link into the browser to start over.
This section explains how to install your application(s) on the Packaging Machine you created in Azure. Keep in mind that the state of the app before you finalize the layer is what users experience when they access it.
To install the application(s):
Remote log in to the Packaging Machine you created in Azure. Be sure to log in using the User account you used to create the OS in Azure.
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.
Make sure the Packaging Machine is in the state you want it to be for the user:
Next, you'll need to shut down the Packaging Machine and verify that the Layer is ready to finalize.
Once the application is installed on the Packaging Machine, the next step is 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, which appears on the Packaging Machine's desktop.
To use the Shutdown For Finalize tool:
The Layer is now ready to finalize.
Layer integrity messages let you know what queued tasks must be completed before a Layer is finalized.
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.
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.
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:
Open a command prompt as Administrator.
Go to the Microsoft .NET Framework directory for the version currently in use:
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!
Check the status of an NGen operation
Open a command prompt as Administrator.
Check status by running this command:
ngen queue status
When you receive the following status, the NGen is complete, and you can finalize the Layer.
The .NET Runtime Optimization Service is stopped
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, the Packaging Machine may be deleted to minimize storage space used.
When the Layer has been verified and is ready to finalize:
Version - (Required) This can be the version of the application or a version you assign to the Layer. This value is displayed in the Details view of the Layer. Keep in mind that you'll add a new version to this layer whenever you update the app(s) included in it, and this is where the version will be described.