From the course: vSphere 6.7 Foundations: Storage

Demo: Create an NFS datastore in vSphere 6.7 - vSphere Tutorial

From the course: vSphere 6.7 Foundations: Storage

Demo: Create an NFS datastore in vSphere 6.7

- [Rick] In this video, I'll demonstrate how to create an NFS datastore. And you can see here, I'm logged into the vSphere Client. I'm using the HTML5 version of the vSphere Client in vSphere 6.7. And so I want to create a new datastore. So I'm going to start by just going to Storage here and you can see the datastores that currently exist in my Training virtual data center. And if I right-click the Training virtual data center, and go to Storage, I have an option to add a new datastore. So let's do that and this is going to be an NFS datastore. Now I have two options here. I can choose either an NFS version three datastore, or an NFS version 4.1 datastore and we just saw a video breaking down the differences between those two NFS versions. So in this demo, I'm going to create an NFS 3 datastore. I'm just going to call the datastore NFS-Demo. And on my actual NFS device, I've created a folder called Share. So that's my NFS export that I'm going to be creating this datastore on. And then I'll just go ahead and put in the address of my NFS server here. And I'm going to mount this as read/write. So you'll notice here I have the option, if I want to, to mount this as read only. I'm not going to do that, I'm going to mount it as a read/write datastore. So, essentially what I'm doing in this scenario is there's already this pre-built Share. There's already this pre-built folder on an NFS physical storage solution somewhere. And here's the address of that NFS server. So I'm basically just accessing a shared folder. That's really all I'm doing here. I'm not going to specify the size of my datastore. My ESXi host isn't going to format that datastore with any file system. I'm basically just accessing a shared folder, and using that shared folder to store virtual machines. Mounting that shared folder as a datastore. So I'll go ahead and click next here. I'm going to make this datastore accessible to my one and only ESXi host. I'll go ahead and hit next here and hit finish. And there it is. So there's my NFS-Demo datastore that I just created. I can go to Summary and see exactly how much capacity is available on this datastore. And at the moment you can see that 23.8 gigs are used, 40 gigs is the total capacity. I have a free space of around 16.2 gigs. Now you may be thinking to yourself, Rick you just created this datastore, why are 23.8 gigs already used? Well, it's because I'm just simply accessing a shared folder on the NFS device. So, let's take a little peek behind the scenes here. Now I don't actually have a physical NFS device in my lab environment so what I've done is I've created an NFS server on a Windows Server 2016 system. And so I just want to kind of take you behind the scenes a little bit in the hopes that it'll help to reinforce what's actually going on here with NFS. So I'm going to go to File and Storage Services here, and under File and Storage Services, I'm going to click on Shares. And here it is, here's my NFS Share that I've created. So, basically, it's a directory on the C drive of my Server 2016 machine here, and the C drive has 40 gigs of capacity, 16 gigs free, 23.8 gigs used. That's why my datastore looks the way that it does. So, this hopefully kind of hits home exactly what we're doing with NFS here. NFS, we're not using raw physical disks, we're not using LUNZ, we're not using VMFS. We're simply accessing a folder that has been shared by some network file server. And that's it. So now we've got this usable datastore that I can store virtual machines on and those virtual machine files and folders are going to simply be created inside of that shared folder on that NFS server. Okay, so now that we've created our NFS datastore successfully and we've got it all up and running and ready to go, I want to take a closer look at some of the configuration behind the scenes here. Now, I'm showing you an NFS share that I created in Windows Server 2016, but it doesn't really matter what type of system you're using. These configuration options are pretty universal. So here you can see how I shared out my path. The protocol is NFS. Let's take a look at the authentication configuration. You'll notice I have not required any sort of server authentication. I have not configured Kerberos. Kerberos is available in NFS 4.1. I haven't set that up here. So I'm allowing unauthenticated creations of NFS datastores here. And if we look at the share permissions, I'm allowing any machine to access this NFS share with read/write access. And I'm also allowing the root access. This is a requirement with NFS version three. I cannot block root access to this NFS share. So let's click on Edit here and look at some of the changes that we can make to these permissions. I can pick and choose certain machines, certain hosts, that I want to allow access to this share. And so, I probably want to lock this down a little bit more in real life than I have here. I probably, at a bare minimum, want to lock it down to a certain range of IP addresses, but I do have to allow this root access in order for NFS 3 to work. Now one final thing I want to show you before we move on here. I've created this new NFS datastore. If I decide that I don't actually need it, at anytime I want, I can right-click this NFS datastore and I can unmount it. Also, I could potentially mount this datastore to additional hosts. So you saw when I created the datastore, I only mounted it on one ESXi host. If I start adding more hosts to my inventory, I'm going to have to mount this datastore to those hosts if I want to give them access to it. But what I'm going to do now is go ahead and unmount this datastore. So basically what we're doing here is we're saying I don't want access to this datastore anymore. We're not deleting any data, we're not deleting any folders, we're not purging any content. What we're basically just doing is unmounting that folder. Unmounting that NFS datastore so my ESXi host will no longer have access to it. So that's what unmounting an NFS datastore means. You're not actually destroying any data. You're simply removing that datastore from one or more hosts. If those hosts have virtual machines running on that datastore, we'll have to address those first before we can unmount it. So unmounting a datastore removes that datastore, but it doesn't actually destroy any of the data contained within it.

Contents