So I'm trying to use CreateVAPP to create a new barebones Vapp and I'm running into problems.
I have this call: my $vapp = $rp->CreateVApp(name => "Test_for_DR_Script", configSpec => $vAppConfig, resSpec => $resConfig);
and the configSpec: my $vAppConfig = VAppConfigSpec->new(annotation => "This is a test VApp", vmFolder => $tmpFolder);
and everytime I run it, I get:
Argument vmFolder is not valid at /usr/share/perl5/VMware/VICommon.pm line 2486
ComplexType::arg_validation('VAppConfigSpec', 'vmFolder', 'ManagedObjectReference=HASH(0x4ac8090)', 'annotation', 'This is a test VApp') called at /usr/share/perl5/VMware/VICommon.pm line 2458
ComplexType::new('VAppConfigSpec', 'annotation', 'This is a test VApp', 'vmFolder', 'ManagedObjectReference=HASH(0x4ac8090)') called at ./getVAPPInfo.pl line 154
I have run thru practically every folder I can find from the ESXi host on up to the top of the tree and all of them give me that error.
Can anyone give me some help? An example creating a VApp would be great, but short of that, explaining what folder I need would help.
Also, I am using the SDK for Perl v5.1 connecting to a vSphere Appliance v 5.0U2.
Ok, I feel incredibly stupid. The problem was that vmFolder isn't a property in vAppConfigSpec, it's a property in the CreateVAPP method. Imagine this: when you put things in the right place, they work as designed.