Trying to run Perl-VI vm/vdiskcreate.pl and fails, with the following error message:
Can't call method "key" on an undefined value at C:\Program Files\VMware\VMware vSphere CLI\Perl\apps\vm\vdiskcreate.pl line 82, <STDIN> line 2.
End Disconnect
Perl-VI is the latest 1.6 version (doesnloaded this morning). Same script command works fine vs. ESX-3.5 server .
Help will be appriciate,
Zeevik.
It should be working fine with VI3.5 (rather than 4.0) now, whether through VC or directly to the host. Can you check that to be sure?
Meanwhile let me come up with something, should be just a few minutes.
Try this. But first, a disclaimer: This is not an official patch or an official anything and comes with no guarantees. You've been warned!
However, I did try this, and it seems to do the trick. Hope I copied everything in here correctly with no missing semicolons, etc.
In vdiskcreate.pl, change line 81 (or thereabouts) from:
controller => 'SCSI controller 0');
to
controller => qr/^SCSI controller 0$/i);
Then in VMUtil.pm (in the apps/AppUtil directory), at line 380 or thereabouts, in sub find_device, replace the line:
return $device if ($device->deviceInfo->label eq $name);
with this block of code:
if (ref $name eq 'Regexp') {
return $device if ($device->deviceInfo->label =~ $name);
} else {
return $device if ($device->deviceInfo->label eq $name);
}
Let me know how it goes....
jnhall,
Excellent fix. Working fine against VI3 and VI4 vCenters.
Thanks for all the effort,
Zeevik.
No problem, happy to help.
Hi,
For me the same error happened when traying to add the only virtual disk to machine. Then there are no SCSI controller at all. So it was possible to add just second disk by vdiskcreate.pl
Regards,
Roberts
Certificates issue resolved.
I was wondering how you resolved this -- it's still plaguing me.
Where can I find either the option to turn off certificate checking in the VI client, or how can i import certificates for use with my scripts?
Very very good fix.
But this path for the rdmp not run.
You know give me some info.
can you help me please
By
Ivan
In order to assist you I need more information. I can't make sense out of your message.