VMware Cloud Community
zeevik
Contributor
Contributor
Jump to solution

Perl VI fails on vdiskcreate.pl - End Disconnect

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.

Reply
0 Kudos
27 Replies
jnhall
Enthusiast
Enthusiast
Jump to solution

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.

Reply
0 Kudos
jnhall
Enthusiast
Enthusiast
Jump to solution

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....

Reply
0 Kudos
zeevik
Contributor
Contributor
Jump to solution

jnhall,

Excellent fix. Working fine against VI3 and VI4 vCenters.

Thanks for all the effort,

Zeevik.

Reply
0 Kudos
jnhall
Enthusiast
Enthusiast
Jump to solution

No problem, happy to help.

Reply
0 Kudos
r123
Contributor
Contributor
Jump to solution

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

Reply
0 Kudos
pcable
Contributor
Contributor
Jump to solution

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?

Reply
0 Kudos
ii00907
Contributor
Contributor
Jump to solution

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

Reply
0 Kudos
jnhall
Enthusiast
Enthusiast
Jump to solution

In order to assist you I need more information. I can't make sense out of your message.

Reply
0 Kudos