Create a vApp from a Content Library Item

You can deploy a vApp from a content library template.

Note: VMware PowerCLI cannot distinguish between OVF content library items of type virtual machine template and vApp template. As a result, New-VApp creates a virtual machine if you specify a virtual machine template from the content library by using the ContentLibraryItem parameter of the cmdlet. If this happens, New-VApp returns an error, notifying that the cmdlet produced an inventory item of the wrong type. Avoid creating virtual machines by using the New-VApp cmdlet, as this behavior will be deprecated in future releases.

Prerequisites

  • Verify that you are connected to a vCenter Server system.

  • Verify that you have a content library with vApp templates available.

Procedure

  1. Get the virtual machine host.
    $myVMHost = Get-VMHost myVMHost
  2. Create the MyVApp vApp from the MyVAppContentLibrayItemName content library item.
    Get-ContentLibraryItemName MyVAppContentLibrayItemName | New-VAppName MyVApp –VMHost $myVMHost