add nfs datastore command line script

add nfs datastore command line script

******
#!/bin/bash

hostlist=”esxhost1 esxhost2 esxhost3″

for nexthost in $hostlist
do
ssh root@$nexthost “esxcfg-nas -a -o NAS02 -s /vol/vmnfs_01 vmnfs_01; vmware-vim-cmd hostsvc/storage/refresh”
done
******

NAS02
represents the dns name of your storage device followed by the nfs
export path then the identifier you want in virtual center.

Leave a Reply

Your email address will not be published. Required fields are marked *

7 − 1 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.