Created
April 8, 2016 06:37
-
-
Save vmwarecode/cb92861806c94a6ae6ccfab583a603cd to your computer and use it in GitHub Desktop.
VSAN DIsk Decommission Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /bin/sh | |
| echo "Leaving the VSAN Cluster..." | |
| esxcli vsan cluster leave | |
| echo "Done" | |
| echo "Disabling Auto Mode..." | |
| esxcli vsan storage automode set --enabled false | |
| echo "Done" | |
| esxcli vsan storage list > deviceList | |
| for i in `grep 'VSAN Disk Group Name' deviceList | sort -u | cut -d " " -f8` | |
| do | |
| echo "Removing Disk Group..." | |
| esxcli vsan storage remove -s $i | |
| echo "Done" | |
| done | |
| for i in `grep 'Is SSD:' -n deviceList | cut -d ":" -f1` | |
| do | |
| num=`expr $i - 3` | |
| echo "Reseting Labels for all the disks..." | |
| partedUtil mklabel /dev/disks/`sed "$num!d" deviceList` gpt | |
| echo "Done" | |
| done | |
| rm -rf deviceList |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment