rseekell
Enthusiast
Enthusiast

How to get Horizon pool details from PowerCLI

Jump to solution

I would like to run a PowerShell command to get a lot of details from all the pools on one screen.  On my previous post, he recommended a cmdlet called get-pool. However, on this latest CLI download: Download VMware PowerCLI 6.5 Release 1, there does not seem to be a get-pool available.  Did I download the wrong thing? 

Command to Display the pools with selected fields in table form:

Get-pool | select DisplayName,Pool_ID,Enabled,MinimumCount,MaximumCount,HeadroomCount,Persistence,Pooltype,Protocol | FT -AutoSize

1 Solution

Accepted Solutions
LucD
Leadership
Leadership

The Get-Pool cmdlet was present in the old View module.

In the more recent PowerCLI releases, the new HorizonView module gives you an interface to the Horizon View environment.

See Automating VMware Horizon 7 with VMware PowerCLI 6.5 for a quick intro.

Note that the VMware.VimAutomation.HorizonView module itself only has 3 cmdlets in there.

But the Horizon View people created a "helper" module, which wrapped several of the View API method in a function.

See the VMware.HV.Helper module (also mentioned in the blog post above).

And in that Helper module you will find functions like Get-HVPool, Get-HVPoolSummary...
Those are the ones you're probably looking for.


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

View solution in original post

8 Replies
LucD
Leadership
Leadership

The Get-Pool cmdlet was present in the old View module.

In the more recent PowerCLI releases, the new HorizonView module gives you an interface to the Horizon View environment.

See Automating VMware Horizon 7 with VMware PowerCLI 6.5 for a quick intro.

Note that the VMware.VimAutomation.HorizonView module itself only has 3 cmdlets in there.

But the Horizon View people created a "helper" module, which wrapped several of the View API method in a function.

See the VMware.HV.Helper module (also mentioned in the blog post above).

And in that Helper module you will find functions like Get-HVPool, Get-HVPoolSummary...
Those are the ones you're probably looking for.


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

View solution in original post

rseekell
Enthusiast
Enthusiast

Thank you! This is what I'm trying to find.

However, when I try to get the Current Image (parent and snapshot names) or Cluster of a pool, then it comes out as this crazy long ID string, and I cannot match it to anything in my vCenter.  How would I get the name of the parent, snapshot, and cluster that a pool uses?

Example:

$pool000 = get-hvpool -PoolName VMH-10x64-IC

$pool000.AutomatedDesktopData.VirtualCenterProvisioningSettings.VirtualCenterProvisioningData.HostOrCluster

0 Kudos
agalliasistju
Enthusiast
Enthusiast

rseekell​ did you ever get what you were looking for?  Specifically the name of the parent VM and the Snapshot name?  I'm also trying to get this info.

0 Kudos
agalliasistju
Enthusiast
Enthusiast

rseekell​ did you ever get what you were looking for?  Specifically the name of the parent VM and the Snapshot name?  I'm also trying to get this info.

0 Kudos
MikeimusPrime
Contributor
Contributor

I can help with this, there might be other ways, but here's what I use to get this info

$pool = Get-HVPool -PoolName <Name>

This will get you the path of the gold image

$pool.AutomatedDesktopData.VirtualCenterNamesData.ParentVmPath

This will get you the path to the snapshot

$pool.AutomatedDesktopData.VirtualCenterNamesData.SnapshotPath

Now, if you just want the currently in use snapshot and parent VM (and don't want the full path), you can do the following

$pool.AutomatedDesktopData.VirtualCenterNamesData.ParentVmPath.substring(($pool.AutomatedDesktopData.VirtualCenterNamesData.ParentVmPath.LastIndexOf("/")+1))

$pool.AutomatedDesktopData.VirtualCenterNamesData.SnapshotPath.substring(($pool.AutomatedDesktopData.VirtualCenterNamesData.SnapshotPath.LastIndexOf("/")+1))

That will trim everything before (and including) the last '/' in the path.

agalliasistju
Enthusiast
Enthusiast

This will get you the path of the gold image

$pool.AutomatedDesktopData.VirtualCenterNamesData.ParentVmPath

This is the info I needed. Thanks!

0 Kudos
antonpaloka
Contributor
Contributor

Is there a way to get this info per desktop? For example, if I want to check across all my pools and ensure all desktops received the intended image?

0 Kudos
dzak64
Enthusiast
Enthusiast

Did you find a solution?

0 Kudos