https://docs.vmware.com/en/VMware-Horizon-7/7.13/virtual-desktops/GUID-7C5BB17B-D239-4779-B2CA-B9AD9C72CDB7.html

You can perform maintenance on hosts where instant clones reside by putting the ESXi hosts into maintenance mode. Then you can use vSphere Web Client to put the ESXi host into maintenance mode.

In most cases, using instant clones does not change your operational flow of how you perform ESXi host maintenance tasks. Horizon 7 will automatically delete the instant clone parentVMs to alllow the ESXi host to go into maintenance mode. When you use VMware Update Manager, an extra step is required.

If you use VMware Update Manager to update your ESXi hosts, you must delete or disable the instant clone parentVM before VMware Update Manager can successfully update the ESXi hosts. If you use an older version of Horizon 7 (7.12 or earlier), you must manually delete the instant clone parentVM on all the ESXi hosts by using the instant-clone utilities. To use the instant-clone utilities, see Instant-Clone Maintenance Utilities.

Starting with Horizon 7 version 7.13, you can globally disable all of the instant clone parentVMs in a vCenter so that VMware Update Manager can update the ESXi hosts in that vCenter. If you disable parentVM setting for a vCenter, Horizon 7 will automatically delete all the parentVMs on every single host in that vCenter, so that the hosts can go into maintenance mode without any manual intervention. Deleting the parentVM does not impact the operations of instant clones as Horizon 7 can create instant clones with or without parentVMs.

To selectively disable parentVMs for certain clusters only rather than the entire vCenter, see the KB article 80369. If you leave the parentVM setting for the vCenter disabled, any new instant clones are then provisioned without parentVMs. If you want Horizon 7to use parentVMs when creating instant clones, then you can re-enable the parentVM setting for the vCenter after VMware Update Manager completes host maintenance. You must disable the parentVM for the vCenter before every update event.
Note:If you use VMware Update Manager, keep the instant clone parentVMs disabled for your vCenter to simplify your ESXi maintenance.

Procedure

  1. In Horizon Console, select Settings > Servers.
  2. Select the server from the list, click More and select Disable ParentVMs.
  3. Log in to vSphere Web Client.
  4. Select the ESXi host that you want to put into maintenance and click Maintenance Mode > Enter Maintenance Mode.


https://docs.vmware.com/en/VMware-Horizon-7/7.13/virtual-desktops/GUID-6025D684-2E05-4857-9C24-18F16DDC38FD.html#GUID-6025D684-2E05-4857-9C24-18F16DDC38FD


Instant-Clone Maintenance Utilities 


On the Connection Server are three utilities that you can use for the maintenance of instant-clone VMs in vCenter Server and the clusters that the VMs are in.

The utilities are IcMaint.cmdIcUnprotect.cmd, and IcCleanup.cmd and are located in C:\Program Files\VMware\VMware View\Server\tools\bin.

IcMaint.cmd

This command deletes the golden images, which are the parentVMs in vCenter Server from the ESXi host so that the host can be put into maintenance mode. The host is not automatically put into maintenance mode. To perform maintenance on the host, the vCenter Server administrator must manually put the host into maintenance mode.

Syntax:

IcMaint.cmd -vc hostname_or_IP_address -uid user_ID -hostName ESXi_hostname -maintenance ON|OFF

Parameters:

  • -vc host name or IP address of vCenter Server
  • -uid vCenter Server user ID
  • -hostname ESXi host name
  • -maintenance ON|OFF

    This parameter specifies whether the host is available for hosting the golden image VM.

    After the command is run on the host, the InstantClone.Maintenance annotation value is set to 1 and the golden image VMs are deleted. After the golden image VMs are deleted, the InstantClone.Maintenance annotation value is set to 2 and no more golden image VMs are created on the host. When you run this command again with -maintenance OFF, the InstantClone.Maintenance annotation value is cleared for the host to become available for hosting golden image VMs.

All the parameters are required.

IcUnprotect.cmd

After ClonePrep creates folders and VMs, you can use this utility to unprotect folders and VMs, delete VMs, and detect VMs whose golden image or snapshot is deleted. ClonePrep is the mechanism that customizes instant clones during the creation process.

Note:An internal service for instant clones that runs during instant clone operations, detects if any internal folders need to be reprotected. If these folders are not empty then the service automatically protects the folders again.

Syntax:

IcUnprotect.cmd -vc hostname_or_IP_address -uid user_ID [-includeFolders][-skipCertVeri]

Parameters:

  • -action

    You can use the following options for this parameter:

    • unprotect. Unprotect internal VMs.
    • delete. Delete internal VMs.
    • detect. Detect and list internal VMs whose golden image or snapshot is deleted.
  • If you don't specify the -action parameter, the internal VMs are unprotected by default.

  • -vc host name or IP address of vCenter Server
  • -uid vCenter Server user ID
  • -clientId instant-clone client ID(Optional)

    If clientId is not specified, protection is removed from all ClonePrep VMs in all data centers.

  • -domain domain name(Optional)

    You can use multiple domain names separated by comma and no space.

  • -host host name(Optional)

    You can use multiple host names separated by comma and no space.

  • -datastore datastore name(Optional)

    You can use multiple datastore names separated by comma and no space.

  • -vmName VM name(Optional)

    You can use multiple VM names separated by comma and no space.

  • -vmType internal VM type(Optional)

    You can use multiple VM types separated by comma and no space. You can use template, replica, parent as options for this parameter.

  • -includeFolders include folders

    This parameter unprotects the folders in addition to the VMs.

  • -skipCertVeri skip certification verification

    IcUnprotect.cmd enforces host name verification. You must enter the correct host name of the vCenter Server instead of its IP address when you specify the command parameters. To disable host name verification and use the IP address of vCenter Server instead, use -skipCertVeri.

Specify the following parameters to delete all parentVMs in vCenter Server:

IcUnprotect -action delete -vc <IP address of vCenter Server> -uid <vCenter Server user ID> -clientId <instant clone client ID> -host <hostname 1>,<hostname 2> -vmType parent

Specify the following parameters to delete specific parentVMs in vCenter Server:

IcUnprotect -action delete -vc <IP address of vCenter Server> -uid <vCenter Server user ID> -clientId <instant clone client ID> -host <hostname 1>,<hostname 2> -vmType parent -vmName <parentVM name 1>,< parentVM name 2>

IcCleanup.cmd

You can use this utility to unprotect and delete some or all of the internal VMs created by instant clones. This utility also provides a list command to group internal VMs into the hierarchical structure according to their golden VM and the snapshot used to create the instant clone pool. The list command has a detect option which only reveals the internal VM groups with priming tag or snapshot missing. You can then unprotect and delete a specific group or all of these groups. You can also output all the groups into a disk file for future reference.

Syntax:

iccleanup.cmd -vc vcName -uid userId [-skipCertVeri] [-clientId clientUuid]

Parameters:

  • -vc host name or IP address of vCenter Server
  • -uid vCenter Server user ID
  • -skipCertVeri Skip the vCenter Server certificate verification (Optional)
  • -clientId Client UUID, the unique ID for the server cluster made up of Connection Server and one or more replica servers. (Optional)
    Note:To find the client UUID, log into Connection Server or any of the replica servers, run ADSI Edit. In DC=vdi, dc=vmware, dc=int > OU=Properties > OU=Global > CN=Common, find the value for pae-GUID, which is the value for the client UUID. If you do not specify the client UUID, the cleanup tool will deal with all the internal VMs. If you specify the client UUID, the cleanup tool will deal with only the internal VMs that belong to that particular client UUID.
Commands:
  • listList some or all the internal VMs and present them in a hierarchical structure, also known as internal VM groups. Options include:
    • -all List all the internal VM groups
    • -D,--detect Detect mode lists only the internal VM groups with missing priming tag or snapshot
    • -h,--help Print the available usage and options for this command
  • After you run the list command, you can see qualified internal VMs presented in a hierarchical structure known as internal VM groups. For these internal VM groups, you can run these commands:

    • unprotectUnprotect some or all the internal VM groups using these options:
      • -all Unprotect all the internal VMs. Without the -I option, you must specify -all to unprotect all the internal VM groups
      • -I,--index Unprotect a certain internal VM group
      • -h,--help Print the available usage and options for this command
    • delete Delete some or all the internal VM groups
    • outputOutput the internal VM groups into a disk file.
      • -F,--file File name to save the internal VM groups
      • -h,--help Print the available usage and options for this command
    • back Return to the main menu
  • unprotectunprotect some or all the internal VMs, including folders. Options include:
    • -A,--adDomain Domain name
    • -H,--host Host name
    • -D,--datastore Datastore name
    • -T,--vmType Internal VM type: template, replica, or parent
    • -N,--name Internal VM name
    • -I,--includeFolders Include the internal VM folders
    • -all Unprotect all the internal VMs
    • -h,--help Print the available usage and options for this command
  • deletedelete some or all internal VMs, including folders. Options include:
    • -A,--adDomain Domain name
    • -H,--host Host name
    • -D,--datastore Datastore name
    • -T,--vmType Internal VM type: template, replica, or parent
    • -N,--name Internal VM name
    • -I,--includeFolders Include the internal VM folders
    • -all Delete all the internal VMs
    • -h,--help Print the available usage and options for this command
  • exit Log off vCenter Server and quit the program

https://kb.vmware.com/s/article/2144808

Entering and exiting maintenance mode for an ESXi host that has Horizon instant clones (2144808)

Instant clone creation requires that parent VMs are created on all hosts in the selected cluster. The parent VMs are tied to the host they are on and cannot be migrated through the vSphere client. This prevents the host from entering maintenance mode if initiated from the vSphere client.

Note that with Horizon 7.1 and later this issue does not occur. When you put the host in maintenance mode, vSphere will remove the instant clone VMs. However, the exception is VMware Update Manager is used to update hosts, in which case, the manual steps described in this KB still applies.
 Solution
You can use either of the following methods to put a host in and out of maintenance mode.

Method 1. From vSphere Client
  1. Select the host that you want to put in maintenance mode. If you are using the vSphere web client, make sure that the plug-in to edit Annotations is installed.
  2. Look up Annotations in the host's Summary tab and set InstantClone.Maintenance to 1.
  3. Wait up to 3 minutes and the parent VMs on this host will be deleted. Also, the value for InstantClone.Maintenance will change to 2.
  4. Put the host in maintenance mode. This host will no longer be used for provisioning.
  5. Perform maintenance.
  6. Take the host out of maintenance mode.
  7. Clear the InstantClone.Maintenance annotation value.
  8. As new provisioning happens, parent VMs and then instant clones will be created on this host.
Method 2. From Connection Server
  1. From the Connection Server, run IcMaint.cmd to delete the parent VMs and put the host in maintenance mode. See  The syntax is:

https://docs.vmware.com/en/VMware-Horizon-7/7.0/com.vmware.horizon-view.desktops.doc/GUID-6025D684-2E05-4857-9C24-18F16DDC38FD.html
-vc host name or IP address of vCenter Server -uid vCenter Server user ID-hostname  ESXi host name-maintenance ON|OFF