VMware Cloud Community
bllward
Contributor
Contributor

Import a vApp with all OVF Environment parameters

Hi,

I'm trying to import a multi-vm vApp using PowerCLI. Obviously, I can use Import-vApp to import the vApp and put it on the correct host and datastore. However, the vApp has a lot of pre-defined OVF Environment settings (guest name, IP settings, VM Network etc) that need to be entered before deployment.

Any idea how I can pass these parameters into a PowerCLI command / script?

Thanks,

Ben

0 Kudos
7 Replies
LucD
Leadership
Leadership

I'm afraid there are currently no cmdlets for that.

The alternative is to use the ovfManager and it's methods.

The ParseDescriptor should produce all the additional properties and once you have those you should be able to call the ImportVAPP method.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
bllward
Contributor
Contributor

I was afraid of that!

I'm trying to call ParseDescriptor with Orchestrator. Is there a way of doing it with PowerCLI?

0 Kudos
LucD
Leadership
Leadership

Sure, try something like this

$ovfMgr = Get-View ovfManager[string]
$descriptor
= Get-Content "C:\Temp\Orchestrator\vCO_VA-4.2.0.1-507352_OVF10.ovf"
$pdp = New-Object VMware.Vim.OvfParseDescriptorParams
$pdp.Locale = ""
$pdp
.deploymentOption = ""

$result
= $ovfMgr.ParseDescriptor($descriptor,$pdp)

In $result.Property you will now find all the user configurable parameters.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

bllward
Contributor
Contributor

Thanks LucD.

How can I then use this to import the vApp? Can the result be piped into the Import-Vapp cmdlet, or do I need to use another API call, such as importVapp.

0 Kudos
LucD
Leadership
Leadership

Yes, it can.

And I had a working script for this, but it seems that there is a flaw in the current Get-View cmdlet that doesn't allow one to read the HttpNfcLease anymore.

I'll investigate further.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
theRock0
Contributor
Contributor

I have the same question.. Any findings?

0 Kudos
LucD
Leadership
Leadership

I'm afraid not :smileycry:

Dev agreed it was a bug, but no solution till now.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos