VMware Cloud Community
MikeBroderick
Contributor
Contributor
Jump to solution

Export-vApp to OVA, VM name containing spaces gives "Object reference not set to an instance..."

If I run the command:

Export-VApp -VM 'Test Space' -Destination "D:\Backups\VM\ESXi18\TestSpace.ova" -Format OVA

I very quickly get the error: 

Export-VApp: 2/1/2022 10:47:44 AM Export-VApp Object reference not set to an instance of an object.
PS C:\Users\myUserID>

If I change the name of the VM from "Test Space" to "TestSpace" or "Test-Space", it works. If I change the format to OVF (and change the destination to a folder), it works.

Currently I am on 7.0.3c, but I have had this problem since 7.0.0.

Any ideas how to fix it? I am currently saving the production VM (I created TestSpace for troubleshooting) as an OVF as a work around.

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

I just tested with the latest version of ovftool, and there the export to OVA works when the VM's Displayname has a blank in it.
That looks like a PowerCLI bug.
I suggest opening an SR.


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

View solution in original post

Reply
0 Kudos
7 Replies
LucD
Leadership
Leadership
Jump to solution

Does the Web Client allow you to do that?


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

Reply
0 Kudos
MikeBroderick
Contributor
Contributor
Jump to solution

No, only the OVF option is shown in the web clients. The web client also prompts you to save each file being saved.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

I just tested with the latest version of ovftool, and there the export to OVA works when the VM's Displayname has a blank in it.
That looks like a PowerCLI bug.
I suggest opening an SR.


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

Reply
0 Kudos
MikeBroderick
Contributor
Contributor
Jump to solution

I updated my PowerCLI to the latest release, same error.

At this point my workaround is fine (save as ovf) and I only want to report the problem to VMWare Inc. You recommended I open a Support Request, and I found a 'report a defect' page on VMWares site. The instructions guided me to buy an instance for $308 (quantity discounts available). I do not anticipate doing that. If not, the webpage said to post the incident on the appropriate Community forum. I assume that I have been doing that here and someone is monitoring the site. If I need to do something else, please advise. Otherwise, thank you for your help.

Mike

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Yes, you do need a Support Contract to be able to open an SR.


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

Reply
0 Kudos
LHBL2003
Contributor
Contributor
Jump to solution

The error seems to be still present with vCenter 8 and the current PowerCLI. Also special characters like pipe or @ cause problems. However, I now have a VM where it doesn't work either and there I only have Test1234.
The PowerCLI export seems to be completely buggy.

Reply
0 Kudos
LHBL2003
Contributor
Contributor
Jump to solution

 

The solution took me 2 hours of my life.
1. the VM display name should have no , special characters and spaces. Underscores are OK.
2. the VM notice text in the vCenter should not have line breaks or similar.

Of course you want to keep your VMs in vCenter as they are.

For this reason, specify the parameters Name and Description when exporting. It is best not to enter a description. Make sure that the name consists only of numbers, letters and underlined. Do not write ".ova" - this is done by the export itself.

Do not enter a file name for Destination. It is best to use the path from the Windows Explorer. So without \ at the end.

Example:

 

Export-VApp -VM 'Test Space' -Destination "" -Name "SimpleExportName" "D:\Backups\VM\ESXi18" -Format OVA

 

The response from the export will then tell you what the file is called and where it is located.

 

Reply
0 Kudos