You can create an NFS 4.1 datastore with Kerberos authentication and multipathing.
Procedure
- Get the virtual machine host where you want to create the NFS 4.1 datastore.
$vmhost = Get-VMHost 'hostname'
- Set NTP servers for the virtual machine host.
Add-VMHostNtpServer -VMHost $vmhost -NtpServer 'ntp_server_ip'
- Set a DNS server and search the domain for the virtual machine host.
$vmhostnetwork = Get-VMHostNetwork -VMHost $vmhost
Set-VMHostNetwork -Network $vmhostnetwork -DnsFromDhcp $false -DnsAddress 'dns_server_ip' -DomainName 'domain_name' -SearchDomain 'search_domain'
- Add the virtual machine to the Active Directory domain.
$vmhost | Get-VMHostAuthentication | Set-VMHostAuthentication -JoinDomain -Domain 'AD_domain_name' -Username 'AD_user_name' -Password 'AD_password'
- Create an NFS user on the virtual machine host for Kerberos-based authentication for the NFS 4.1 datastore.
New-NfsUser -VMHost $vmhost -Username 'NFS_user_name' -Password 'password'
- Create an NFS 4.1 datastore with Kerberos authentication and multipathing.
New-Datastore -Name 'NFS_datastore_name' -Nfs -FileSystemVersion '4.1' -VMHost $vmhost -NfsHost @('remote_host_1_ip', 'remote_host_2_ip') -Path 'NFS_datastore_remote_path' –Kerberos
- (Optional) Retrieve the datastore.
$ds = Get-Datastore 'NFS_datastore_name'
- (Optional) Remove the datastore.
Remove-Datastore $ds -VMHost $vmhost
- (Optional) Get the NFS user from the virtual machine host.
$user = Get-NfsUser -VMHost $vmhost
- (Optional) Update the password of the NFS user.
$user = Set-NfsUser -NfsUser $user -Password 'new_password'
- (Optional) Remove the NFS user.
Remove-NfsUser -NfsUser $user