VMware Cloud Community
sbwick
Contributor
Contributor

problem with get-scsilun

$vmHost = Get-VMHost -Name $server

Get-ScsiLun -vmHost $vmHost -LunType "disk"

Returns the error: Object reference not set to an instance of an object.

This is rather frustrating as $vmhost is an object and the exact same command works for a colleague at another institution.

I'm using powerCLI version 4.0 U1 build 208462 and windows 7. Any advice would be greatly appreciated.

Reply
0 Kudos
9 Replies
sbwick
Contributor
Contributor

Reply
0 Kudos
LucD
Leadership
Leadership

What ESX/ESXi version do you have running on that host ?

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
sbwick
Contributor
Contributor

4.0.0 build 208111

Reply
0 Kudos
LucD
Leadership
Leadership

Strange, works perfect in my environment which is similar.

Perhaps Carter or one of the guys from the Development Team can help you.

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
catkinso
Contributor
Contributor

Upgrade your powercli to the latest. I had the same issue until I updated...

Reply
0 Kudos
ykalchev
VMware Employee
VMware Employee

Hi,

Can you provide some details for the error in order to try isolating the issue?

$vmHost = Get-VMHost -Name $server
Get-ScsiLun -vmHost $vmHost -LunType "disk"

$error[0]
$error[0].Exception | select *
$error[0].Exception.InnerException | select *

Thanks,

Yasen

Yasen Kalchev, vSM Dev Team
Reply
0 Kudos
crnielsen
Contributor
Contributor

I have the same problem, but only if I connect directly to a stand alone ESX server.

If I connect to a VC server and then runs the code it works fine.

Regards

Claus

Reply
0 Kudos
srpursch
Contributor
Contributor

I just started receiving this error message as well. It works on some hosts but not others. There's only one difference I've noticed between the hosts that work and those that don't. The hosts that work use two LPe1150 HBAs. Those hosts that don't work use a single LPe1205-m dual-port HBA. Everything else is exactly the same. Server Model, ESX version, etc.

Any further help would be appreciated.

For reference, I'm using PowerCLI 4.0 U1, but have also tried 4.0. I've tried connecting to the host directly as well as the VC with the same result.

Another similar post referenced creating an SR. Can anyone give me more information on that?

Thanks!

Reply
0 Kudos
ChadAEG
Contributor
Contributor

I've seen this error before when virtual media (cdrom or floppy) from a DRAC or ILO is connected or attached to the ESX host in question. Once those were disconnected and the host rebooted, the get-scsilun command returned correct info.

Reply
0 Kudos