VMware Cloud Community
rseekell
Enthusiast
Enthusiast
Jump to solution

How to get Horizon pool details from PowerCLI

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
Jump to solution

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
Jump to solution

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

rseekell
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
agalliasistju
Enthusiast
Enthusiast
Jump to solution

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.

Reply
0 Kudos
agalliasistju
Enthusiast
Enthusiast
Jump to solution

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.

Reply
0 Kudos
MikeimusPrime
Contributor
Contributor
Jump to solution

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
Jump to solution

This will get you the path of the gold image

$pool.AutomatedDesktopData.VirtualCenterNamesData.ParentVmPath

This is the info I needed. Thanks!

Reply
0 Kudos
antonpaloka
Enthusiast
Enthusiast
Jump to solution

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?

Reply
0 Kudos
dzak64
Enthusiast
Enthusiast
Jump to solution

Did you find a solution?

Reply
0 Kudos