Skip to end of metadata
Go to start of metadata

If you plan to run your SmartMachine or VM in a production environment, you should consider a storage solution that utilizes Network File System storage (NFS). Joyent hosts NFS storage that you can use as part of your backup strategy.

To setup NFS space, you must contact Joyent Support to setup a mount and whitelist your IP's. You can request a subnet Virtual LAN (VLAN) of private IP's that Joyent will whitelist.  This allows customers to provision a dataset that is on the VLAN and have access to the NFS mount.

Joyent recommends that you only use NFS space for archiving data. Avoid hosting your production files off of an NFS store.

In this topic: 

The way you add systems to an NFS mount varies depending on the environment.

SmartOS

To add SmartMachines to an NFS mount:

  1. Ensure NFS is enabled through SMF:
  2. Create a mount point:
  3. Create an entry in /etc/vfstab:
  4. Mount the share:
  5. Verify filesystem is mounted:
  6. Test the mount by accessing a file in the share.

Debian Flavored Linux (Ubuntu)

To add Debian flavored Linux VMs to an NFS mount:

  1. Ensure the NFS package is installed:
  2. Create a mount point:
  3. Create an entry in /etc/fstab:
  4. Mount the share:
  5. Verify the filesystem is mounted:
  6. Test the mount by accessing a file in the share.

RedHat Flavored Linux (CentOS, Fedora)

To add RedHat flavored Linux VMs to an NFS mount:

  1. Ensure the NFS package is installed:
  2. Create a mount point:
  3. Create an entry in /etc/fstab:
  4. Mount the share:
  5. Verify filesystem is mounted:
  6. Test the mount by accessing a file in the share.
If you want the mount to be available on reboot you will have to enable netfs:

Microsoft Windows

Microsoft Windows includes a service for NFS but you will need to enable it first. The following TechNet article provides more information on enabling the NFS service in Windows.

http://technet.microsoft.com/en-us/library/cc753302(v=ws.10).aspx

You will need to contact Joyent support for the NFS server IP and volume.

To use NFS from a Windows machine, you will need to modify the registry so that Windows has rewrite access to the NFS share. The reason for this is the anonymous UID and GID for the Windows client to access an NFS share is set to -2 by default. You will need to set this to a value of 0.

  1. Click Start > Command Prompt
  2. In the Command Prompt, run regedit.

    This will open the Registry Editor.
  3. In the registry editor, navigate to HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > ClientForNFS > CurrentVersion > Default
  4. In the default directory, click Edit > New > DWORD (32bit) value.
  5. Add two DWORDs: AnonymousUid and AnonymousGid
  6. For each new DWORD, click Edit > Modify....
  7. In the Value Data field, set the value to 0.
  8. Restart the NFS service client or restart your Windows machine.

You can mount the NFS share by running this command from the Command Prompt:

For example:

You can also map to an NFS share through Explorer using <NFS_Server_IP>:<Share_Path>.

To setup your mounts so that they persist after a reboot, you need to set up a script that mounts shares on boot. You can find more information about setting up a script here.

Windows 2012 GUI Mapping of Network Drive:

1.) Right click on My Computer Icon, and Map Network Drive
2.) Choose a drive letter and insert


<server ip of mount>\vol\<joyent UUID>

Example:

\\192.168.31.253\vol\joy5dd44d21_611b_4dd2_b4ea_b1002dcaa32e

( In the document it doesnt explain the
path)

Troubleshooting

Device is busy
[root@server ~]# mount -a
mount: /tmp is already mounted or swap is busy
nfs mount: mount: /backups: Device busy
entity not found
entity not found
Use fuser on the directory to see if a process is holding the directory open.

Permission denied when trying to mount
1) do a traceroute from client to NFS server and make sure that it can reach it and is NOT going over the public interface

It is is going over the public interface you will have to add a route to to the NFS server:

  • if the zone is shared from the global

route -p add <INTERNAL-GATEWAY>/<CIDR_FOR_INTERNAL_SN> <GLOBAL-INTERNAL-IP>

  • if the zone is ip exclusive from inside the zone

route -p add <NFS-SERVER-IP>/32 <ZONE-INTERNAL-IP>
2) check that the zone's /etc/vfstab is set up to point to proper NFS Serve and mountpoint

3) check that the NFS Server has proper internal IP address of zone

Debian Related issues
From http://forums.debian.net/viewtopic.php?f=16&t=71654

If the NFS shares fail to mount at boot, while you can still mount them manually (# mount -a), the problem may be that there is a lock caused by e.g. a server crash, that "can fail to be removed and so a reboot of the machine in question will fail to remove the lock and mountnfs will abort all mounts because the lock is still in place" . To get rid of the lock, just

  1. rm -r /var/run/network/mountnfs

The related Bug is documented here:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550883

Labels:
nfs nfs Delete
storage storage Delete
network network Delete
file file Delete
system system Delete
mount mount Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.