vSphere PowerCLI Reference

Import-VApp

Synopsis

Imports OVF (Open Virtualization Format) and OVA packages. The package can contain a virtual appliance or a virtual machine.

Syntax

Import-VApp [-Source] <String> [[-Name] <String>] [-Location <VIContainer>] [-VMHost] <VMHost> [-Datastore <StorageResource>] [-Force] [-DiskStorageFormat <VirtualDiskStorageFormat>] [-Server <VIServer[]>] [-RunAsync] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Export-VApp
Get-VApp
New-VApp
Remove-VApp
Set-VApp
Start-VApp
Stop-VApp
Move-VApp

Detailed Description

Imports OVF (Open Virtualization Format) and OVA packages. The package can contain a vApp or a virtual machine. The cmdlet returns a VApp object when the OVF contains a vApp and a VirtualMachine object when the OVF contains a single virtual machine.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
SourceStringSpecify the path to the OVF or OVA package that you want to import.truefalse
NameStringSpecify a name for the imported vApp or virtual machine.falsefalse
VMHostVMHostSpecify a host where you want to run the vApp or virtual machine.truetrue (ByValue)
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse$true
DatastoreStorageResourceSpecify a datastore or a datastore cluster where you want to store the vApp or virtual machine.falsefalse
DiskStorageFormatVirtualDiskStorageFormatSpecify the storage format for the disks of the imported VMs. By default, the storage format is thick. When you set this parameter, you set the storage format for all virtual machine disks in the OVF package. This parameter accepts Thin, Thick, and EagerZeroedThick values.falsefalse
ForceSwitchParameterIndicate that you want to import an OVF or OVA package even if the package signature cannot be verified.falsefalse
LocationVIContainerSpecify a vSphere inventory container where you want to import the vApp or virtual machine. It must be a vApp, a resource pool, or a cluster.falsefalse
RunAsyncSwitchParameterIndicate that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run " help About_RunAsync" in the vSphere PowerCLI console.falsefalse
ServerVIServer[]Specify the vCenter Server system on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsefalse
WhatIfSwitchParameterIndicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

VApp or VirtualMachine

Notes

Returns a VApp object when the OVF contains a vApp and a VirtualMachine obj ect when the OVF contains a single virtual machine.

Examples

-------------- Example 1 --------------

$vmHost = Get-VMHost -Name "MyVMHost1"
Import-vApp -Source "c:\vApps\WebServer\WebServer.ovf" -VMHost $vmHost

Imports an OVF package by specifying the target host and name.

-------------- Example 2 --------------

$myCluster = Get-Cluster -Name "MyCluster1"
$vmHost = Get-VMHost -Name "MyVMHost1"
Import-vApp -Source "c:\vApps\WebServer\WebServer.ovf" -VMHost $vmHost -Location $myCluster -Name "MyWebServerProduction1"

Imports an OVF package within a cluster.

-------------- Example 3 --------------

$vmHost = Get-VMHost -Name "MyVMHost1"
$myDatastore = Get-Datastore -Name "MyDatastore1"
$vmHost | Import-vApp -Source "c:\vApps\WebServer\WebServer.ovf" -Datastore $myDatastore

Imports an OVF package by specifying a datastore where to store the virtual machines.

-------------- Example 4 --------------

$myDatastore = Get-Datastore -Name "MyDatastore1"
$vmHost = Get-VMHost -Name "MyVMHost1"
$vmHost | Import-vApp -Source "c:\vApps\WebServer\WebServer.ova" -Datastore $myDatastore -Force

Imports an OVA package even if the package signature cannot be verified.


Copyright © 1998 - 2012 VMware, Inc. All rights reserved.