- Overview
- Creating an Auto Restore XML
- Adding the Auto Restore XML File Into a WIM for PXE Booting
- Adding the Auto Restore XML File
Overview
When deploying a golden image by following the steps described in this article, there is an amount of manual work that must be performed on the target endpoint to initiate the golden image deployment. This process can be streamlined for mass golden image deployment by creating an Auto Restore XML, which will automatically initiate the deployment after the system has booted with the rescue media.
Creating an Auto Restore XML
On the 'Existing Backups' tab of Macrium Reflect, select the golden image that will be deployed to the target endpoints, then select 'Restore':
In the restore wizard, select a destination disk and copy the partitions from the golden image to the destination disk. The 'Copy Partitions' option can be used to move the selected partitions (indicated by the checkbox on each partition) to the destination disk. Alternatively, partitions can be dragged from the source to the destination, which enables partitions to be reordered on the destination.
The following options can be selected on this page of the wizard:
Option | Description | |
Select a different source disk... |
If the disk image contains multiple disks, this option enables a different source disk to be selected. Note: When restoring multiple disks, disks must be restored one at a time. |
|
Select a different target disk... | If the system where the restore is being performed contains multiple disks, this option can be used to change the disk that will be used as a destination for this restore. | |
Copy Partitions | Shrink or extend to fill the target disk | If the destination disk is a different size from the source disk, selecting 'Copy Partitions' will display this option. Selecting this option will automatically resize partitions to use all unpartitioned space on a larger disk, or fit a smaller disk. |
Exact partition offset and length | If the destination disk is a different size from the source disk, selecting 'Copy Partitions' will display this option. This option will copy the partitions to the same location on the destination disk, they will also retain their original size. | |
Erase Disk | Erases any partitions that are located on the destination disk in the wizard. The disk will not actually be erased until the restore starts. | |
Delete Partition | Deletes the selected partition on the destination disk in the wizard. The partition will not actually be deleted until the restore starts. | |
Undo | Undo the last activity. | |
Float Left | This moves the partition to the left-most unpartitioned space on the destination disk. | |
Float Right | This moves the partition to the right-most unpartitioned space on the destination disk. | |
Fill Space | Expand the partition to use all unpartitioned space to the right of the partition. | |
Layout | Opens the 'Partition Properties' window for more granular control over partition properties. |
Once you are happy with the layout and properties of the partitions on the destination disk, select 'Next'.
On the summary page of the wizard (shown below), press the key combination CTRL + SHIFT + S:
This will open the 'Auto Restore' dialog:
The following options can be specified in the dialog:
Option |
Description | |
Password | Enter a password to protect against accidental or unauthorised running of this restore. | |
Source Image File |
Restore this image file |
When 'Restore this image file' is selected, the image file selected will be used as the restore source. This is the default option. |
Restore the latest matching image in the same folder |
When 'Restore the latest matching image in the same folder' is selected, the image folder will be searched for any image files that contain the partitions being restored. The latest backup date is chosen as the restore source. |
|
Target Disk Selection |
Match target disk on unique identifier |
When 'Match target disk on unique identifier' is selected, the unique disk ID is used to ensure that the correct disk is restored to. This is the default option.
|
Match target disk on disk number if unique id is not found |
When the 'Match target disk on disk number if unique id is not found' option is selected, the restore will not fail if the target unique disk id cannot be found; instead, the restore will be performed to the target disk matched on the disk number instead. The default number is the current number of the target disk, but this can be changed to an alternative disk number if it's known that the golden image will be deployed to a different disk on the target endpoints. This option should be used with caution, as Windows PE can enumerate disks in a different sequence from how they are enumerated in Windows and can cause the incorrect disk to be deployed to. This is not an issue if the target systems only have a single disk. |
|
Restore xml file location |
Choose drive |
If 'Choose drive' is selected, a list of local drives will be displayed, and a drive letter can be selected as the location to save the auto restore XML file. The file will be saved in the root folder of the chosen drive and will be named 'macrium_restore.xml'. |
Choose a file name and location |
If selected, a Windows Explorer dialog will be displayed, which can be used to save the auto restore XML file to any file name and directory. Note: For the auto restore to operate, the auto restore XML file must be named 'macrium_restore.xml' and be located in a root folder on a local drive. Saving to a different name and/or location enables you to prepare several restore definitions for later use. |
|
Set the restore XML file as 'Read Only' |
This option will set the auto restore XML file as 'Read Only'. At the end of an auto restore, the auto restore XML file is automatically deleted. Setting the auto restore XML file as 'Read Only' prevents deletion and enables re-running of the same restore each time Windows PE starts. |
Once the relevant settings have been specified, select 'OK' to create the auto restore XML file. If the golden image is located on a network share, an additional dialog will be displayed prompting for authentication details to be entered.
Adding the Auto Restore XML File Into a WIM for PXE Booting
Once the rescue media has been booted, local drives are scanned in alphabetical order for a 'macrium_restore.xml' auto restore XML file in the root of the drive; this can be any local drive, including USB flash drives and optical media. Macrium Reflect will use the first auto restore XML file that is found.
If the rescue media is being PXE booted as part of the golden image deployment, the auto restore XML file will need to be added directly into the WIM file, as there will not be a locally attached rescue media to store the auto restore XML file on.
For more information on configuring PXE booting with WDS, see this article.
Mounting the WIM
First, create an empty folder somewhere on the C: drive; this will be used as the destination for mounting the WIM file. In this example, we are using C:\Boot\Mount.
Next, open an administrator command prompt and run the following command:
DISM /Mount-image /imagefile:C:\boot\macrium\WinREFiles\media\sources\boot.wim /index:1 /MountDir:"c:\boot\mount"
This is the default location of the WinRE WIM file. This should be changed if a different base WIM is being used or a different rescue media volume is being used as described here.
Adding the Auto Restore XML File
Next, open the mounted folder in Windows Explorer; in this example, the folder is C:\boot\mount:
Copy the 'macrium_restore.xml' file to the root of this folder:
The WIM file can now be unmounted.
Unmounting the WIM
To unmount the WIM, run the following commands:
Dism /Unmount-image /MountDir:"c:\boot\mount" /Commit
Dism /Cleanup-Wim
Once this has been completed, the WIM file can be copied to a PXE server (e.g., WDS) to boot the target systems into the rescue media and automatically initiate the deployment.