Create the OS layer
An OS layer includes the software and settings for the operating system that you deploy in layered images. The OS layer is necessary for creating:
- Platform layers
- App layers
- Layered images
Two ways to create the OS layer
There are two ways to import the OS to create the OS layer:
In MS Hyper-V and VMware vSphere: You can bypass the management console and connector, and use the OS import script included in the OS Machine Tools download. Import the OS using the ImportOSLayer.ps1 script (MS Hyper-V, VMware vSphere only)
The advantages of using an import script in Hyper-V and vSphere include:
- Better performance: The OS import is faster.
- Unified Extensible Firmware Interface (UEFI) machine support: The script supports the import of UEFI machines.
Before creating the OS layer, be sure to:
Considerations for your OS layer
- To deploy Windows patches and updates, you can simply add a version to the layer. You can easily revert to the previous version of the layer, if necessary.
- You can select any version of the layer to use in an image template, and therefore in the published images.
- You can update the OS using Windows Update, Windows Server Update Services (WSUS), or offline standalone update packages. Do not use tools like SCCM.
- Platform and app layers are tied to the specific OS layer that you use to create them, though not to a specific version of the layer. When you add versions to the OS layer, the dependent app and platform layers continue to work.
- Windows updates must be applied to the OS layer before you update any other layers.
Import the prepared OS using the management console and a connector
To import your OS for the new OS layer, using the management console and the connector for your platform:
- In the management console, select Layers > OS Layers and click Create OS Layer in the Action bar. The Create OS Layer wizard opens.
- (Required) In the Layer Details tab, specify the Layer Name and Version.
- (Optional) Enter the layer Description and Version.
- Change the Max Layer Size to accommodate the OS you are importing.
- In the Connector tab, select a Connector Configuration that specifies the location of your clean OS image. If the configuration you need is not listed, add a New one, and then select it from this list. For details about creating a connector configuration, see Add a connector configuration.
In the OS Disk Details tab, click the Select Virtual Machine button.
- Citrix Hypervisor, VMware, Nutanix: A new browser tab opens.
- Azure: An Azure panel opens where you can type the Resource Group and the virtual machine name.
Click the Virtual Machine field to reveal a list of all virtual machines.
- Hyper-V: Generation 2 (UEFI) virtual machines are not listed, because they are not currently supported when creating an OS layer in the management console. Once you have an OS layer you can convert it to a UEFI layer. You add a version to the layer, and select a UEFI connector configuration.
- VMware: UEFI virtual machines are listed, but not supported when creating an OS layer. You create a BIOS OS layer first, and convert it to a UEFI OS layer. To convert the layer, add a version to it and select a UEFI virtual machine template in the connector configuration.
Select a machine from the list, or filter the list by typing the name, and then select the machine.
- Azure: Type the Resource Group and the virtual machine name.
Click OK. The selected machine is validated:
- Citrix Hypervisor, VMware, Nutanix: Ensures that the machine has a single OS disk attached as a SCSI disk. IDE is not supported.
- Hyper-V: Ensures that the machine has a single disk attached to the IDE controller for Generation 1 (UEFI) virtual machines. The virtual machine that the disk is attached to must be shut down.
The machine name and OS disk size appear in the wizard. If there is an issue with the virtual machine or the OS disk, an error appears.
In the Icon Assignment tab, select an icon image to assign to this layer.
- In the Confirm and Complete tab, review the details of the OS layer. Enter a comment if necessary, and click Create Layer. If you enter comments, they appear in the Information view Audit History.
When the task completes, the new OS layer in the management console displays a Deployable status.
Import the OS using the ImportOSLayer.ps1 script (MS Hyper-V, VMware vSphere only)
This procedure explains how to import the OS for your new OS layer using the
If you have downloaded and expanded the App Layering OS Machine Tools onto your OS image, the
ImportOsLayer.ps1 has been copied to c:\windows\setup\scripts.
Run the script
To import the OS:
ImportOsLayer.ps1PoSH script as administrator:
C:\Windows\Setup\scripts\ImportOsLayer.ps1 -ElmAddress <Ip Address> [-IgnoreCertErrors] C:\Windows\Setup\scripts\ImportOsLayer.ps1 -ElmAddress <FQDN> [-IgnoreCertErrors]
ElmAddressis the IP Address or FQDN of the App Layering appliance. It specifies where the new OS layer is created.
IgnoreCertErrorsignores certification errors when the script communicates with the App Layering appliance.
The ImportOsLayer.ps1 script prompts you for the credentials to connect to the App Layering appliance (referred to as the ELM in the script). The script uses your credentials to create a session on the appliance.
The script then prompts you for details about the new OS layer:
- LayerName (required)
- VersionName (required)
- LayerSizeGib (required, but defaults to 60 GB)
- LayerDescription (optional)
- VersionDescription (optional)
- Comment (optional)
Once you’ve entered the required information, the script reboots the system into the compositing engine, imports the OS, and builds the layer. Monitor the progress of the job in the management console.
When the compositing engine is finished (success or failure), it reboots back into the Windows OS image.