VMware Cloud Community
free47
Contributor
Contributor

Find VM with specific diskUuid

Hey ppl! 

I need a script to find which VM has disk with "diskUuid": "52b3338c-ddb3-ab8a-1673-33603bf7fa9c"

Thank you :slightly_smiling_face:

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership

Try something like this

$target = '52b3338c-ddb3-ab8a-1673-33603bf7fa9c'

Get-VM | where{Get-Harddisk -VM $_ | Where{ $_.ExtensionData.Backing.Uuid -eq $target}} |
Select Name


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

Reply
0 Kudos
free47
Contributor
Contributor

That worked, thx :slightly_smiling_face: 

Actually i didn't describe my problem. 

I have "vSAN deamon liveness" error when Im trying to put some host in Maint. mode on my vsan stretch cluster.
After some troubleshooting I found out that some .vswp is responsible for this. Im trying to find out th VM of the .vswp file.

I have this from log:

"uuid": "f6da1c62-70ee-85d1-868e-9440c9bab25c",
"owner": "60dc4886-cfbd-fbef-964f-9440c9bbf224",
"health": "Healthy",
"revision": "184632",
"type": "DOM_OBJECT",
"flag": "2",
"minHostVersion": "3",
"md5sum": "ab9dd7df97c3a2b07ea749c24ca26e82",
"valueLen": "28120",



 

 

Reply
0 Kudos