Pages

Friday, February 02, 2018

For a
customer PoT, I had the challenge to automate the rollout of a new Horizon View
environment with an initial set of functionality like adding a vCenter, and
provision an initial Pool and additional tasks like:

·Scale-Up: Change the Pool size

·Scale-Out: Add an additional vCenter
and create a new Pool on the second vCenter

I want to
share the scripts I’ve created to do so, but with the note, that they are not
bullet proof and in an absolute PoT character J

For the
installation, the following binaries have to be stored in the C:\TEMP directory
of the VM where you want to install Horizon:

The first
thing we need to do, is to enable interactive sessions on the VM, unfortunately
the PowerCLI installation will only work interactively because we cannot get
rid of an annoying window which opens during installation. So run the following
script on the VM to set the VMware Tools service to allow interactive sessions:

Now we need
to restart the VMware Tools or what I did, restart the whole server and wait
until the VMware Tools are up and running again.

Next step
is to run the installation of Horizon View. We run now the installation of our
two binaries with the following script interactively (you need to replace the admin
SID with an SID valid for your environment. I’ve used an domain account that’s
why I specified the admin SID here):

Again we
need to restart the VM, because otherwise when starting PowerShell we cannot access
the fresh installed PowerShell modules.

Now we have
an installed Horizon View environment, but nothing configured so far. We start
now with the configuration. In my case I’ve started adding an AD user group
which will get entitled to the new Pool we create. I’ve used the build-in vRO
workflow: “Create a user group in an organizational unit”. Next step was to
entitle the AD administrative account locally on the VM, so we need to run this
bash script to entitle the user to the local Administrators:

NET LOCALGROUP Administrators hv-admin@domain.com
/ADD

Next step
is to install the Horizon View license. Therefore we run the following script:

Now we go
and install the vCenter certificate to the VM, so we can add the vCenter to
Horizon View using the Horizon View Administrator user account. To do so, run
the following script (I’m sure there is a better way to do so but I was not
sure where to import the certificate so I was importing it in nearly every
certificate store J):