Removing a storage volume

The following script is an example of how to:

 

Example script
PS C:\Users\administrator.BROOKSDOM> import-module esipstoolkit

PS C:\Users\administrator.BROOKSDOM> $system = Get-EmcHostSystem NEC-BLADE6

PS C:\Users\administrator.BROOKSDOM> $vol = Get-EmcHostVolume -HostSystem $system -ID TestVolume

Host: NEC-BLADE6. Refreshing MultiPath software information.

Host: NEC-BLADE6. Retrieving disk information from Virtual Disk Service.

PS C:\Users\administrator.BROOKSDOM> $hdisk = Get-EmcHostDisk -Volume $vol

PS C:\Users\administrator.BROOKSDOM> $lun = Get-EmcLUN -HostDisk $hdisk

Associating the specified host disk with its corresponding storage system...

PS C:\Users\administrator.BROOKSDOM> Remove-EmcVolumeMountPoint -HostSystem $system -Volume $vol

TaskStatus: Started

10% : Unmounting the volume...

100% : The specified volume has been unmounted...

TaskStatus: Completed

PS C:\Users\administrator.BROOKSDOM> Set-EmcHostDiskOnlineState -HostDisk $hdisk -Offline

TaskStatus: Started

10% : Bringing the disk offline...

100% : The specified disk has been brought offline...

TaskStatus: Completed

PS C:\Users\administrator.BROOKSDOM> Set-EmcLunAccess -HostSystem $system -Lun $lun -Unavailable

TaskStatus: Started

10% : Masking the LUN from the initiators...

100% : The specified LUN has been masked from the specified initiators...

TaskStatus: Completed

PS C:\Users\administrator.BROOKSDOM> Update-EmcSystem -HostSystem $system

Refreshing disks of host system '[Name: NEC-BLADE6, IP address: 172.20.1.106.]'

Host: NEC-BLADE6. Refreshing MultiPath software information.

Host: NEC-BLADE6. Retrieving disk information from Virtual Disk Service.

PS C:\Users\administrator.BROOKSDOM> Remove-EmcLun -Lun $lun

Confirm

Are you sure you want to perform this action?

Performing operation "Remove-EmcLun" on Target "LUN 44".

[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y

TaskStatus: Started

 10% : Destroying the LUN...

100% : The specified LUN has been destroyed...PS C:\Users\administrator.BROOKSDOM>

TaskStatus: Completed