VMware Cloud Community
Jneagle
Enthusiast
Enthusiast
Jump to solution

Creating linked clone pool from PowerCLI - adding missing parameters to script?

Let me mention that I've never used PowerCLI before, but I am familiar with PowerShell. If it matters, this is all in context of VMware View 6.2.2.

In doing research for another issue, I found that PowerCLI allows you to automate pool creation. Great! More digging found the basics of how to go about getting that done, but the parameters given were sparse. Even more diffing found that Get-Pool gives me a ton of info on all of my pools; 58 columns worth of data per pool. I'm not sure all of that is needed in pool creation, but I know that some of it is very pertinent to our environment.

My first question is: Am I limited to the few parameters given in the example? They are:

Get-ViewVC -serverName servername| Get-ComposerDomain -domain domainname | Add-AutomaticLinkedClonePool

-pool_id H-VDI-HVAC

-displayName "H-VDI-HVAC"

-namePrefix "H-VDI-HVAC-{n:fixed=2}"

-parentVMPath /Location/vm/Masters/Labs/H-VM-VT2

-parentSnapshotPath /9-28-18/9-28-18-2

-vmFolderPath /Location/vm/Discovered virtual machine/H-VDI-HVAC

-resourcePoolPath /Location/host/Servers/Resources

-datastoreSpecs [Aggressive,OS,data]/Location/host/Servers/VM-VDI-3 

-minimumCount 2

-maximumCount 2

I'd like to add the following parameters. Can they be added after maximumCount, or do they have specific places?

-enabled TRUE

-multiSessionAllowed TRUE

-userResetAllowed FALSE

-assignOnFirstLogon TRUE

-desktopSource SVI

-powerPolicy AlwaysOn

-refreshPolicy type=Never;

-uservSphereMode TRUE

-organizationalUnit OU=VDI

-networkLabelSpecs disabled

-UseSeSparseFormat TRUE

-seSparseThreshold 0

-useVSAN FALSE

-provisionEnabled TRUE

-provisionSuspendOnError TRUE

-postProvisionState READY

-startClone TRUE

-calculatedValues FALSE

-deletePolicy Default

-headroomCount 1

-persistence NonPersistent

-autoLogoffTime Immediately

-poolType SviNonPersistent

-protocol PCOIP

-allowProtocolOverride FALSE

-flashQualityLevel NO_CONTROL

-flashThrottlingLevel DISABLED

Am I missing any parameter to make this work? And lastly, every example I saw lists parentSnapshotPath, however, Get-Pool lists it as parentVMSnapshotPath. Which is correct when creating a pool?

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

I'm afraid I'm not running those old Horizon cmdlets anymore.

But can you do

Get-Command -Name Add-AutomaticLinkedClonePool -Syntax

that should show you all the available parameters on the cmdlet.
And

Get-Help -Name Add-AutomaticLinkedClonePool -Full

should show you the Help page for the cmdlet.


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

View solution in original post

0 Kudos
7 Replies
LucD
Leadership
Leadership
Jump to solution

It looks like you are using the somewhat older PowerCLI PSSnapin that can only work on one of the Connection Servers.
Is that correct?

With the latest PowerCLI version, the View cmdlets can be run from anywhere.
And there is a VMware.HV.Helper module that helps with providing cmdlets for the newer Horizon module that comes with PowerCLI.

Alan did a post on how to work with this newer module, see GETTING STARTED WITH POWERCLI 6.5 AND HORIZON VIEW


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

0 Kudos
Jneagle
Enthusiast
Enthusiast
Jump to solution

Well, I followed this - https://blogs.vmware.com/PowerCLI/2017/08/finding-powercli-version.html - in an attempt to tell you what version of PowerCLI I'm on, but none of the commands return anything. However, I have only one Connection server at my physical location. For the time being, that is all I'm concerned about.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I assume you did those commands on the Connection Server?

The newer PowerCLI versions are installed on any workstation, not the Connection Server.

From there you connect to the Connection Server.

Normally you should avoid running scripts on production servers.

See Welcome PowerCLI to the PowerShell Gallery – Install Process Updates on how to do that.


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

0 Kudos
Jneagle
Enthusiast
Enthusiast
Jump to solution

Yes, I ran those commands from the Connection server.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I'm afraid I'm not running those old Horizon cmdlets anymore.

But can you do

Get-Command -Name Add-AutomaticLinkedClonePool -Syntax

that should show you all the available parameters on the cmdlet.
And

Get-Help -Name Add-AutomaticLinkedClonePool -Full

should show you the Help page for the cmdlet.


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

0 Kudos
Jneagle
Enthusiast
Enthusiast
Jump to solution

Yes! The second command was most helpful! Marked as answered.

That being said, there are parameters that are still missing, which is a bummer. I assume from your previous comments that I need to update PowerCLI. Can you point me in a direction of a good how to? Would updating PowerCLI adversely effect anything else if they weren't updated as well?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

In fact you wouldn't be updating anything on the Connection Server.
You can still use that as a fall-back.

The PowerCLI modules can be installed on any workstation that has PowerShell.

Preferably that should be PowerShell 5.1 (check with $PSVersionTable).

I linked to a blog post on the installation process in previous reply in this thread.

On missing properties, some of the properties that are displayed with a Get- cmdlet, will not necessarily be available as parameters on the cmdlet to create a pool.

Also note that the newer Horizon module is provided with a limited set of cmdlets. See Getting Started with PowerCLI for Horizon View for an intro.

But they do give you access to the full Horizon API.

Note that PowerCLI currently is already on version 10.2.0, and is completely build on modules, no more PSSnapin.

There is a community module, VMware.HV.Helper that wraps a number of these API methods in functions you can call.

Perhaps first have a look at the available functions, if the ones you are looking for are in there.


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

0 Kudos