{"id":1062,"date":"2017-12-31T22:39:14","date_gmt":"2018-01-01T03:39:14","guid":{"rendered":"https:\/\/ithinkvirtual.com\/?p=1062"},"modified":"2018-02-10T08:59:35","modified_gmt":"2018-02-10T13:59:35","slug":"vsphere-synology-nfs-v4-1","status":"publish","type":"post","link":"https:\/\/ithinkvirtual.com\/2017\/12\/31\/vsphere-synology-nfs-v4-1\/","title":{"rendered":"vSphere…Synology…NFS v4.1"},"content":{"rendered":"

Welcome, and thanks for visiting my blog!<\/p>\r\n

In this post, I am going to cover how to enable NFS v4.1 on a Synology device and then mount and NFS v4.1 datastore in VMware vSphere 6.5.\u00a0 By default, Synology devices support NFS v4 natively, and although they can also support NFS v4.1, it is not enabled.\u00a0 Well, not to worry because I am going to show you just how to enable the feature on your device.<\/p>\r\n

NFS v4 and v4.1 have been around for quite a few years but it has not taken off then way NFS v3 did way back when.\u00a0 There were some major flaws pointed out with NFSv4 so NFSv4.1 was created to rectify those flaws, and VMware was one of the first major companies to adopt and support the new Network File System.\u00a0 But unless your storage device supported the newer NFS versions, you would be stuck mounting NFSv3 volumes by default.<\/p>\r\n

In this demo, I will be using my new replacement Synology DiskStation DS415+ and my homelab\u00a0“datacenter” running the latest version vSphere 6.5.\u00a0 So let’s jump right in!<\/p>\r\n

Using a terminal application like PuTTY, connect to your Synology device via SSH using an admin user account.\u00a0 This can be the default “admin” account and any new user account with Administrator privileges.\u00a0 Once connected enter the following\u00a0command to change the directory:<\/p>\r\n

cd \/usr\/syno\/etc\/rc.sysv<\/pre>\r\n

Once in this directory, run the following command (enter the account password if prompted):<\/p>\r\n

sudo cat \/proc\/fs\/nfsd\/versions<\/pre>\r\n

This will show us the current NFS version currently enabled and supported by the Synology device.\u00a0<\/p>\r\n

\"\"<\/a><\/p>\r\n

We can see that all versions prior to 4.1 have a “+” sign next to them and 4.1 has a “-” sign next to it.\u00a0 Let’s change that!<\/p>\r\n

In order to change this, we will need to edit a shell (S83nfsd.sh) file using “vi”.\u00a0 Run the following command to open the file with VI Editor:<\/p>\r\n

sudo vi S83nfsd.sh<\/pre>\r\n

\"\"<\/a><\/p>\r\n

This will open the shell file and will place the cursor at Line 1, Character 1 as depicted in the following screenshot.\u00a0\u00a0<\/p>\r\n

\"\"<\/a><\/p>\r\n

Navigate down to line 90 using the down arrow and you will see the following line of text.<\/p>\r\n

\"\"<\/a><\/p>\r\n

This is where the magic happens!\u00a0 To edit the file now, press the “I” key on your keyboard to initiate an “Insert” then add the following to the end of the text so the line looks like the following screenshot.<\/p>\r\n

-V 4.1<\/pre>\r\n

\"\"<\/a><\/p>\r\n

To commit\u00a0and save this change, first press the Esc key.\u00a0 Next type the following command and hit “Enter” to write and then quit vi editor.<\/p>\r\n

:wq<\/pre>\r\n

 <\/p>\r\n

\"\"<\/a><\/p>\r\n

 <\/p>\r\n

Next, we need to restart the NFS service.\u00a0 To do so enter the following command:<\/p>\r\n

sudo .\/S83nfsd.sh restart<\/pre>\r\n

 <\/p>\r\n

If we again run the following command, we will see that there is now a “+” sign next to 4.1.\u00a0 Hooray!<\/p>\r\n

sudo cat \/proc\/fs\/nfsd\/versions<\/pre>\r\n

 <\/p>\r\n

\"\"<\/a><\/p>\r\n

Now that we have enabled NFSv4.1 functionality on your storage device, let’s go ahead and mount an NFS volume to our hosts in vSphere.<\/p>\r\n

I have enabled NFS and NFS v4 support then created the following shares with assigned permissions on my device, and am going to mount the ISOs share first in this example by issuing a command via PowerCLI.\u00a0 We can also see that I do not have any NFS mounts currently in my environment<\/p>\r\n

\"\"<\/a> \"\"<\/a> \"\"<\/a><\/p>\r\n

I’ve launched PowerCLI and connected to my vCenter Server using the Connect-VIServer<\/strong> cmdlet then issued the following command:<\/p>\r\n

Get-VMHost | New-Datastore -Nfs -FileSystemVersion '4.1' -Name SYN-NFS04-ISOs -Path \"\/volume3\/NFS04-ISOs\" -NfsHost DS415 -ReadOnly<\/pre>\r\n

*Note:*<\/strong> an important argument here in the “-FileSystemVersion”.\u00a0 If I do not specify the version, it will assume version 3.0 by default.<\/em><\/p>\r\n

\"\"<\/a><\/p>\r\n

If I go back and look at my datastores via the Web Client, I can see that my new NFS 4.1 datastore has been mounted to each one of my ESXi hosts. Nice!<\/p>\r\n

\"\"<\/a><\/p>\r\n

*Bonus:*<\/strong> If I’d like to easily remove this datastore from all of my hosts, I can issue the following command via PowerCLI.<\/p>\r\n

Get-VMHost | Remove-Datastore -Datastore SYN-NFS04-ISOs -Confirm:$false<\/pre>\r\n

\"\"<\/a><\/p>\r\n

Now I can see that the host has been removed successfully!<\/p>\r\n

\"\"<\/a><\/p>\r\n

Well, that about wraps this one up.\u00a0 I hope that this has been useful and informative for you and I’d like to thank you for reading!\u00a0 Until next time!<\/p>\r\n

-virtualex-<\/p>

<\/div>

<\/path><\/svg><\/i> \"Loading\"<\/p>

<\/div>","protected":false},"excerpt":{"rendered":"

Welcome, and thanks for visiting my blog! In this post, I am going to cover how to enable NFS v4.1 on a Synology device and then mount and NFS v4.1 datastore in VMware vSphere 6.5.\u00a0 By default, Synology devices support NFS v4 natively, and although they can also support NFS v4.1, it is not enabled.\u00a0…<\/p>\n

<\/div>\n

<\/path><\/svg><\/i> \"Loading\"<\/p>\n

<\/div>\n","protected":false},"author":1,"featured_media":1083,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"footnotes":"","_jetpack_memberships_contains_paid_content":false,"jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[9],"tags":[11,34,13,33,23],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ithinkvirtual.com\/wp-content\/uploads\/2017\/12\/NFS41.png?fit=1024%2C575&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p7k0Z6-h8","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/posts\/1062"}],"collection":[{"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/comments?post=1062"}],"version-history":[{"count":0,"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/posts\/1062\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/media\/1083"}],"wp:attachment":[{"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/media?parent=1062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/categories?post=1062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ithinkvirtual.com\/wp-json\/wp\/v2\/tags?post=1062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}