VMware {code} Community
sbwick
Contributor
Contributor

get-scsilun problem

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

0 Kudos
5 Replies
lamw
Community Manager
Community Manager

I know there were some changes to the cmdlets in PowerCLI 4.0u1, you might want to pose your question in the PowerCLI forums, there are some gurus there that can definitely give you the answer and the reason why, I'm sure it's a small syntax that you're missing.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
catkinso
Contributor
Contributor

Did you find a resolution to this? I'm having the same problem against our VCenter and our older VirtualCenter VC's.

Thanks,

0 Kudos
catkinso
Contributor
Contributor

I think this is a bug. It appears this command will now only work on ESX 4 hosts. Every ESX 4 host under vCenter 4 build 208111 works every ESX 3.5 host gets that error.

0 Kudos
catkinso
Contributor
Contributor

Upgrading to the latest powercli fixed this issue for me.

0 Kudos
sbwick
Contributor
Contributor

I'm using powerCLI version 4.0 U1 build 208462 is that not the latest version?

From vmware downloads:

"Latest Released Version: 4.0.1 | 11/19/09 | 208462"

0 Kudos