$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.
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
4.0.0 build 208111
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
Upgrade your powercli to the latest. I had the same issue until I updated...
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
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
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!
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.