VMware Cloud Community
Uridium454
Enthusiast
Enthusiast

Get-SpbmStoragePolicy error "Object reference not set to an instance of an object"

I recently stumbled across an issue in which attempting to run the PowerCLI command Get-SpbmStoragePolicy resulted in the error "Object reference not set to an instance of an object."  After a fair amount of digging around, I ran into Kruddy's comment on an issue with Get-SpbmStoragePolicy taking quite a long time to run with zero results.  Kruddy suggested checking for tags with no category set as this would cause unexpected behavior when attempting to use commands referencing tags.  After checking for tags such as these using the command given Get-Tag | Where {$_.Category -eq $null}, I found several in this very state (SRM orphaned tags).  After removing these, the Get-SpbmStoragePolicy command and other associated storage policy commands started working without any further issue.

Link to referenced comment - Re: Get-SpbmStoragepolicy and vCenter 6.5

Command used - Get-Tag | Where {$_.Category -eq $null}

I hope this helps with anyone having a similar issue.

Reply
0 Kudos
0 Replies