IoT Bytes

Bits and Bytes of IoT

Hack Single Bay WD My Cloud NAS Drive to Create NFS Share for VMware vCenter Datastore

Pradeep Singh | 10th Aug 2017

Untitled

Single Bay WD My Cloud Drives are inexpensive NAS solution that you can add to your Home Network. You can store your media file centrally on this Network Drive and stream them to your smart devices seamlessly. You can also use it to backup the data from your Windows or Mac computers.

This Drive supports SMB/CIFS Shares (Samba) out of the box. However, for some reason, WD decided not to allow users to create NFS shares on Single Bay version (2-Bay Version supports NFS Shares out of the box). You may check this Link for details –

WD_NFS_NOT_Supported

NFS Shares could prove to be really useful if you are testing Virtualization in your home lab. Most of the Hypervisors and  Virtualization software allow us to create Datastore on NFS shares that can be shared between multiple Hypervisor hosts.

In this article let’s explore how you can tweak WD My Cloud OS to allow NFS Shares. Before you start with this article, please note following points –

  1. You are doing it at your own risk.
  2. Considering the fact that this is just a demo, I am not focusing on the Security related aspects, to keep things as simple as possible.
  3. All you need to do on the Linux shell is to change a config File.

If you are OK with these points, let’s do it –

1. Create New Share:

Login to the web interface of your “WD My Cloud” and create a new share. Make sure you keep “Media Serving” as “OFF” and “Public Access” as “ON”.

newShare

2. SSH into WD My Cloud:

Shh into your WD My Cloud Device using root credentials. The default root password is “welc0me“. If you are using Windows machine use “putty” ssh client. From Linux machines, you can directly ssh from the shell prompt using “ssh root@

SSH access to this drive is disabled by default so you may have to enable root access from the web interface. Go to Settings –> Network –> SSH and turn it on.

enable_ssh

3. Update “/etc/exports” File:

Once you are logged into the Linux shell of your WD My Cloud Drive, you can follow these steps –

3.1 Check the contents of “exports” file using “cat /etc/exports” command. You should have something like this –

WDMyCloud:~# cat /etc/exports
# Use nobody user (uid 65534) for nfs guest.  This is restricted from private
# shares by ACLs.
#
/nfs *(rw,all_squash,sync,no_subtree_check,insecure,crossmnt,anonuid=65534,anongid=1000)
WDMyCloud:~# 

3.2 Make a backup copy of this file using “cp /etc/exports /etc/exports.bak” command (use the file “/etc/exports.bak” to restore the original configuration in case you mess-up the original file) –

WDMyCloud:~# cp /etc/exports /etc/exports.bak
WDMyCloud:~# 

3.3 Edit “/etc/exports” file and add the name of your share after “/nfs“. For example in my case, I will add “/vCenter_Data_Store. No need to change anything else in this file. You can make this change manually or use “sed –i ‘s:^/nfs:/nfs/vCenter_Data_Store:’ /etc/exports” command –

WDMyCloud:~# sed -i 's:^/nfs:/nfs/vCenter_Data_Store:' /etc/exports
WDMyCloud:~# 
WDMyCloud:~# cat /etc/exports
# Use nobody user (uid 65534) for nfs guest.  This is restricted from private
# shares by ACLs.
#
/nfs/vCenter_Data_Store *(rw,all_squash,sync,no_subtree_check,insecure,crossmnt,anonuid=65534,anongid=1000)
WDMyCloud:~# 

4. Refresh the exports:

After editing the “/etc/exports” file, you should refresh the exports using “exportfs -r” command – 

WDMyCloud:~# exportfs -r
WDMyCloud:~#

5. Mount NFS share as VMware vCenter Datastore:

5.1 In the vCenter Web Client navigator, select Global Inventory Lists > Datastores.
5.2 Click the New Datastore icon.
5.3 Select the placement location for the datastore.
5.4 On the Datastore Type option screen, select “NFS” as Datastore Type.
5.6 On the NFS Version option screen, select “NFS 3” as NFS Version.
5.7 Give some meaningful name to for your NFS Datastore. In the Folder field, type the path to your NFS share as configured in exports file and in the Server field type the IP Address of your WD My Cloud Drive.

add_datastore1

5.8 Leave all the options as default on all the following screens.
5.9 Your final screen should look similar to this one –

add_datastore2

5.10 If you are able to successfully add the NFS Datastore, you should see it in vCetner Datastore list –

add_datastore3

Conclusion:

As WD My Cloud Drive has only 1 gigabit NIC, you may not get very good data transfer speed, but for Home Lab and testing VMware configs, it could prove to be a value for money deal. With NFS Share mounted on vCenter as a Datastore, you could still use other SMB/CIFS shares from this drive to store your personal data and computer backups.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: