Hello developers,
I'm trying to change the "vApp Options" of an existing vm (deployed from an OVF file) through a perl script (SDK v5.5). With PowerCLI this could be done like this:
https://communities.vmware.com/thread/425751
Has anyone solved this in perl? I tried to port this script, but it just won't run ... especially the ReconfigVM is not called on the vm object, but on ExtensionData. Is this object accessible via perl sdk?
Greetings
Michael
The example you linked is calling into vCloud Director -- I think (I generally work in *nix so PowerCLI isn't on my usual toolset).
I believe you'll want to go to UpdateVAppConfig() in vSphere. If you look at the VAppConfigSpec object, you'll probably want to modify property or ovfSection.
Can you call UpdateVAppConfig() on a VirtualMachine-Object? The vm I want to modify is not a VirtualApp, just a single vm with VApp properties from the ovf ...
Here's my code snippet, that doesn't work:
my $VAppPropertyInfo = VAppPropertyInfo->new(
key => '0',
value => '1.1.1.1',
);
my $VAppPropertySpec = VAppPropertySpec->new(
operation => "edit",
info => $VAppPropertyInfo,
);
my $VmConfigSpec = VmConfigSpec->new(
property => [$VAppPropertySpec],
);
my $VirtualMachineConfigSpec = VirtualMachineConfigSpec->new(
vAppConfig => $VmConfigSpec,
);
$vm->ReconfigVM(
spec => $VirtualMachineConfigSpec,
);
