- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
find out if a harddisk has snapshots and whether its a virtual or physical RDM hard disk
Hi
How do I find out if a harddisk has snapshots and whether its a virtual or physical RDM?
$vhdds = $vm | get-harddisk
"find out each $vhdds has snapshots and whether its a virtual or physical RDM"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't think you can have snapshots of RDM disks, so not sure what exactly you mean ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry I didnt make it clear
First thing I want to do:
how do I check if the hard disk is a RDM?
$vhdds = $vm | get-harddisk
check each $vhdds if its a RDM
Second thing I want to do:
$vhdds = $vm | get-harddisk
check each $vhdds has a snapshot or not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The disktype can be deduced from the DiskType property
Get-VM | Get-HardDisk | select @{N="VM";E={$_.Parent.Name}},Name,DiskType
To test if the VMDK has a snapshot can be done by checking through a RegEx expression on the VMDK filename
Get-VM | Get-HardDisk | select @{N="VM";E={$_.Parent.Name}},Name,Filename,
@{N="Snapshotted";E={$_.Filename -match '-\d{6}.vmdk'}}
I included the Filename so you can see what is tested against.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference