Virtual Hard Disk (opsi-vhd-reset)

opsi-local-image helps you to quickly restore many opsi clients to a certain state — for example in the coffee break during a training or in the classroom after class. The administrator controls everything in a central place: first, the extension creates an image, then it saves it on a separate hard disk partition. This image is then used for fast recovery, with minimal impact on network performance.

The opsi-vhd-reset module extends opsi-local-image (see Local Images (opsi-local-image)) and uses VHD containers.

Prerequisites

This module is currently a paid extension. This means that you need an activation file to unlock it. You will receive this file after you have purchased the extension. For evaluation purposes, we’re happy to provide you with a temporary license free of charge. Please contact us via email.

More details can be found in opsi Extensions.

opsi-vhd-reset is bundled with the opsi-local-image extension (see Local Images (opsi-local-image)), which means that activating opsi-local-image automatically applies to opsi-vhd-reset as well.

The extension requires opsi 4.0.7 or newer. The following table lists the required opsi packages:

Table 1. Required Packages
opsi Package Version

opsi-winst

>= 4.12.0.13

Introduction

opsi is a great tool to install and maintain Windows computers in an automated way—​also and especially if heterogeneous hardware is involved. However, a package-based opsi installation is not fast enough to bring computers back to a predefined state within a short time, e.g. during trainings or in a classroom during a break. opsi-local-image stores the initial installation as an image, and opsi-vhd-reset extends the functionality by using VHD containers:

  1. initial Windows 10 installation in a VHD container

  2. "sealing" the initial installation with a child VHD

  3. quick restore by replacing the child VHD

  4. upgrade of the initial installation by a merge of the child VHD

This method uses snapshot techniques known from virtualization without using virtualization per se.

Proceedings

Initial Installation

Install a Windows 10 system in a VHD container using the opsi-vhd-win10-x64 product.

Scheme: Partition and create a VHD (`opsi-vhd-win10-x64`)
Figure 1. Scheme: Partition and create a VHD (opsi-vhd-win10-x64)
Scheme: Install Windows (`opsi-vhd-win10-x64`)
Figure 2. Scheme: Install Windows (opsi-vhd-win10-x64)

After that, you can install the necessary applications on this Windows system.

Scheme: Install application software (`opsi-vhd-win10-x64`)
Figure 3. Scheme: Install application software (opsi-vhd-win10-x64)

Execute the product opsi-vhd-control to store current metadata about this opsi client. This includes the information about which product is installed in which version. Afterwards activate and boot the Windows PE (Preinstallation Environment).

The product opsi-vhd-control has a very low priority (-97). It therefore runs only runs after the installation of application software. As a result, you can set opsi-vhd-control to setup together with the application software.
Scheme: Activate Windows PE partition (`opsi-vhd-win10-x64`)
Figure 4. Scheme: Activate Windows PE partition (opsi-vhd-win10-x64)

On Windows PE, creating a child VHD protects the initial installation against modifications.

Scheme: Seal initial installation (`opsi-vhd-control`)
Figure 5. Scheme: Seal initial installation (opsi-vhd-control)

From now on, all changes are stored in the child VHD.

Scheme: Working with the sealed system
Figure 6. Scheme: Working with the sealed system

Restoring an Image

With the product opsi-vhd-control you can restore the initial installation. First the product restores the saved opsi metadata, then for handling of the child VHD the system boots Windows PE again.

Scheme: Restore initial installation, part 1 (`opsi-vhd-control`) 1
Figure 7. Scheme: Restore initial installation, part 1 (opsi-vhd-control)

In Windows PE, the child VHD with the modifications is deleted and replaced with a new, empty child VHD.

Scheme: Restore initial installation, part 2 (`opsi-vhd-control`)
Figure 8. Scheme: Restore initial installation, part 2 (opsi-vhd-control)

Updating an Image

To simplify the maintenance of the clients, you can use the product opsi-auto-update, which basically keeps the installed products up to date.

opsi-auto-update replaces the product opsi-vhd-auto-upgrade.

To provide an initial installation with patches and software updates, you can proceed as follows:

  • Restore the initial installation (as described above).

  • Install the updates.

  • Integrate the updates into the initial installation and reseal it with opsi-vhd-control and the property upgrade=true.

  • During this process the updated opsi metadata is also stored in the system.

For a detailed description of the opsi-auto-update product, please have a look at the opsi Standard Products chapter, section opsi-auto-update.

opsi-vhd-*- products

The opsi-vhd-reset extension consists of the following products:

UEFI Compatibility

The opsi-vhd-* products are compatible with UEFI.

Netboot Product opsi-vhd-win10-x64

The netboot product opsi-vhd-win10-x64 has a similar structure as the netboot products (4.1.0) for Windows installation. That is, they are identical in terms of structure and driver integration. Corresponding instructions can be found in the Getting Started chapter. The properties are also mostly the same.

opsi-vhd-win10-x64 also has these special properties:

  • windows_vhd_size: Specifies the size of the parent VHD (absolute or as a percentage of the hard disk size minus the Win PE partition). The default of 100% is automatically reduced to 80% to leave room for the child VHD. If a value is specified (absolute or relative) which is greater than 80%, then it will be reduced to 80%. This property replaces the standard property windows_partition_size. (default: 100%)

  • installto: The default value is vhd. It should not and cannot be changed.

The following properties do not exist in the netboot product opsi-vhd-win10-x64:
  • windows_partition_size, windows_partition_label: The label of the partition where the VHDs are located is CONTAINER.

  • data_partition_size, data_partition_letter, data_partition_create, data_partition_preserve: Using a data partition is not (yet) possible with opsi-vhd-*.

  • boot_partition_size, boot_partition_letter, boot_partition_label: Using a boot partition is not (yet) possible with opsi-vhd-*.

  • pre_format_system_partitions, preserve_winpe_partition: For opsi-vhd-* these two values are always set to true.

Localboot Product opsi-vhd-control

The opsi-vhd-control product has a very low priority (-96). It supports the following properties:

  • disabled: Used for debugging purposes; if the value is set to true, the product will not execute any actions. (default: false).

  • upgrade: Merges the changes collected in the child VHD into the parent VHD and replaces the child VHD with a new, empty child VHD (true). If set to false, it replaves the child VHD with an empty child VHD. After a successful upgrade run, this property is automatically reset to false. (default: false)

  • stop_on_no_network_in_pe: Used for debugging purposes; if set to true it will abort with an error message. You can then investigate why no network connection could be established. (default: false)

Localboot Product opsi-auto-update

To simplify the maintenance of the clients, you can use the product opsi-auto-update, which basically keeps the installed products up to date. It sets all installed client products which have a version number different from the one on the server to setup.

This product is quite useful, not just in the context of opsi-local-image. For a detailed description, see the opsi Standard Products chapter, section opsi-auto-update.

Known Problems and Restrictions

  • There is also a 32 bit version. The functionality is limited, though, due to a problem with the Diskpart merge command in the 32 bit Windows PE versions.

  • In theory, an implementation for Windows 8.1 or Windows 7 Enterprise would also be possible. However, we will only build these products on request.

  • There are indications that a Windows 10 release upgrade of an installation in a VHD will fail.
    (https://www.heise.de/newsticker/meldung/VHD-Boot-Windows-Update-demoliert-Aktivierung-3806023.html)