Skip to content

Commit

Permalink
Updated steps on removing volumes from vSphere
Browse files Browse the repository at this point in the history
Providing updated steps on how to remove a volume. This now includes
unmount and detach steps.
  • Loading branch information
joshatwell committed Mar 30, 2016
1 parent 6922188 commit 650f176
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions VMware/Remove-SolidFire-Volume-From-VMware.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Load Datastore Functions
. "C:\Users\jatwell\Google Drive\Scripts\DatastoreFunctions.ps1"

# Load SPBM Module since we'll use the Get-SVolumeFromDatastore function.
Import-Module "C:\Users\jatwell\Documents\GitHub\PowerShell\SPBM\SolidFire-SPBM.psm1"


# Collect datastore object that you wish to remove
$datastore = Get-Datastore Engineering-02

# Collect volume object for the selected datastore
$volume = $datastore | Get-SFVolumeFromDatastore


$datastore | Get-DatastoreMountInfo

# Unmount the datastore
$datastore | Unmount-Datastore

# Check mount info for the datastore (optional)
$datastore | Get-DatastoreMountInfo


# Detach the datastore from ESXi host
$datastore | Detach-Datastore

# Remove the volume from the SolidFire System
# This places the volume in the DeletedVolumes space
$volume | Remove-SFVolume -Confirm:$false

# Optional | Permanently remove volume from SolidFire system
# This is a PERMANENT OPERATION!
#Get-SFDeletedVolume | Remove-SFDeletedVolume -Confirm:$false

0 comments on commit 650f176

Please sign in to comment.