VMware Cloud Community
MRoushdy
Hot Shot
Hot Shot
Jump to solution

Count vDisks and vNics

Hello,

is it possible to generate a report that indicates the count of VMDKs and vNics in a VM?

vEXPERT - VCAP-DCV - Blog: arabitnetwork.com | YouTube: youtube.com/c/MohamedRoushdy
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try something like this

Get-VM |

Select Name,

    @{N='vDisk';E={($_.ExtensionData.Config.Hardware.Device | where{$_ -is [VMware.Vim.VirtualDisk]}).Count}},

    @{N='vNIC';E={($_.ExtensionData.Config.Hardware.Device | where{$_ -is [VMware.Vim.VirtualEthernetCard]}).Count}}


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

View solution in original post

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Try something like this

Get-VM |

Select Name,

    @{N='vDisk';E={($_.ExtensionData.Config.Hardware.Device | where{$_ -is [VMware.Vim.VirtualDisk]}).Count}},

    @{N='vNIC';E={($_.ExtensionData.Config.Hardware.Device | where{$_ -is [VMware.Vim.VirtualEthernetCard]}).Count}}


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

Reply
0 Kudos
MRoushdy
Hot Shot
Hot Shot
Jump to solution

Sweet. Thank you,

vEXPERT - VCAP-DCV - Blog: arabitnetwork.com | YouTube: youtube.com/c/MohamedRoushdy
Reply
0 Kudos