天天看點

Detaching a datastore or storage device from multiple ESXi 5.0 hosts

To detach a storage device using PowerCLI:

Review the VMware Contributed Sample Code disclaimer, and deploy the community-supported PowerCLI script available atAutomating Datastore/Storage Device Detachment in vSphere 5. 

Ensure that you have already unmounted the desired datastore. For more information, see Unmount VMFS or NFS Datastoresin the vSphere 5 Documentation Center. 

List all datastores and their attached hosts by running the command:

Get-Datastore | Get-DatastoreMountInfo | Sort Datastore, VMHost | FT –AutoSize

You see an output similar to:

<a href="http://s3.51cto.com/wyfs02/M01/8C/31/wKiom1hkt3qR2mkwAAC0XBZcr9o014.jpg-wh_500x0-wm_3-wmp_4-s_2902403061.jpg" target="_blank"></a>

Select the appropriate Datastore and record the name beneath the Datastore column, and confirm that the Mountedcolumn contains the value False for all hosts. 

Detach the devices from all hosts using the command:

Get-Datastore datastore name| Detach-Datastore

Where datastore name is the name of the Datastore recorded in Step 3.

Detaching LUN naa.5000144f52145699 from host esx01.vmw.local...

Detaching LUN naa.5000144f52145699 from host esx02.vmw.local...

Detaching LUN naa.5000144f52145699 from host esx03.vmw.local...

https://www.247rack.com/dashboard/knowledgebase/44/Detaching-a-datastore-or-storage-device-from-multiple-ESXi-50-hosts.html

本文轉自學海無涯部落格51CTO部落格,原文連結http://blog.51cto.com/549687/1887302如需轉載請自行聯系原作者

520feng2007

繼續閱讀