Using View PowerCLI to prepare for a VMware Horizon View 6 upgrade

In a few weeks, I will be upgrading my employer’s VMware Horizon View environment from version 5.2 to version 6.0.

Some of the steps in the Preparing vCenter Server and View Composer for an Upgrade documentation are rather repetitive. Here are my notes on how I might perform these steps via View PowerCLI.

View PowerCLI Cmdlets

Be sure to use Get-Help to discover and read about VMware Horizion View 5.2 commandlets. For an HTML version, see View PowerCLI Cmdlets.

Preparing vCenter Server and View Composer for an Upgrade

For this blog entry, I will be focusing on steps 11 and 12 of Preparing vCenter Server and View Composer for an Upgrade.

Step 11) Disable Provisioning

This step says “For all linked-clone desktop pools, use View Administrator to disable provisioning of new virtual machines. Because View Composer might be upgraded during a different maintenance window than its desktop pools, provisioning must be postponed until both components are upgraded.”

via VMware Horizon View Administrator

Here’s how to make the change via the web interface.

Option 1: Disable Provisioning at the vCenter Server level View Admin > View Configuration > Servers > vCenter Servers > select one or more vCenter Servers > Disable Provisioning

Option 2: Disable Provisioning at the Desktop Pool level View Admin > Inventory > Pools > select one or more Desktop Pools > Status > Disable Provisioning

via View PowerCLI

The only option I could discover was to disable provisioning at the Desktop Pool level.

Get-Help Update-AutomaticLinkedClonePool says the following about isProvioningEnabled: “Whether to enable provisioning for this pool.”

Display a table of all desktop pools, showing Pool_ID and if Provisioning is Enabled (true) or Disabled (false) Get-Pool | Format-Table Pool_ID,ProvisionEnabled -AutoSize

Disable provisioning for all desktop pools (before the upgrade) Get-Pool | Update-AutomaticLinkedClonePool -isProvisioningEnabled:$false

Enable provisioning for all desktop pools (after the upgrade) Get-Pool | Update-AutomaticLinkedClonePool -isProvisioningEnabled:$true

Step 12) Disable Refresh OS Disk on Logoff

This step says “If any desktop pools are set to refresh the OS disk on logoff, use View Administrator to edit the Desktop/Pools settings for that pool and set Refresh OS disk on logoff to Never. This setting prevents an error from occurring when the newly upgraded View Composer attempts to refresh a desktop on which View Agent has not yet been upgraded.”

via VMware Horizon View Administrator

Here’s how to make the change via the web interface. View Admin > Inventory > Pools > select one desktop pool > Edit > Pool Settings > Remote Settings > Delete or refresh desktop on logoff> set to Never

via View PowerCLI

If you have a lot of desktop linked-clone pools, View PowerCLI will make it easier to change them all at the same time. The process of deleting or refreshing desktops on logoff should be configured only for non-persistent linked-clone desktop pools.

Get-Help Update-AutomaticLinkedClonePool says the following about DeletePolicy: “Delete or refresh desktop on logoff. Can be ‘Default’, ‘DeleteOnUse’, or ‘RefreshOnUse’. Not applicable for Persistent (dedicated) pools.”

Display a table of all non-persistent linked-clone desktop pools, showing Pool_ID and DeletePolicy Get-Pool -PoolType SviNonPersistent | Format-Table Pool_ID,DeletePolicy -AutoSize

Change all non-persistent linked-clone desktop pools DeletePolicy to Default (before the upgrade) Get-Pool -PoolType SviNonPersistent | Where-Object {$_.DeletePolicy -ne "Default"} | Update-AutomaticLinkedClonePool -DeletePolicy Default

Change all non-persistent linked-clone desktop pools DeletePolicy to RefreshOnUse (after the upgrade) Get-Pool -PoolType SviNonPersistent | Where-Object {$_.DeletePolicy -ne "RefreshOnUse"} | Update-AutomaticLinkedClonePool -DeletePolicy RefreshOnUse

Step 13) Cancel Refresh/Recompose Tasks

This step says “If any desktop pools are scheduled to do a refresh or recompose operation, use View Administrator to cancel these tasks.”

via VMware Horizon View Administrator

Here’s how to make the change via the web interface. View Admin > Inventory > Pools > select one desktop pool > Tasks > select tasks > select Cancel Task

via View PowerCLI

Unfortunately, I could not figure out a way to Get or Update the Tasks of one or more desktop pools. It appears a View PowerCLI Cmdlet for this functionality is not present in VMware View PowerCLI version 5.2. If you know of a way, please let me know.