## PowerCLI Reference

# Import-CIVAppTemplate

## Synopsis

This cmdlet imports a virtual machine or an OVF package from vCenter Server to vCloud Director as a vApp template.

Syntax

Import-CIVAppTemplate [-VM] <VirtualMachine> [-Catalog <Catalog>] [-ComputerName <String>] [-Description <String>] [-Name <String>] -OrgVdc <OrgVdc> [-NoCopy] [-GoldMaster] [-RunAsync] [-Server <CIServer[]>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Import-CIVAppTemplate [-Catalog <Catalog>] [-Name <String>] -SourcePath <String> -OrgVdc <OrgVdc> [-RunAsync] [-Server <CIServer[]>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
Import-CIVAppTemplate [-SourcePath <String>] -VAppTemplate <CIVAppTemplate> -ResumeUpload [-RunAsync] [-Server <CIServer[]>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-CIVApp
Get-CIVAppTempate
Import-CIVApp

Detailed Description

This cmdlet imports a virtual machine or an OVF package from vCenter Server to vCloud Director as a vApp template.

Parameters

Name | Type | Description | Required? | Pipeline Input | Default Value
--- | --- | --- | --- | --- | ---
VM | VirtualMachine | Specifies the virtual machine you want to import into vCloud Director. This parameter accepts VirtualMachine objects retrieved from a vCenter Server that has already been registered with vCloud Director. Note: This parameter is only available to Provider Administrators. | true | true (ByValue)
Catalog | Catalog | Specifies the catalog where the imported template will be placed. | false | false
ComputerName | String | Specifies a computer name for the imported object. | false | false
Confirm | SwitchParameter | If 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. | false | false
Description | String | Specifies a description for the imported object. | false | false
GoldMaster | SwitchParameter | Indicates that the virtual machine is imported as a GoldMaster vApp template. | false | false
InformationAction | ActionPreference |  | false | false
InformationVariable | String |  | false | false
Name | String | Specifies a new name for the new OVF or vApp template. If not specified, the new object takes the name of the vSphere virtual machine. | false | false
NoCopy | SwitchParameter | Indicates that you want to import the original vSphere object. Otherwise, a copy of the object is imported in the vCloud. Importing the original vSphere object might cause its modification. | false | false
OrgVdc | OrgVdc | Specifies the organization vDC to which you want to add the new object. | true | false
PipelineVariable | String |  | false | false
ResumeUpload | SwitchParameter | Indicates that you want to resume a previously interrupted OVF upload. | true | false
RunAsync | SwitchParameter | Indicates 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 VMware PowerCLI console. | false | false
Server | CIServer[] | Specifies the cloud 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-CIServer. | false | false
SourcePath | String | Specifies a source path to the OVF file containing the vApp template. | true | false
VAppTemplate | CIVAppTemplate | Specifies vApp templates that have been previously created but the upload has been interrupted. Use with the ResumeUpload parameter to resume and finalize the import process. | true | true (ByValue)
WhatIf | SwitchParameter | Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | false

Return Type

The imported CIVAppTemplate objects

Notes

Examples

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

    $myCatalog = Get-Catalog MyCatalog
    $myOrgvdc = Get-OrgVdc MyOrgVdc
    Import-CIVAppTemplate -SourcePath C:\ovfs\WindowsXP\WindowsXP.ovf -Name MyWindowsXPVAppTemplate -OrgVdc $myOrgvdc -Catalog $myCatalog

Imports an OVF formatted virtual machine as a catalog item while specifying VAppTemplate name, catalog and organization virtual datacenter.

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

    $myorganizationvdc = Get-OrgVdc MyOrgVdc
    Import-CIVAppTemplate -SourcePath C:\ovfs\WindowsXP\WindowsXP.ovf -OrgVdc $myOrgvdc

Imports an OVF formatted virtual machine while specifying only the organization virtual datacenter to be placed in.

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

    Get-CIVAppTemplate MyWindowsXPVAppTemplate | Import-CIVAppTemplate -ResumeUpload -SourcePath C:\ovfs\WindowsXP\WindowsXP.ovf

Resumes upload in case of a network failure. First obtains the not fully uploaded VAppTemplate, then starts the resume process.

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

    $myCatalog = Get-Catalog MyCatalog
    $myOrgvdc = Get-OrgVdc MyOrgVdc
    $myVM = Get-VM -Name 'MyWindowsXP'
    Import-CIVAppTemplate -VM $myVM -Name MyWindowsXPVAppTemplate -OrgVdc $myOrgvdc -Catalog $myCatalog

Imports a vSphere virtual machine as a vCloud Director VAppTemplate.
Note: You must be connected to a vCenter Server and a vCloud Director server.

-------------- Example 5 --------------

    $myOrgvdc = Get-OrgVdc MyOrgVdc
    $myCatalog = Get-Catalog MyCatalog
    $myVM = Get-VM -Name 'MyWindowsXP'
    Import-CIVAppTemplate -VM $myVM -Name MyWindowsXPVAppTemplate -OrgVdc $myOrgvdc -Catalog $myCatalog -NoCopy

Imports a vSphere virtual machine as a vCloud Director VAppTemplate. The virtual machine is moved by using the -NoCopy switch.
Note: You must be connected to a vCenter Server and a vCloud Director server.

Copyright © VMware, Inc. All rights reserved.