Hi,
I'm trying to create a VM using the API that will mount an ISO when the VM is created. I have the following snippet of code in my PERL script:
=== Start code snippet ===
my $ds_iso = undef;
my $dstores = Vim::get_views(mo_ref_array => $host_view->datastore);
foreach (@$dstores) {
if ($_->{name} eq 'ISOS') {
$ds_iso = $_;
last;
}
}
my $cd_backing_info = VirtualCdromIsoBackingInfo->new(
datastore => $ds_iso;
filename => 'blank.iso');
=== End code snippet ===
Whenever I run my script though, I get the following error messages:
Argument filename is not valid at /usr/share/perl5/VMware/VICommon.pm line 2492
ComplexType::arg_validation('VirtualCdromIsoBackingInfo', 'filename' blank.iso', 'datastore', 'Datastore=HASH(0x...)') called at /usr/share/perl5/VMware/VICommon.pm line 2464
ComplextType::new('VirtualCdromIsoBackingInfo' 'datastore', 'Datastore=HASH(0x...)', 'filename', 'blank.iso') called at createvm.pl line 100
For the "filename => 'blank.iso'" above, I've tried "blank.iso", "[ISOS]/blank.iso", and "/vmfs/volumes/_uuid_/blank.iso". All of them give the same error message.
What is a valid filename that I can use here?
BTW, I've confirmed. The ISO file, blank.iso, is at the top level of my "[ISOS]" datastore.
Thank you in advance.
Lewis