Shutdown vSAN Cluster with Horizon Instant Clones

In previous versions of vSphere it has been necessary to run CLI commands or edit host config to remove parent VMs (for instant clones) before shutting down a cluster. This is not required in ESXi 6.7 so the process has become a little easier.

Here is a bare bones process that I use to cleanly shut down then startup a vSAN cluster running instant clones (tested with Horizon 7.7/ESXi 6.7 u1). In this instance, the vCenter appliance is also running on the cluster so this will add some extra steps to the process.

**I have also included a few powercli and ESXCLI commands that might be of assistance**

Site Shutdown

  • Disable Desktop Pools – Right Click and disable
  • Ensure no connections to the desktop pools – Remove All active connections from Horizon Admin Console
  • Set max desktops to 1 for each pool – Allow desktops delete from Cluster
  • Disable Provisioning for vCenter – Do from Horizon Admin Console
  • Shut Down any persistent desktops and remaining parent VMs – From vCenter client
  • Shut Down Composer Server if using linked clones
  • Shut Down Connection Servers
  • Shut Down remaining powered on VMs/Appliances on the cluster bar vCenter (if on the cluster)
    • Get-VM <Vmname> | Shutdown-VMGuest
  • Verify that all resynchronization tasks are complete.
    Click the Monitor tab > select vSAN > Resyncing Objects
    • Get-VsanResyncingComponent -cluster <clustername>
  • Power off the vCenter Server VM.
    The vSphere Client becomes unavailable –
    • Get-VM <Vmname> | Shutdown-VMGuest
  • Place the ESXi hosts in maintenance mode. – Connect to the host and use the host client or esxcli command to place the host into maintenance mode with no data migration (no action). –
    • esxcli system maintenanceMode set -e true -m noAction
    • Get-VMHost <VMHost> | Set-VMHost -State Maintenance –                VsanDataMigrationMode NoDataMigration

**This should automatically delete any IC parent VMs**

  • Power off the hosts after they have successfully entered maintenance mode and removed IC parent VMs –
    • esxcli system shutdown poweroff –reason “Planned Shutdown”
    • Get-VMHost | Stop-VMhost

Site Startup

  • Power on the Site ESXi hosts.

On the physical box where ESXi is installed, press the power button or use remote Management. 

The ESXi host starts then locates its VMs, and functions normally.

After powering on the hosts, the vSAN cluster is automatically recreated.
Any misconfiguration status message (if you did not make network configuration changes and the vSAN cluster was working as expected before you shut down) can be ignored. The message disappears after at least three hosts join the cluster.

  • Take the hosts out of maintenance mode.

Connect to the host and use the host client GUI or esxcli command to take the host out of maintenance mode.

esxcli system maintenanceMode set –enable false

Get-VMHost <VMHost> | Set-VMHost -State Connected

  • Start the site VMs in the following order
    • vCenter
    • SQL Server (Composer ad EventDB)
    • Composer Server (if using linked clones)
    • Connection Servers
    • Get-VM <VMname> | start-vm

When the Services are available and the Horizon Console springs into life

  • Enable vCenter Provisioning
  • Change Pool Settings back to original values – Set max number of desktops back to original
  • Power on any persistent desktops

Parent VMs and IC desktops should then be powered on/recreated/provisioned (this may well take a few minutes for this to happen depending on the environment).

  • Enable Desktop Pools
Share

You may also like...

2 Responses

  1. Hameed says:

    Hi,

    Thanks for the detailed steps, just have one query

    What should we do with the 1 VM that will be pending per Pool after making the below setting change:

    Set max desktops to 1 for each pool – Allow desktops delete from Cluster

    Unless we remove all the VM’s we won’t be able to shut down the Host, right ?

Leave a Reply to cjt Cancel reply

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