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 <Datastore>] [-Force] [-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 virtual appliance or a virtual machine. The cmdlet returns a VApp object when the OVF contains a virtual appliance 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 you want to import.truefalse
NameStringSpecify a name for the imported virtual appliance.falsefalse
VMHostVMHostSpecify a host where you want to run the virtual appliance.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
DatastoreDatastoreSpecify a datastore where you want to store the virtual appliance.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 virtual appliance. It must be a virtual appliance, 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 vSphere servers 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 virtual appliance and a Virtu alMachine object when the OVF contains a single virtual machine.

Examples

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

Import-vApp -Source c:\vApps\WebServer\WebServer.ovf -VMHost $host

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

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

Import-vApp -Source c:\vApps\WebServer\WebServer.ovf -VMHost $host -Cluster $productionCluster -Name WebServerProduction

Imports an OVF package within a cluster.

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

$host | Import-vApp -Source c:\vApps\WebServer\WebServer.ovf -Datastore $storage

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

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

$host | Import-vApp -Source c:\vApps\WebServer\WebServer.ova -Datastore $storage -Force

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


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