-1

BACKGROUND

  • vSphere client version = 5.1.0
  • VMWare ESXi version = 5.1.0
  • Server OS = RHEL version 6.8
  • virtualip = virtual IP
  • server1 = ip address of server 1
  • server2 = ip address of server 2
  • lvsserver = ip address of lvs router
  • IPVSADM rules
    • ipvsadm -A -t virtualip:0 -s rr -p
    • ipvsadm -a -t virtualip:0 -r server2:0 -g
    • ipvsadm -a -t virtualip:0 -r server1:0 -g
    • ipvsadm -A -t virtualip:2049 -s rr
    • ipvsadm -a -t virtualip:2049 -r server1:2049 -g
    • ipvsadm -a -t virtualip:2049 -r server2:2049 -g

/etc/exports on both servers (server1, server2)

/vm0    *(rw,sync,no_root_squash)

Both servers contains /vm0 folder

ACTUAL PROBLEM

scenario 1: on server1

root@server1 ~# mount -t nfs server2:/vm0 /vm0
root@server1 ~# service nfs restart

tried to create NFS datastore using following credentials

server = virtualip
Folder = /vm0
Datastore name = vm0

RESULT success!

scenario 2:

//ON SERVER 1
    root@server1 ~# umount vm0

//ON SERVER 2
    root@server2 ~# mount -t nfs server1:/vm0 /vm0
    root@server2 ~# service nfs restart

tried to create NFS datastore using following credentials

server = virtualip Folder = /vmo Datastore name = vm0 RESULT Failed!

ERROR MESSAGE on ESXi server

Call "HostDatastoreSystem.CreateNasDatastore" for object "ha-datastoresystem" on ESXi (ESXi_ip) failed. NFS mount (virtualip):/vm0 failed: The mount request was denied by the NFS server. Check that the export exists and that the client is permitted to mount it.

logs traced using tshark

33.916294107 (virtualip) -> (ESXi_ip) MOUNT 100 V3 MNT Reply (Call In 41) Error:ERR_ACCESS

4
  • 1
    I'm sorry. This doesn't make sense. What are you trying to do? Why are you using a load balancer for ESXi datastores and NFS?
    – ewwhite
    Feb 20, 2017 at 6:29
  • @ewwhite actually, I want to achieve the load balancing while creating ESXi datastores for NFS. I am expecting that whenever I try to create the NFS datastore, everytime different server (server1 or server2) should do it. Feb 20, 2017 at 6:40
  • 2
    This is a bad idea. Why would you want load-balanced datastores? VMware is not intended to work that way.
    – ewwhite
    Feb 20, 2017 at 6:51
  • @ewwhite yes. you are right. but, I am trying to load balance the load-balance the requests and not the datastore.... and I am testing this setup using ESXi datastore as of now. to be exact, I need to load balance the NFS requests and ESXi is the only option that I have currently. Feb 20, 2017 at 7:24

1 Answer 1

1

Reason:

All the NFS datastore requests to EXSi server are actually sent through VIP only (same IP everytime), this caused ESXi to use the cached information every time.

Solution:

use file system id (FSID) for all the intries in the /etc/exports file. eg:

/<mount_folder> *(rw,sync,no_root_squash, fsid=1000)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .