EHC 4.1: ESXi Host Migration Process (vCenter Host Migration with ViPR Export Groups)

This procedure details the steps to execute in order to remove an ESXi host from a source ViPR Export Group and add to an existing target Export Group.

Note: this procedure applies to ViPR 3.0 and below, ViPR 3.6 introduces a more automated procedure which I intend to cover in a future post.

Host Removal – remove ESXi Host from a ViPR Export Group

Please ensure there are no EHC StaaS or VIPR native tasks being executed while performing the following procedure.

Note: Ensure the version of SMI-S complies with the EHC ESSM stated version.

The following steps detail the procedure for removing a host from a vSphere ESXi cluster in vCenter and utilizing the ViPR CLI to remove the same host from the cluster Export Group.

  1. Ensure ‘Auto-Exports’ is disabled for all Clusters in VIPR, this step is critical else the host removal and add process detailed below will fail. Login to ViPR UI as ‘root’, navigate to ‘Physical -> Clusters’ click on the cluster name and untick ‘Auto-Exports’.ViPRRemoveHost1
  2. Login to vCenter, right click the ESXi host you plan on moving and click the option to set the ESXi host to ‘maintenance mode’.ViPRRemoveHost2
  3. Move the host out of the source cluster and into the desired target cluster.ViPRRemoveHost3
  4. ‘Unmount’ and ‘Detach’ the ViPR provisioned datastores associated with the host which has been removed from the source cluster, namely ‘drm-esxi084.infra.lab.local’ is this example.ViPRRemoveHost4ViPRRemoveHost5                                                    Note: To speed up the procedure it may be worth looking at using esxcli to unmount & detach the volumeshttps://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2004605
  5. Perform a re-discovery of vCenter server from the ViPR interface. Login to ViPR UI as ‘root’, navigate to ‘Physical -> vCenters’ choose the correct vCenter name and click ‘Rediscover’ViPRRemoveHost6
  6. Edit the ViPR profile to enable cli functionality – Open a putty session to ViPR and login as ‘root’, navigate to /opt/storageos/cli/, from here run the cmd to edit the profile ‘vi viprcli.profile’ and set the VIPR_HOSTNAME to the ‘ViPR FQD and ensure VIPR_PORT=4443 environment variable is set and save the file :wq<Return>ViPRRemoveHost7aViPRRemoveHost7
  7. Authenticate with ViPR in order to use cli mode – change directory to /opt/storageos/cli/bin/ and execute the authentication cmd:./viprcli authenticate –u root –d /tmpViPRRemoveHost8
  8. From the same ViPR putty session execute the host removal command:                     ./viprcli exportgroup remove_host -n OldEGName -hl Hostname -pr ProjectViPRRemoveHost9
  9. Monitor the progress of the task from the ViPR interface by navigating to: ‘Resources -> Tasks’ViPRRemoveHost10You may also run the following ViPR commands to query the Export Group and Mask:/opt/storageos/bin/dbcli list ExportGroup

    /opt/storageos/bin/dbcli list ExportMask                                                                                                

  10. Login into the vRealize Automation console and execute a vRA ‘Data Collection’ – navigate to ‘Infrastructure -> Compute Resources -> Compute Resources’, hover over the associated Compute Resource (‘EHCWorkload01’ in this example), click ‘Data Collection’, then click ‘Request now’ under ‘Inventory’.ViPRRemoveHost11                        On completion of the data collection you will notice the total available resources have been impacted as a result of removing the host.

 

Add Host – add ESXi Host to a ViPR Export Group 

  1. Perform a re-discovery of vCenter server from the ViPR interface. Login to ViPR UI as ‘root’, navigate to ‘Physical -> vCenters’ choose the correct vCenter name and click ‘Rediscover’.ViPRRemoveHost6
  2. From the ViPR putty session execute the add host command:./viprcli exportgroup add_host -n NewEGName -hl Hostname -pr Project

    This will result in the host being added to the new target Export Group in ViPR, with associated zoning, masking and lun provisioning tasks being executed.ViPRRemoveHost13

  3. Monitor the progress of the task from the ViPR interface by navigating to ‘Resources -> Tasks’ViPRRemoveHost14
  4. Login into the vRealize Automation console and Run a vRA ‘Data Collection’ – navigate to ‘Infrastructure -> Compute Resources -> Compute Resources’, hover over the associated Compute Resource (‘EHC Management’ in this example), click ‘Data Collection’, then click ‘Request now’ under ‘Inventory’.

Related Post:

ViPR Controller – Ingest V(x)Block UCS Boot Volumes

Reference:

ViPR Controller cli Reference

 

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s