Virtualizationesxi 7esxi 8vCenterVMware

How to Create NFS Datastore in vSphere

How to Create NFS Datastore in vSphere

Introduction

Network File System (NFS) datastores provide a flexible and cost-effective storage solution for VMware vSphere environments. This comprehensive guide demonstrates how to create an NFS datastore in vSphere, walking you through the entire configuration process from setting up your NFS server to mounting the datastore on ESXi hosts.

Whether you’re building a home lab or managing production infrastructure, understanding NFS datastore configuration is essential for VMware administrators. This tutorial uses real-world lab scenarios to illustrate best practices and common troubleshooting steps.

What is an NFS Datastore in vSphere?

An NFS datastore is a network-based storage repository that allows ESXi hosts to store virtual machine files, templates, and ISOs on a remote NFS server. Unlike block-based storage protocols like iSCSI or Fibre Channel, NFS operates at the file level, making it simpler to configure and manage.

Benefits of Using NFS Datastores

Cost-Effective Storage: NFS eliminates the need for expensive SAN infrastructure, making it ideal for small to medium environments and home labs.

Simplified Management: File-level access means easier provisioning, snapshots, and quota management compared to block-based storage.

Flexibility: NFS datastores can be shared across multiple ESXi hosts, enabling features like vMotion and High Availability without complex storage configurations.

Scalability: Adding storage capacity is straightforward—simply expand the NFS share on your storage server.

NFS Versions Supported by vSphere

VMware vSphere supports both NFS version 3 and version 4.1. NFS v3 has been the traditional choice for VMware environments, offering broad compatibility and proven reliability. NFS v4.1 introduces enhanced security features like Kerberos authentication, improved performance through session trunking, and better handling of network failures.

For most production environments, NFS v4.1 is recommended due to its security enhancements and performance improvements. However, NFS v3 remains a solid choice for lab environments and situations where simplicity is prioritized.

Prerequisites for Creating NFS Datastore

Before configuring your NFS datastore, ensure you have the following components ready:

Infrastructure Requirements

  • VMware ESXi Host: A functioning ESXi server (version 6.5 or later recommended)
  • vCenter Server: For centralized management (optional but recommended)
  • NFS Server: A configured NFS server with adequate storage capacity
  • Network Connectivity: All components must have network connectivity on the same subnet or with proper routing

Lab Environment Specifications

This tutorial uses the following lab configuration:

  • ESXi Host IP: 192.168.91.129
  • vCenter Server IP: 192.168.91.130
  • NFS Server: Windows Server 2022 (IP: 192.168.91.131)
  • Domain: vmorecloud.com
  • NFS Share Path: To be configured

Network Configuration Best Practices

For optimal performance and security, consider these networking recommendations:

Dedicated Storage Network: Use a separate VLAN or physical network for storage traffic to prevent contention with VM traffic.

Jumbo Frames: Enable jumbo frames (MTU 9000) on storage networks to improve throughput for large data transfers.

Multiple NICs: Configure multiple network adapters for redundancy and increased bandwidth using NIC teaming.

Step-by-Step Lab Tutorial

Part 1: Configure NFS Server on Windows Server 2022

Windows Server 2022 can function as an NFS server, making it convenient for lab environments. Follow these steps to set up your NFS server.

Install NFS Server Role

  1. Log into your Windows Server 2022 machine (192.168.91.131)
  2. Open Server Manager
  3. Click ManageAdd Roles and Features
  4. Click Next through the wizard until you reach Server Roles
  5. Expand File and Storage ServicesFile and iSCSI Services
  6. Check Server for NFS
  7. Click Next and complete the installation
  8. Restart the server if prompted

Create NFS Share

  1. Open File Explorer and create a new folder for your datastore (e.g., C:\NFSDatastore)
  2. Right-click the folder and select Properties
  3. Navigate to the NFS Sharing tab
  4. Click Manage NFS Sharing
  5. Check Share this folder
  6. Configure the share name (e.g., ESXi_Datastore)
  7. Click Permissions and add your ESXi host:
    • Click Add
    • Enter the ESXi host IP: 192.168.91.129
    • Set Type of access to Read-Write
    • Ensure Allow root access is checked
    • Click OK
  8. Click OK to create the share

Verify NFS Service

  1. Open Services (services.msc)
  2. Locate Server for NFS service
  3. Ensure the service is Running and set to Automatic
  4. If not running, right-click and select Start

Configure NFS Server Settings

  1. Open Command Prompt as Administrator
  2. Run the following command to verify the NFS share:
showmount -e localhost
  1. You should see your exported share listed

Part 2: Configure ESXi Host Networking

Before adding the NFS datastore, ensure your ESXi host has proper network connectivity to the NFS server.

Verify Network Configuration

  1. Open a web browser and navigate to your ESXi host: https://192.168.91.129
  2. Log in with your root credentials
  3. Click Networking in the left navigation menu
  4. Verify that your VMkernel adapter has connectivity to the 192.168.91.0/24 network
  5. Note the VMkernel port used for storage traffic (typically vmk0 for lab environments)

Test NFS Connectivity

  1. SSH into your ESXi host (enable SSH if not already enabled)
  2. Run the following command to test NFS connectivity:
esxcli network diag ping -H 192.168.91.131

Verify successful ping responses Test NFS mount availability:

showmount -e 192.168.91.131

Part 3: Add NFS Datastore Using vCenter

Now that your NFS server is configured and network connectivity is verified, you can add the NFS datastore through vCenter Server.

Access vCenter Server

  1. Open a web browser and navigate to: https://192.168.91.130
  2. Log in to the vSphere Client with your administrator credentials
  3. From the home screen, click Hosts and Clusters or Storage

Create New NFS Datastore

  1. In the vSphere Client, navigate to your ESXi host (192.168.91.129)
  2. Click the Configure tab
  3. Under Storage, click Datastores
  4. Click the New Datastore button (or right-click in the datastore panel and select New Datastore)

Configure Datastore Settings

Follow the New Datastore wizard:

Step 1: Select Type

  • Choose NFS as the datastore type
  • Click Next

Step 2: Select NFS Version

  • Select NFS 3 (for Windows Server 2022 compatibility)
  • Click Next

Step 3: Configure NFS Settings

  • Name: Enter a descriptive name (e.g., NFS_Datastore_01)
  • Folder: Enter the share path /ESXi_Datastore (the share name created earlier)
  • Server: Enter the NFS server IP address: 192.168.91.131
  • Access mode: Ensure Mount NFS read-write is selected
  • Click Next

Step 4: Select Hosts

  • Select the ESXi host(s) that should mount this datastore
  • In our lab, select 192.168.91.129
  • Click Next

Step 5: Review Configuration

  • Review all settings carefully
  • Verify the NFS server IP, share path, and datastore name
  • Click Finish to create the datastore

Verify Datastore Creation

  1. After the task completes, the new NFS datastore should appear in the datastore list
  2. Click on the datastore to view its properties
  3. Verify the following:
    • Type: Shows as NFS
    • Capacity: Reflects the available space on your NFS share
    • Free Space: Shows available storage
    • Mounted on: Lists your ESXi host

Part 4: Verify and Test NFS Datastore

Check Datastore Accessibility

  1. In vSphere Client, right-click your new NFS datastore
  2. Select Browse Files
  3. The datastore browser should open, showing an empty directory
  4. Try creating a test folder to verify write permissions:
    • Click the Create a new folder icon
    • Name it test_folder
    • If successful, delete the folder

Upload Test File

  1. Click the Upload Files button in the datastore browser
  2. Select a small test file from your local computer
  3. Monitor the upload progress
  4. Once complete, verify the file appears in the datastore
  5. You can download or delete the test file

Verify from ESXi CLI

For advanced verification, SSH into your ESXi host and run:

esxcli storage nfs list

This command displays all mounted NFS datastores, including:

  • Volume name
  • NFS server IP
  • Share path
  • Mount status
  • Access mode

Performance Testing

To ensure adequate performance, create a test virtual machine on the NFS datastore:

  1. Right-click your ESXi host and select New Virtual Machine
  2. Follow the wizard, selecting your new NFS datastore for VM storage
  3. Deploy a lightweight operating system
  4. Monitor datastore I/O during VM operations
  5. Use vCenter performance charts to verify acceptable latency and throughput

Advanced Configuration Options

NFS v4.1 with Kerberos Authentication

For enhanced security in production environments, configure NFS v4.1 with Kerberos:

  1. Deploy a Key Distribution Center (KDC) in your environment
  2. Create service principals for ESXi hosts and NFS server
  3. Configure ESXi to use Kerberos for NFS authentication
  4. Mount NFS datastores with security type “krb5” or “krb5i”

This configuration encrypts NFS traffic and provides mutual authentication between ESXi and storage servers.

Multipathing for NFS

While NFS doesn’t support traditional multipathing like iSCSI, you can achieve similar benefits:

  1. Create multiple VMkernel ports on different physical NICs
  2. Enable NFS port binding in ESXi advanced settings
  3. Configure multiple IP addresses on your NFS server
  4. ESXi will load balance NFS traffic across available paths

Storage I/O Control for NFS

Enable Storage I/O Control (SIOC) on NFS datastores to prevent VM storage contention:

  1. Select your NFS datastore in vCenter
  2. Navigate to ConfigureGeneral
  3. Click Edit next to Storage I/O Control
  4. Enable SIOC and configure appropriate threshold settings
  5. Set shares for critical VMs to ensure priority during congestion

Conclusion

Creating an NFS datastore in vSphere provides a practical and economical storage solution for virtualized environments. This tutorial demonstrated the complete process, from configuring a Windows Server 2022 NFS server to mounting the datastore in vCenter and performing verification tests.

NFS datastores offer significant advantages including simplified management, cost-effectiveness, and flexibility. By following the best practices outlined in this guide—such as network segmentation, performance optimization, and proper security controls—you can deploy NFS storage that meets production requirements.

Whether you’re setting up a home lab or managing enterprise infrastructure, understanding NFS datastore configuration is a valuable skill for VMware administrators. The hands-on lab approach used in this tutorial provides practical experience that translates directly to real-world scenarios.

80%
Awesome
  • Design

Leave a Response

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock