VMware Cloud Community
JohnMcKeown
Enthusiast
Enthusiast
Jump to solution

List vms in Resource pools

Hi Guys.

Has anybody got a good way of listing VMs via resource pool? I am not sure if I should do something like:

Get-VM | Get-View and drill down until I get the resource pool. But usually It lists the resource pool ID

Or is there a better way?

Thanks

John    

0 Kudos
1 Solution

Accepted Solutions
JohnMcKeown
Enthusiast
Enthusiast
Jump to solution

Thanks kunaludapi

Its just a slow day for me, I forgot that you can just

Get-VM | Select Name, Parent.

Since the thread is open, is there another way round. List vms in a resource pool.     

View solution in original post

0 Kudos
5 Replies
kunaludapi
Expert
Expert
Jump to solution

get-vm | select name, @{n="ResourcePool"; e={$_ | Get-ResourcePool}}

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
JohnMcKeown
Enthusiast
Enthusiast
Jump to solution

Thanks kunaludapi

Its just a slow day for me, I forgot that you can just

Get-VM | Select Name, Parent.

Since the thread is open, is there another way round. List vms in a resource pool.     

0 Kudos
kunaludapi
Expert
Expert
Jump to solution

Get-VM | Select Name, ResourcePool

--------------------------------------------------------------- Kunal Udapi Sr. System Architect (Virtualization, Networking And Storage) http://vcloud-lab.com http://kunaludapi.blogspot.com VMWare vExpert 2014, 2015, 2016 If you found this or other information useful, please consider awarding points for "Correct" or "Helpful".
0 Kudos
RvdNieuwendijk
Leadership
Leadership
Jump to solution

If you want to retrieve the VM's in a specific resourcepool, you can use the command from the following example, that lists all of the VM's in resoucepool rp1:

Get-ResourcePool -Name rp1 | Get-VM

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
rsoc
Enthusiast
Enthusiast
Jump to solution

RvdNieuwendijk wrote:

If you want to retrieve the VM's in a specific resourcepool, you can use the command from the following example, that lists all of the VM's in resoucepool rp1:

Get-ResourcePool -Name rp1 | Get-VM

This is the correct way to get all of the VMs from a particular resource pool.

0 Kudos