XenClient Enterprise 4.5 Virtual Machine Import and Export
Synchronizer Import/Export Features Import: Software Library Section The “Import” action imports a VHD file into Synchronizer, which can then be used to create new VM images. Export: Virtual Machines Section The “Clone” action prepares a VM image for copying to a different Synchronizer server. The “Export” action exports a VM image so it can be copied to USB storage and imported into Engine.
Engine Import/Export Features • Features for importing and exporting VMs or VHD files are available in the Engine Activity Center. • Import a Virtual Hard Disk: Imports a VHD file, or a set of VHD files, into the Engine VHD file cache. • Import a Virtual Machine: Imports a local VM into Engine, that was previously exported from Engine. • Export a Virtual Machine: Exports a local VM to USB storage. Launch the control panel. Select the Tools by Category view. Launch the Activity Center applet. Import/export features are available under Related Tasks.
USB Storage Devices and Engine Import/Export The Engine Device Manager is used for assigning USB devices to specific VMs, or to the Engine. Before importing a VM into Engine, or exporting a VM from Engine, the USB storage device should be assigned to the Engine. After the import or export is complete, the device should be unassigned from Engine before disconnecting it from the computer.
Export from Synchronizer, Import to Engine • VM Images can be exported from Synchronizer then imported into Engine. • Alternative to downloading the VM image over the network. • Only works for VM images assigned to the user or computer in Synchronizer. Synchronizer exports a VM image to the FileExports folder. The VM image archive is copied to USB storage. The USB storage device is attached to the computer running Engine, and the VM image is imported. VM Image Archive VM Image Archive
Start Synchronizer Virtual Machine Image Export Complete the following steps to export a Virtual Machine image from the Synchronizer: Select the VM image in the Virtual Machines section. Click the “Export” action button. This dialog should appear. Click “Yes” to begin the export process.
Synchronizer Virtual Machine Export Background Task The export is performed in a background task. The task might take a long time to complete, possibly up to an hour or even longer. If the export task appears to be stuck, select the task details. If the task is in Running” state, it should still be making progress.
Synchronizer Virtual Machine Export Results • The VM image is exported to the Synchronizer FileExports folder. • Default location: C:\Program Files (x86)\Citrix\Synchronizer\FileExport • The archive will usually contain multiple files as shown below. • All files in the multipart archive are required to import the image into Engine. These files were created when the “win7-32” VM image was exported. These files are left over from a previous export of a different VM image. The VM image archive is broken up into 2-GB segments.
Copying Virtual Machine Archive Files to USB Storage The multipart VM archive file can be copied from the FileExport folder to USB storage with Windows Explorer. Before Copying If antivirus software is installed on the Synchronizer host server, disable it, or configure it to not scan files as they are copied to USB storage. Format the storage device, or create a new folder to receive the VM image export. After Copying Eject or unmount the USB storage device in Windows. Unplug the device from the computer, then plug it back in. Verify all files in the multipart archive file are present with the correct sizes. Compare file checksums between the FileExport folder and USB storage. A free checksum utility is available from Microsoft: http://support.microsoft.com/kb/841290
Importing VHD Files Into Engine The “Import a Virtual Hard Disk” action in Activity Center is used to import VHD files that were exported from Synchronizer. Browse to the location of the multi-part VHD file archive on USB storage. Select the file ending in “.zip.001”. The Engine will begin importing VHD files into the VHD cache.
Engine VHD File Caching The VM image archive exported from Synchronizer contains multiple VHD files. VHD Cache VHD Cache When the VM image archive is imported into Engine via USB storage, the VHD files are copied into a VHD file cache. system-2.vhd system-2.vhd system-3.vhd system-1.vhd system-1.vhd system-1.vhd system-3.vhd system-2.vhd system-3.vhd Unused files are automatically deleted from the VHD cache after 2 days (only if the computer is registered to Synchronizer). VM Image Archive VM Image Archive
Engine VHD Cache and Virtual Machine Image Updates • Engine checks for updates with Synchronizer. • The update check response identifies VHD files that are required for a VM update. VHD Cache • If the VHD files exist in the cache, they are used for the VM update. • Otherwise, they must be downloaded from the Synchronizer. • During the download process, Engine will periodically check the VHD cache. • If the VHD files appear in the cache, Engine will stop downloading them from Synchronizer and use the cached copies instead. ? • Hello Engine: • You need these files for a VM update: • system-1.vhd • system-2.vhd • system-3.vhd • Best Regards, • Your Synchronizer. system-2.vhd system-1.vhd system-3.vhd
When Can VHD Files be Imported Into Engine? • VHD files can be imported into Engine: • Before the Engine is registered to Synchronizer. • Commonly done to preload VHD files into Engine before deploying the computer or assigning it to a user. • After registration, if the required VHD files are cached, VM image installation is fast. • Cache cleanup is not performed before Engine registration. Files will remain cached indefinitely until the computer is registered. • After registration, but before Virtual Machine image assignment. • Cached VHD files will be available when a VM image is assigned. • But the Engine will delete unused files from the cache after 2 days. • After Virtual Machine image assignment. • Even when the Engine is in the process of downloading VHD files from Synchronizer. • If the files appear in the cache, Engine will stop downloading them and use the cached copies instead.
Source and Target Synchronizers Source Synchronizer Target Synchronizer • The idea is to copy or move an entire VM image from one Synchronizer server to another primary Synchronizer server. • Only the VM image itself gets copied, not policies, user assignments, or other configuration data.
Virtual Machine Image Migration Process Overview • On the Source Synchronizer Server • Clone the VM image. • Locate the singleton VHD file for the cloned image. • File Copy Between Synchronizer Servers • Copy the singleton VHD file to the target Synchronizer server FileImport folder. • Verify file integrity after the copy is complete. • On the Target Synchronizer Server • Import the VHD file into the software library. • Create a new VM Image from the imported VHD file. • Start the VM Image, login to the Hyper-V VM, verify it is correct. • Cleanup • The cloned VM image on the original Synchronizer can be deleted. • The VHD file imported into the target Synchronizer can also be deleted.
Clone the Virtual Machine Image Cloning the VM image collapses all versions of a VM image into a single VHD file. To clone the latest version of a VM image, select the VM image then click “Clone”. Any specific version of the VM image might also be cloned. Select the desired version then click “Clone”.
Clone Options Synchronizer allows you to specify some options when cloning the VM image. The system disk size might be expanded during the clone if desired. Shrinking the system disk is not supported. Do not change the User and Local disk sizes. These disk sizes will be specified when the VM image is recreated on the target Synchronizer server. This will be the name of the new VM image in Synchronizer console after the clone. Enter a value here. Synchronizer will set the Windows computer name within the cloned VM. The default value should be OK. For migration purposes, leave this box cleared, even if it is a custom VM image.
Clone Background Task • The clone operation is performed in a background task. • The task might take a long time to complete. • But it should make steady progress.
Cloned Virtual Machine Image and VHD File • When the clone is complete, the cloned VM image should appear in the console. • The system disk VHD file location is displayed in the Summary tab. • Might require to scroll down in the console UI to see the path.
Locate and Copy the Cloned VHD File • Open Windows Explorer on the source Synchronizer host server. • Navigate to the folder containing the system disk for the cloned VM image. • The folder should only contain a single file “system-1.vhd”. • Copy the VHD file to the target Synchronizer server FileImport folder. • Default location: C:\Citrix\Synchronizer\FileImport • After the copy is complete, compare file sizes and checksums to verify integrity. Source Server: Copy from VmWorkingStorage folder Target Server: Copy to FileImport folder
Import the VHD File into the Software Library • Open the “Software Library” section of Synchronizer console. • Select the “Virtual Machine Images” folder. • Click “Import”. • Then select the “Virtual Machine Image” import option.
VHD File Import Options Provide a name and description for the VHD file being imported. When the drop-down icon is clicked, the VHD file in the FileImport folder should be displayed automatically. If selected, Synchronizer will copy the VHD file from the FileImport folder to internal storage. This takes longer and the VHD file will be retained in the FileImport folder. If cleared, Synchronizer will move the VHD file from the FileImport folder to internal storage. This is much faster and the VHD file will not be retained in the FileImport folder.
Creating a Virtual Machine Image • Open the “Virtual Machines” section of the console. • Select the “All Virtual Machines” element. • Click “Create”. • In the “Create a Virtual Machine” dialog, specify the imported VHD file. • The rest of the process is the same as creating VM images from an operating system ISO image.
Completing the Virtual Machine Migration Process • After the VM Image is created from the imported VHD file, it should appear in the target Synchronizer console. • This VM image can be managed like any other VM image in the Synchronizer. • It is completely independent from the source Synchronizer server.
Post-Migration Operations • Consistency check on the target Synchronizer: • Start the newly created VM image in Synchronizer console. • Login to the Hyper-V VM. • Ensure it is the correct image, with all expected applications and configuration. • Verify domain membership and Windows computer name. • Shutdown the Hyper-V VM. • Create a checkpoint version of the VM image: • Creates a baseline for further changes to the image. • Allows roll-back of the image. • Cleanup operations to free up disk space: • On the source Synchronizer, delete the cloned VM image. • On the target Synchronizer, delete the imported VHD file from the software library.
Begin Local Virtual Machine Export • The local VM should be shutdown before exporting it. • Click the “Export a Virtual Machine” task in the Engine activity center to begin the export process. • Select the VM to export. Only local VMs will appear in the list. • Click “Browse” to select the folder to receive the export. • The file name is set automatically based on the name of the local VM being exported. • The Engine will start exporting the local VM. • When complete, the USB storage device should be unassigned from Engine before disconnecting it from the computer.
Importing a Local Virtual Machine Into Engine In the Engine Activity Center, click the “Export a Virtual Machine” task. Browse to the folder containing the exported local VM and select the file ending in “.zip.001”. The Engine starts importing the VM. When the import is complete, the VM will appear on the Engine launcher screen.