VMware Cloud Community
DaddyDee10
Contributor
Contributor
Jump to solution

VMs by IP range, containing vCPU, vRAM, VMDK Info

I need to create a PowerCLI script, to find all VMs in a specific IP range (e.g. 172.26.x.x) within vCenter, containing the below:

  • vCPU data
  • vRAM data
  • VMDK data

This information will then been used in order to determine sufficient capacity as VMs reside on legacy hosts and so need to be migrated into a new cluster.

Any help would be very much appreciated?

0 Kudos
1 Solution

Accepted Solutions
MKguy
Virtuoso
Virtuoso
Jump to solution

You should be more specific about what exactly you want with vCPU/vRAM/VMDK "data".

Assuming you want basic inventory metrics, use something like this:

Get-VM | Where {$_.Guest.IPAddress -like '172.26.*'} | Select Name, NumCpu, MemoryGB, UsedSpaceGB | Format-Table -AutoSize
-- http://alpacapowered.wordpress.com

View solution in original post

0 Kudos
1 Reply
MKguy
Virtuoso
Virtuoso
Jump to solution

You should be more specific about what exactly you want with vCPU/vRAM/VMDK "data".

Assuming you want basic inventory metrics, use something like this:

Get-VM | Where {$_.Guest.IPAddress -like '172.26.*'} | Select Name, NumCpu, MemoryGB, UsedSpaceGB | Format-Table -AutoSize
-- http://alpacapowered.wordpress.com
0 Kudos