Import and export VMs 编辑
Citrix Hypervisor allows you to import VMs from and export them to various different formats. Using the Citrix Hypervisor Center Import wizard, you can import VMs from disk images (VHD and VMDK), Open Virtualization Format (OVF and OVA) and Citrix Hypervisor XVA format. You can even import VMs that have been created on other virtualization platforms, such as those offered by VMware and Microsoft.
Note:
When importing VMs that have been created using other virtualization platforms, configure or fix up the guest operating system to ensure that it boots on Citrix Hypervisor. The Operating System Fixup feature in Citrix Hypervisor Center aims to provide this basic level of interoperability. For more information, see Operating system fixup.
Using the Citrix Hypervisor Center Export wizard, you can export VMs to Open Virtualization Format (OVF and OVA) and Citrix Hypervisor XVA format.
You can also use the xe CLI to import VMs from and export them to Citrix Hypervisor XVA format.
Supported formats
Format | Description |
---|---|
Open Virtualization Format (OVF and OVA) | OVF is an open standard for packaging and distributing a virtual appliance consisting of one or more VMs. |
Disk image formats (VHD and VMDK) | Virtual Hard Disk (VHD) and Virtual Machine Disk (VMDK) format disk image files can be imported using the Import wizard. Importing a disk image may be appropriate when there is a virtual disk image available, with no OVF metadata associated. |
Citrix Hypervisor XVA format | XVA is a format specific to Xen-based hypervisors for packaging an individual VM as a single file archive, including a descriptor and disk images. Its file name extension is .xva . |
Which format to use?
Consider using OVF/OVA format to:
Share Citrix Hypervisor vApps and VMs with other virtualization platforms that support OVF
Save more than one VM
Secure a vApp or VM from corruption and tampering
Include a license agreement
Simplify vApp distribution by storing an OVF package in an OVA file
Consider using XVA format to:
- Import and export VMs from a script with a CLI
Open virtualization format (OVF and OVA)
OVF is an open standard, specified by the Distributed Management Task Force, for packaging and distributing a virtual appliance consisting of one or more VMs. For further details about OVF and OVA formats, see the following information:
- Knowledge Base Article CTX121652: Overview of the Open Virtualization Format
- Open Virtualization Format Specification
Note:
To import or export OVF or OVA packages, you must be logged in as root or have the Pool Administrator Role Based Access Control (RBAC) role associated with your user account.
An OVF Package is the set of files that comprises the virtual appliance. It always includes a descriptor file and any other files that represent the following attributes of the package:
Attributes
Descriptor (.ovf
): The descriptor always specifies the virtual hardware requirements of the package. It may also specify other information, including:
- Descriptions of virtual disks, the package itself, and guest operating systems
- A license agreement
- Instructions to start and stop VMs in the appliance
- Instructions to install the package
Signature (.cert
): The signature is the digital signature used by a public key certificate in the X.509 format to authenticate the author of the package.
Manifest (.mf
): The manifest allows you to verify the integrity of the package contents. It contains the SHA-1 digests of every file in the package.
Virtual disks: OVF does not specify a disk image format. An OVF package includes files comprising virtual disks in the format defined by the virtualization product that exported the virtual disks. Citrix Hypervisor produces OVF packages with disk images in Dynamic VHD format; VMware products and Virtual Box produce OVF packages with virtual disks in Stream-Optimized VMDK format.
OVF packages also support other non-metadata related capabilities, such as compression, archiving, EULA attachment, and annotations.
Note:
When importing an OVF package that has been compressed or contains compressed files, you may need to free up extra disk space on the Citrix Hypervisor server to import it properly.
An Open Virtual Appliance (OVA) package is a single archive file, in the Tape Archive (.tar) format, containing the files that comprise an OVF Package.
Select OVF or OVA format
OVF packages contain a series of uncompressed files, which makes it easier when you want to access individual disk images in the file. An OVA package contains one large file, and while you can compress this file, it does not give you the flexibility of a series of files.
Using the OVA format is useful for specific applications for which it is beneficial to have just one file, such as creating packages for Web downloads. Consider using OVA only as an option to make the package easier to handle. Using this format lengthens both the export and import processes.
Disk image formats (VHD and VMDK)
Using Citrix Hypervisor Center, you can import disk images in the Virtual Hard Disk (VHD) and Virtual Machine Disk (VMDK) formats. Exporting standalone disk images is not supported.
Note:
To import disk images, ensure that you are logged in as root or have the Pool Administrator RBAC role associated with your user account.
You might choose to import a disk image when a virtual disk image is available without any associated OVF metadata. This option might occur in the following situations:
It is possible to import a disk image, but the associated OVF metadata is not readable
A virtual disk is not defined in an OVF package
You are moving from a platform that does not allow you to create an OVF package (for example, older platforms or images)
You want to import an older VMware appliance that does not have any OVF information
You want to import a standalone VM that does not have any OVF information
When available, we recommend importing appliance packages that contain OVF metadata rather than an individual disk image. The OVF data provides information the Import wizard requires to recreate a VM from its disk image, This information includes the number of disk images associated with the VM, the processor, storage, network, memory requirements and so on. Without this information, it can be much more complex and error-prone to recreate the VM.
XVA format
XVA is a virtual appliance format specific to Citrix Hypervisor, which packages a single VM as a single set of files, including a descriptor and disk images. The file name extension is .xva
.
The descriptor (file name extension ova.xml
) specifies the virtual hardware of a single VM.
The disk image format is a directory of files. The directory name corresponds to a reference name in the descriptor and contains two files for each 1 MB block of the disk image. The base name of each file is the block number in decimal. The first file contains one block of the disk image in raw binary format and does not have an extension. The second file is a checksum of the first file. If the VM was exported from Citrix Hypervisor 8.0 or earlier, this file has the extension .checksum
. If the VM was exported from Citrix Hypervisor 8.1 or later, this file has the extension .xxhash
.
Important:
If a VM is exported from the Citrix Hypervisor server and then imported into another Citrix Hypervisor server with a different CPU type, it may not run properly. For example, a Windows VM exported from a host with an Intel® VT Enabled CPU might not run when imported into a host with an AMD-VTM CPU.
Operating system fixup
When importing a virtual appliance or disk image created and exported from a virtualization platform other than Citrix Hypervisor, you might have to configure the VM before it boots properly on the Citrix Hypervisor server.
Citrix Hypervisor Center includes an advanced hypervisor interoperability feature – Operating System Fixup – which aims to ensure a basic level of interoperability for VMs that you import into Citrix Hypervisor. Use Operating System Fixup when importing VMs from OVF/OVA packages and disk images created on other virtualization platforms.
The Operating System Fixup process addresses the operating system device and driver issues inherent when moving from one hypervisor to another. The process attempts to repair boot device-related problems with the imported VM that might prevent the operating system within from booting in the Citrix Hypervisor environment. This feature is not designed to perform conversions from one platform to another.
Note:
This feature requires an ISO storage repository with 40 MB of free space and 256 MB of virtual memory.
Operating System Fixup is supplied as an automatically booting ISO image that is attached to the DVD drive of the imported VM. It performs the necessary repair operations when the VM is first started, and then shuts down the VM. The next time the new VM is started, the boot device is reset, and the VM starts normally.
To use Operating System Fixup on imported disk images or OVF/OVA packages, enable the feature on the Advanced Options page of the Citrix Hypervisor Center Import wizard. Specify a location where the Fixup ISO is copied so that Citrix Hypervisor can use it.
What does operating system fixup do to the VM?
The Operating System Fixup option is designed to make the minimal changes possible to enable a virtual system to boot. Depending on the guest operating system and the hypervisor of the original host, further actions might be required after using Operating System Fixup. These actions can include configuration changes and driver installation.
During the Fixup process, an ISO is copied to an ISO SR. The ISO is attached to a VM. The boot order is set to boot from the virtual DVD drive, and the VM boots into the ISO. The environment within the ISO then checks each disk of the VM to determine if it is a Linux or a Windows system.
If a Linux system is detected, the location of the GRUB configuration file is determined. Any pointers to SCSI disk boot devices are modified to point to IDE disks. For example, if GRUB contains an entry of /dev/sda1
representing the first disk on the first SCSI controller, this entry is changed to /dev/hda1
representing the first disk on the first IDE controller.
If a Windows system is detected, a generic critical boot device driver is extracted from the driver database of the installed OS and registered with the OS. This process is especially important for older Windows operating systems when the boot device is changed between a SCSI and IDE interface.
If certain virtualization tool sets are discovered in the VM, they are disabled to prevent performance problems and unnecessary event messages.
Import VMs
When you import a VM, you effectively create a VM, using many of the same steps required to provision a new VM. These steps include nominating a host, and configuring storage and networking.
You can import OVF/OVA, disk image, XVA, and XVA Version 1 files using the Citrix Hypervisor Center Import wizard. You can also import XVA files via the xe CLI.
Import VMs from OVF/OVA
Note:
To import OVF or OVA packages, you must be logged in as root or have the Pool Administrator Role Based Access Control (RBAC) role associated with your user account.
The Citrix Hypervisor Center Import wizard allows you to import VMs that have been saved as OVF/OVA files. The Import wizard takes you through the usual steps to create a VM in Citrix Hypervisor Center: nominating a host, and then configuring storage and networking for the new VM. When importing OVF and OVA files, extra steps may be required, such as:
- When importing VMs that have been created using other virtualization platforms, run the Operating System Fixup feature to ensure a basic level of interoperability for the VM. For more information, see Operating system fixup.
Tip:
Ensure that the target host has enough RAM to support the virtual machines being imported. A lack of available RAM results in a failed import. For more information about resolving this issue, see CTX125120 - Appliance Import Wizard Fails Because of Lack of Memory.
Imported OVF packages appear as vApps when imported using Citrix Hypervisor Center. When the import is complete, the new VMs appear in the Citrix Hypervisor Center Resources pane, and the new vApp appears in the Manage vApps dialog box.
To import VMs from OVF/OVA by using Citrix Hypervisor Center:
Open the Import wizard by doing one of the following:
- In the Resources pane, right-click, and then select Import on the shortcut menu.
- On the File menu, select Import.
On the first page of the wizard, locate the file you want to import, and then click Next to continue.
Review and accept EULAs, if applicable.
If the package you are importing includes any EULAs, accept them and click Next to continue. When no EULAs are included in the package, the wizard skips this step and advance straight to the next page.
Specify the pool or host to which you want to import the VMs, and then (optionally) assign the VMs to a home Citrix Hypervisor server.
To select a host or pool, choose from the Import VM(s) to list.
To assign each VM a home Citrix Hypervisor server, select a server from the list in the Home Server. If you want not to assign a home server, select Don’t assign a home server.
Click Next to continue.
Configure storage for the imported VMs: Choose one or more storage repositories on which to place the imported virtual disks, and then click Next to continue.
To place all the imported virtual disks on the same SR, select Place all imported VMs on this target SR. Select an SR from the list.
To place the virtual disks of incoming VMs onto different SRs, select Place imported VMs on the specified target SRs. For each VM, select the target SR from the list in the SR column.
Configure networking for the imported VMs: map the virtual network interfaces in the VMs you are importing to target networks in the destination pool. The Network and MAC address shown in the list of incoming VMs are stored as part of the definition of the original (exported) VM in the export file. To map an incoming virtual network interface to a target network, select a network from the list in the Target Network column. Click Next to continue.
Specify security settings: If the selected OVF/OVA package is configured with security features, such as certificates or a manifest, specify the information necessary, and then click Next to continue.
Different options appear on the Security page depending on which security features have been configured on the OVF appliance:
If the appliance is signed, a Verify digital signature check box appears, automatically selected. Click View Certificate to display the certificate used to sign the package. If the certificate appears as untrusted, it is likely that either the Root Certificate or the Issuing Certificate Authority is not trusted on the local computer. Clear the Verify digital signature check box if you do not want to verify the signature.
If the appliance includes a manifest, a Verify manifest content check box appears. Select this check box to have the wizard verify the list of files in the package.
When packages are digitally signed, the associated manifest is verified automatically, so the Verify manifest content check box does not appear on the Security page.
Note:
VMware Workstation 7.1.x OVF files fail to import when you choose to verify the manifest. This failure occurs because VMware Workstation 7.1.x produces an OVF file with a manifest that has invalid SHA-1 hashes. If you do not choose to verify the manifest, the import is successful.
Enable Operating System Fixup: If the VMs in the package you are importing were built on a virtualization platform other than Citrix Hypervisor, select the Use Operating System Fixup check box. Select an ISO SR where the Fixup ISO can be copied so that Citrix Hypervisor can access it. For more information about this feature, see Operating system fixup.
Click Next to continue.
Review the import settings, and then click Finish to begin the import process and close the wizard.
Note:
Importing a VM may take some time, depending on the size of the VM and the speed and bandwidth of the network connection.
The import progress is displayed in the status bar at the bottom of the Citrix Hypervisor Center window and on the Logs tab. When the newly imported VM is available, it appears in the Resources pane, and the new vApp appears in the Manage vApps dialog box.
Note:
After using Citrix Hypervisor Center to import an OVF package that contains Windows operating systems, you must set the
platform
parameter.
Set the
platform
parameter todevice_id=0002
. For example:xe vm-param-set uuid=VM uuid platform:device_id=0002
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论