Removing PowerPath/VE From vSphere Host(s) using ESXCLI/PowerCLI

In the event you have a requirement to uninstall PowerPath/VE from a vSphere host. The first series of steps outline how to remove PP/VE from a single host. If you need to remove PP/VE from a cluster of hosts then please see the PowerCLI section below.

1. Firstly enable SSH on the Host in order to issue the ESXCLI cmds:
pp_remove_3

2. Retrieve the names of the Powerpath packages installed on the vSphere host by typing:
# esxcli software vib list
# esxcli software vib list | grep power
remove_pp_from_esx_1
Note: VIB stands for vSphere Installation Bundle

3. Using the package names remove the PowerPath/VE package by issuing the following command:
# esxcli software vib remove -n powerpath.cim.esx -n powerpath.plugin.esx -n powerpath.lib.esx
remove_pp_from_esx_2

4. After a successful uninstall reboot the host:
Enter Maintenance Mode: esxcli system maintenanceMode set –enabled=true
Reboot Host: esxcli system reboot –reason=”Uninstalling Powerpath/VE”

5. Exit Maintenace Mode on completion of Reboot:
Exit Maintenance Mode: esxcli system maintenanceMode set –enabled=false

Using PowerCLI To Remove Powerpath From Cluster Hosts
1. Connect to vCenter and enable SSH on all hosts in your specified cluster:
Connect-VIServer -Server ‘vCenter_IP’ -User ‘administrator@vsphere.local’ -Password ‘Password’
Get-Cluster YourClusterName | Get-VMHost | ForEach {Start-VMHostService -HostService ($_ | Get-VMHostService | Where {$_.Key -eq “TSM-SSH”})}

2. Confirm the presence of PP/VE on the cluster hosts:
$hosts = Get-Cluster YourClusterName | Get-VMHost
forEach ($vihost in $hosts)
{
$esxcli = get-vmhost $vihost | Get-EsxCli
$esxcli.software.vib.list() | Where { $_.Name -like "*powerpath*"} | Select @{N="VMHost";E={$ESXCLI.VMHost}}, Name, Version
}

3. Remove PP/VE from all the hosts in the cluster:
$hosts = Get-Cluster YourClusterName | Get-VMHost
forEach ($vihost in $hosts)
{
$esxcli = get-vmhost $vihost | Get-EsxCli
$PPVE=$esxcli.software.vib.list() | Where { $_.Name -like "*powerpath*"}
$PPVE | ForEach { $esxcli.software.vib.remove($false,$true,$false,$true,$_.Name)}
}

4. Enter each host in maintenance mode and reboot (use with caution!):
$hosts = Get-Cluster YourClusterName | Get-VMHost
forEach ($vihost in $hosts)
{
$esxcli = get-vmhost $vihost | Get-EsxCli
$esxcli.system.maintenanceMode.set($true)
$esxcli.system.shutdown.reboot(10,"UninstallingPP")
}

5. Disable SSH on all hosts in the cluster:
Get-Cluster YourClusterName | Get-VMHost | ForEach {Stop-VMHostService -HostService ($_ | Get-VMHostService | Where {$_.Key -eq “TSM-SSH”}) -Confirm:$FALSE}

Notes:
Useful cmds to check status of LUN Connectivity:

Check VMKernel Log for PowerPath Errors: cat /var/log/vmkernel.log | grep PowerPath
2014-07-10T04:42:00.320Z cpu8:33448)ALERT: PowerPath:MpxRecognize failed. Path vmhba1:C0:T0:L255 not claimed
2014-07-10T04:42:00.320Z cpu8:33448)ALERT: PowerPath:Could not claim path vmhba1:C0:T0:L255. Status : Failure
2014-07-10T04:42:00.320Z cpu8:33448)WARNING: ScsiPath: 4693: Plugin 'PowerPath' had an error (Failure) while claiming path 'vmhba1:C0:T0:L255'. Skipping the path.
2014-07-10T04:42:00.320Z cpu8:33448)ScsiClaimrule: 1362: Plugin PowerPath specified by claimrule 260 was not able to claim path vmhba1:C0:T0:L255. Busy

esxcfg-mpath –l command
~ # esxcfg-mpath -l command
fc.20000024ff3dd55b:21000024ff3dd55b-fc.500009730025c000:500009730025c1a5-
Runtime Name: vmhba1:C0:T0:L255
Device: No associated device
Device Display Name: No associated device
Adapter: vmhba1 Channel: 0 Target: 0 LUN: 255
Adapter Identifier: fc.20000024ff3dd55b:21000024ff3dd55b
Target Identifier: fc.500009730025c000:500009730025c1a5
Plugin: (unclaimed)
State: dead
Transport: fc

esxcli storage core path list fc.20000024ff3dd55b:21000024ff3dd55b-
~ # esxcfg-mpath -l command
fc.20000024ff3dd55b:21000024ff3dd55b-fc.500009730025c000:500009730025c1a5-
Runtime Name: vmhba1:C0:T0:L255
Device: No associated device
Device Display Name: No associated device
Adapter: vmhba1 Channel: 0 Target: 0 LUN: 255
Adapter Identifier: fc.20000024ff3dd55b:21000024ff3dd55b
Target Identifier: fc.500009730025c000:500009730025c1a5
Plugin: (unclaimed)
State: dead
Transport: fc

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