VMware Cloud Community
LucD
Leadership
Leadership

Get-View does not work on HardDiskImpl object

The Get-View cmdlet gives an error on a HardDiskImpl object.

$hdImpl = Get-HardDisk -VM (Get-VM -Name <VM-name>)
$hd = Get-View $hdImpl.ID

The message you get is

Get-View : The request refers to an object that no longer exists or has never existed.

This is perhaps caused by the "special" layout of the ID field in the HardDiskImpl object.

Example: VirtualMachine-vm-52/2000


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

0 Kudos
2 Replies
halr9000
Commander
Commander

The way I understand it, this is because HardDiskImpl is a data object , not a managed object.

: http://www.vmware.com/support/developer/vc-sdk/visdk25pubs/ReferenceGuide/do-types-landing.html

I'm not 100% sure of this and I don't know about workarounds.

Hal Rottenberg

Co-Host, PowerScripting Podcast (http://powerscripting.net)

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
admin
Immortal
Immortal

Correct. There are no workarounds.