Using the OVF Import/Export Tool
Updated: January 15, 2013
Applies To: System Center 2012 - Virtual Machine Manager
The Open Virtualization Format (OVF) is a packaging standard from Distributed Management Task Force, Inc., for portability and deployment of virtual appliances. The OVF Import/Export tool consists of cmdlets that enable System Center 2012 – Virtual Machine Manager (VMM) users to import and export virtual machines that are packaged in the OVF format. You can use the OVF Import/Export tool to import a virtual machine from other virtualization platforms (currently VMware vCenter and Citrix XenServer) or to export a virtual machine for use on another platform.
The OVF format uses an XML file with the extension .ovf together with one or more virtual disks. The OVF Import/Export tool does not convert virtual hard disk file formats. You may need third-party tools to convert a virtual hard disk format.
The name of the virtual hard disk that is specified in the .ovf file must match the actual path and name of the virtual hard disk. If you convert a file from, for instance, .vmdk to .vhd, or if you rename the virtual hard disk file, you must also edit the .ovf file to update the name.
Note the following:
-
If you plan to convert a virtual hard disk from one format to another, such as from .vhd to .vmdk or from .vmdk to .vhd, we recommend that you use a fixed size disk, otherwise known as a “thick disk.”
-
The virtual hard disk name appears more than once in the .ovf file. Be sure to update all instances of the name.
-
The current version of the tool supports a single virtual machine. The import and export of VMM service templates, more than one virtual machine or with deployment customizations are not currently supported.
Installing the OVF tool
You can download the OVF Import/Export tool from the Microsoft Download Center. The OVF Import/Export tool is distributed as an installer package. You must install the tool on an existing VMM management server that has the VMM console installed. The package installs a Windows PowerShell snap-in that contains the following cmdlets:
-
Export-SCVirtualMachine
-
Import-SCVirtualMachine
To install the OVF Import/Export tool, double-click the Windows Installer package SC2012_VMM_OVFImport-Export.msi. You must accept the license terms and select an installation folder. Complete the installation.
Before you use the cmdlets in the VMM command shell you must add the snap-in to your current PowerShell session. To add the snap-in, run the cmdlet Add-PSSnapin OVFToolSnapIn.
If you start a new PowerShell session by opening a new instance of the VMM command shell, you must run the cmdlet in that session before you can use the OVF Import/Export cmdlets.
Note |
|---|
| If you use a profile, add the cmdlet Add-PSSnapin OVFToolSnapIn to your profile to load the snap-in automatically. For more information, type get-help about_profiles. |
Importing a virtual machine
Use the Import-SCVirtualMachine cmdlet to create a new virtual machine for VMM using the .ovf file and virtual hard disks in a specified location. The cmdlet creates a new virtual machine with the referenced virtual hard disk and stores it in a VMM library share. Self-service users must specify a writable share for the virtual machine. Note the following:
-
Before you import an OVF package to VMM with the OVF Import/Export tool, verify that the virtual hard disk format is .vhd or .vhdx, or convert it to be .vhd or .vhdx. Be sure to use fixed size disk format.
-
If the original virtual machine is joined to a logical network, the import process tries to join the imported virtual machine to a logical network if one with the same name exists. Otherwise, it is not joined to a network.
The Import-SCVirtualMachine cmdlet has several key parameters.
| Import Parameter | Optional? | Description |
|---|---|---|
|
ImportVMPath |
No |
Specifies the path of the OVF descriptor file to be imported. |
|
LibraryServerObject |
No |
Specifies the library server object that is associated with the library share. |
|
VMMServerObject |
No |
Specifies the VMM management server. |
|
LibrarySharePath |
No |
Specifies the library share. |
|
VHDSourcePath |
No |
Specifies a local path for the virtual hard disk. Specify multiple instances for virtual machines with more than one virtual hard disk. |
|
VMName |
No |
Specifies a name for the new virtual machine. |
|
AllowUnencryptedTransfer |
Switch |
Whether Unencrypted Bits transfer is allowed. |
|
Overwrite |
Switch |
Whether export files overwrite existing files. |
The following example creates and stores a virtual machine that is named MyVirtualMachine.
$vmm = get-scvmmserver -ComputerName "MyVMM" $ls = Get-SCLibraryServer -ComputerName " MyLibraryServer" Import-SCVirtualMachine -ImportVMPath "C:\Test\MyVirtualMachineOVF.ovf" -LibraryServerObject $ls -VMMServerObject $vmm -LibrarySharePath "\\MyLibraryServerFQDN\MSSCVMMLibrary\Import\" -VHDSourcePath "C:\ImportInVMM\MyVirtualMachineVHD.vhd" -VMName "MyVirtualMachine"
The first command gets the VMM management server. The second command gets the library server. The third command creates a virtual machine with the specified name using the specified .ovf file and disk, and then stores it in the specified library share.
Exporting a virtual machine
Use the Export-SCVirtualMachine cmdlet to create an OVF package together with the virtual hard diske for a virtual machine. The virtual machine that you want to export must be stored in the library. The cmdlet saves the exported files in a specified local directory.
The Export-SCVirtualMachine cmdlet has several key parameters.
| Export Parameter | Optional? | Description |
|---|---|---|
|
ExportPath |
No |
Specifies a local path for exporting the OVF files. |
|
StoredVMObject |
No |
Specifies the stored virtual machine object to be exported. |
|
TargetVirtualizationPlatform |
No |
Specifies the platform for export: vmm, vcenter, or xen. |
|
VMMServerObject |
No |
Specifies the VMM management server. |
|
AllowUnencryptedTransfer |
Switch |
Whether Unencrypted Bits transfer is allowed. |
|
Overwrite |
Switch |
Whether export files overwrite existing files. |
|
ExportOnlyOVF |
Switch |
Whether to export only the .ovf file without a .vhd file. |
The following example exports a virtual machine that is named MyVirtualMachine.
$vmm = get-scvmmserver -ComputerName "MyVMM" $vm = get-scvirtualmachine -name "MyVirtualMachine" Export-SCVirtualMachine -ExportPath "C:\ExportDir" -StoredVMObject $vm -TargetVirtualizationPlatform ”<supportedPlatform>” -VMMServerObject $vmm
The first command gets the VMM management server. The second command gets the virtual machine object. The third command exports the virtual machine in the form of an OVF package to the local export path.
-----
For additional resources, see Information and Support for System Center 2012.
Tip: Use this query to find online documentation in the TechNet Library for System Center 2012. For instructions and examples, see Search the System Center 2012 Documentation Library.
-----

Note