Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Have two volumes on a datastore on ESXi 5.1. On the GUI, one shows up greyed out and the word "(inactive)". The other doesn't show in the GUI at all.

However, on the commandline:

~ # esxcli storage nfs list
Volume Name  Host            Share                      Accessible  Mounted  Read-Only  Hardware Acceleration
-----------  --------------  -------------------------  ----------  -------  ---------  ---------------------
volume1      10.200.201.140  /export1                   true        true     false      Supported            
volume2      10.200.201.140  /export1/somedir           true        true     false      Supported            

Is there a way to detect this on the command line? More importantly, is there a way to "re-activate" them?

EDIT: I cannot make a comment nor answer my own question. :-(

Anyway, I ended up doing something like this (for each volume):

#!/bin/sh
while [[ 1 ]]; do
    echo "$(df -h)" | grep -q "/vmfs/volumes/volume1$"
    volume1_mounted=$?
    if [[ $volume1_mounted -ne 0 ]]; then
       esxcli storage nfs add -H 10.200.201.140 -s /share1 -v volume1
    fi
done
share|improve this question

1 Answer 1

You can use:

esxcfg-nas -r

to remount NAS filesystems on ESXi. See the command syntax:

esxcfg-nas <options> [<label>]
-a|--add                Add a new NAS filesystem to /vmfs volumes.  
                        Requires --host and --share options.
                        Use --readonly option only for readonly access.
-o|--host <host>        Set the host name or ip address for a NAS mount.
-s|--share <share>      Set the name of the NAS share on the remote system.
-y|--readonly           Add the new NAS filesystem with readonly access.
-d|--delete             Unmount and delete a filesystem.
-l|--list               List the currently mounted NAS file systems.
-r|--restore            Restore all NAS mounts from the configuration file. 
                        (FOR INTERNAL USE ONLY).
-h|--help               Show this message.
share|improve this answer
    
Great suggestion, except, as far as I can tell, it makes no difference. I found a cheezy hack that I'll use until I can resolve this long term, see my answer to my question. –  John Schmitt Apr 23 '13 at 5:52
    
Hmm... okay. Good luck! –  ewwhite May 24 '13 at 1:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.