vAnders.se

— Virtual and software defined stuff. And more! —

Unmount datastore from all hosts without scripting

Leave a comment

VMware_iconDo you want to remove (unmount) a datastore from all hosts in your VMware vSphere Environment without scripting or fixing all your hosts manually (and slowly)?
Start your vSphere Client and switch to the Datastores and Data clusters view. Expand the tree and find the datastore. Right click it and choose Delete and boom, this dialogue shows where you can select which hosts you want to remove the datastore from.

RemoveDatastore

I´m almost embarassed that I haven´t seen this function earlier but it´s there (in vSphere 5.5 anyway) and it´s really neat.

 

Unfortunately, if you want to add datastores you have to do it host by host so now is the time to browse your script folder. Or you can use this one. Copy to a text file, name it something like “add_datastores.ps1” and run through powercli.

 

Connect-VIServer your_vcenter

$vmhosts = Get-VMHost -Location your_cluster

foreach ($vmhost in $vmhosts)

{

New-Datastore -VMHost $vmhosts -NFS -Name datastore_name -Path “/vol/volume/qtree” -NfsHost x.x.x.x

}

 

Advertisements

Anything to add?

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s