VMware Cloud Community
vmpwcliuser31
Contributor
Contributor

Importing an OVF (in a vDS, no standard switches) using PowerCLI

Hello all,

After a bunch of searching, I couldn't find what I was looking for so excuse the possible 'dumb question'.

I'm trying to import an OVF via PowerCLI to a 6.7 environment (ovf came from a 6.7 environment as well).  The VM that I exported as an OVF was only connected to a vDS port group and when I use the import-vapp command I get the "Host did not have any virtual network defined" error message.

I did see this  in Section 7 answering my question or so I thought.  When I ran the 3rd command in that section 

$ovfConfig.NetworkMapping.Network.Value = $vdPortGroup

I received "The property 'Value' cannot be found on this object.  Verify that the property exists and can be set." error message.

What am I missing? 😐

0 Kudos
10 Replies
LucD
Leadership
Leadership

Is that property configured to prompt when the OVA was created?
Do you see that Network property when you try to import the OVA via the Web Client?

You can also dump the OVF properties and check what is there.

$ovfConfig | Format-Custom -Depth 4


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

0 Kudos
vmpwcliuser31
Contributor
Contributor

Thanks for the reply LucD!  I'll try to answer as best as I can...

When I created the OVF, I used:

Export-VApp -Destination 'C:\some_path\VM_NAME_export\' -VM VM_NAME -Format Ovf

 

I am able to import the OVF via the HTML5 client (it prompts me for a VLAN/network to be used) and via the HTML5 client it works great.  I just ran through the commands in section 7 again and when the 3rd command failed, I ran the command you wanted me to run.  This is what I see:

ovf-0.PNG

0 Kudos
LucD
Leadership
Leadership

Apparently Format-Custom can't traverse that object.
Can you manually descend and check if that Value property is there?


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

0 Kudos
vmpwcliuser31
Contributor
Contributor

Yeah when I found an article on how to traverse the path, it did show the actual port group name (as an example it'd be something like:  888-DTT-PRD-SEC).

0 Kudos
LucD
Leadership
Leadership

And that includes the Value property?


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

0 Kudos
vmpwcliuser31
Contributor
Contributor

If I'm understanding your question properly, when I type

$ovfConfig.NetworkMapping

and then hit enter, I see the port group name and that's it.  It looks similar to this:

ovf-1.PNG

0 Kudos
LucD
Leadership
Leadership

That seems to indicate there is no Value property below.
Can you try assigning the name of the portgroup to that property instead of the Value property?


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

0 Kudos
vmpwcliuser31
Contributor
Contributor

How would I go about doing that?

 

Like this?:

$ovfConfig.NetworkMapping.Network.Value = 888-DTT-PRD-SEC

0 Kudos
LucD
Leadership
Leadership

I'm not sure anymore.
Those OVF properties look kinda strange.
It looks as if, judging from your last screenshot, you have $ovfConfig.NetworkMapping.888-DTT-PRD-SEC as a property. without a value in there.
Which I don't really understand.


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

0 Kudos
vmpwcliuser31
Contributor
Contributor

Ah okay, after seeing that, maybe I'm starting to understand it a bit more. 🙂

 

This is the site I was using to help me look around originally yesterday, and if I compare when I do:

$ovfConfig.NetworkMapping.888-DTT-PRD-SEC and hit enter, I get this:

ovf-2.PNG

So it's like it's missing the key, value, default value, ovftypedescription, & description for some reason.  Maybe I have to manually input them?

Time for some brain food... 🙂

0 Kudos