0

Push Instant Clone Image using PowerCLI

In this post I will use PowerCLI to push an Instant Clone image to an existing Horizon Pool. Before we start we first have to download the VMware.HV.Helper module from https://github.com/vmware/PowerCLI-Example-Scripts/tree/master/Modules/VMware.Hv.Helper

As you can see this module contains a lot of commands. The actions in this blog only use a few of them!

First you have to connect to the Horizon Connection server where the pool exists. You can  do this using the credentials which are stored in the VICredentialStore. See here how to use the VICredentialStore https://roderikdeblock.com/powercli/

### Horizon Server ###
 
$HVServer = "Your HV Server" 
### Get Credentials ###
 
$HVUser = Get-VICredentialStoreItem -File "you location.xml" -host $HVServer
 
### Connect to Horizon View Server ### 

Connect-HVServer -Server $HVServer -User $HVUser.user -Password $HVUser.password

To push the image use the “Start-HVPool” command.

### Pool & Parent VM ###

$PoolName   = "Your Pool"
$ParentVM   = "Name of vm"
$SnapshotVM = "Name of Snapshot"

### Push the image ###

Start-HVPool -SchedulePushImage -Pool $PoolName -LogoffSetting WAIT_FOR_LOGOFF -ParentVM $ParentVM -SnapshotVM $SnapshotVM

### Disconnect HV Server ####

Disconnect-HVServer -Server $HVServer -Confirm:$false

Roderik de Block

Roderik de Block

Leave a Reply

Your email address will not be published. Required fields are marked *