OK, took me a while to clue in that vcPlugin.importOvf() only imports ovf, not ova. File, but how do I import an OVF that is unsigned. I keep getting a certificate error. Yes, I am trying to import the vRA Appliance in the below example, but the same thing happens with a VM that I export to OVF form. I have random appliances coming from users that need to be deployed and I want to automate the process (there is lots of customization to do after the appliance is deployed). I also want to deploy a vRA lab on-demand.
The OVF used below was created using ovftool to convert from the vRA appliance from OVA to OVF form (which looses the certificate information).
Most of the Code:
var props = ;
var key = new VcKeyValue();
key.key = "vm.name";
key.value = "myvm7306";
var networkMap = ;
var map = new VcOvfNetworkMapping();
map.name = "Network 1";
map.network = vmNetwork;
System.log("Importing: " + path + " to host " + vcHost.name + " as VM " + vmShortName);
vm = VcPlugin.importOvf(path, vcHost, infrastructureFolder, vmShortName, networkMap, vcDS, props);
[2018-07-19 20:24:57.918] [I] Importing: file:///storage/spool/vRAOVF/VMware-vR-Appliance-18.104.22.1686-5610496_OVF10.ovf to host cnpdcesxd1003 as VM myvm7306
[2018-07-19 20:24:59.403] [E] Error in (Workflow:ImportOVF / Import OVF (item1)#49) java.security.cert.CertificateException: Certificate is not in CA store.