ESXi 5.1上的数据存储上有两个卷。 在graphics用户界面上,显示为灰色,单词“(不活动)”。 另一个根本不显示在GUI中。
但是,在命令行上:
~ # 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
有没有办法在命令行上检测到这一点? 更重要的是,有没有办法“重新激活”呢?
编辑:我不能发表评论,也不能回答我自己的问题。 🙁
无论如何,我最终做了这样的事情(每卷):
#!/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
您可以使用:
esxcfg-nas -r
重新挂载ESXi上的NAS文件系统。 请参阅命令语法:
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.