Bug 1270349

Summary: NFS mount uses incorrect hostname
Product: Red Hat Enterprise Linux 7 Reporter: stein
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED NOTABUG QA Contact: Filesystem QE <fs-qe>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.1CC: kzak, stein
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-12 13:39:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description stein 2015-10-09 17:59:10 UTC
Description of problem:
Specify 2 NFS mount entries in /etc/fstab, each with a DNS hostname for the server name.

If 2 different DNS hostnames are specified but both hostnames point to the same IP address, the mount command will use the DNS hostname associated with the first filesystem that is mounted, rather than the hostname specified for each entry.

The output of the df command also shows the incorrect hostname that does not match the /etc/fstab entry


Version-Release number of selected component (if applicable):
2.23.2.22.el7_1.1


How reproducible:
Happens every time mount is called.


Steps to Reproduce:
1. Create 2 NFS mount entries in /etc/fstab

 hostname1.domain:/filesystem1 /mnt/filesystem1 nfs defaults 0 0
 hostname2.domain:/filesystem2 /mnt/filesystem2 nfs defaults 0 0

(hostname1.domain & hostname2.domain should resolve to the same IP address)

2. mount each filesystem
 mount /mnt/filesystem1
 mount /mnt/filesystem2

3. run 'df' and observe the output


Actual results:
df & mount will show both filesystems mounted, but the hostnames on both entries will be the same.

sample df output:
 hostname1.domain:/filesystem1      12345678 10000000   2345678  81% /mnt/filesystem1
 hostname1.domain:/filesystem2      15342592 10006528   2345678  81% /mnt/filesystem2


Expected results:
df output should look like:
 hostname1.domain:/filesystem1      12345678 10000000   2345678  81% /mnt/filesystem1
 hostname2.domain:/filesystem2      15342592 10006528   2345678  81% /mnt/filesystem2


Additional info:

Comment 3 Steve Dickson 2016-04-06 17:45:35 UTC
(In reply to stein from comment #0)
> Description of problem:
> Specify 2 NFS mount entries in /etc/fstab, each with a DNS hostname for the
> server name.
> 
> If 2 different DNS hostnames are specified but both hostnames point to the
> same IP address, the mount command will use the DNS hostname associated with
> the first filesystem that is mounted, rather than the hostname specified for
> each entry.
> 
> The output of the df command also shows the incorrect hostname that does not
> match the /etc/fstab entry

Why in the world would you want two hostnames pointing to the same IP
address... That is a DNS misconfiguration... IMHO...

Comment 4 stein 2016-04-29 12:46:45 UTC
(In reply to Steve Dickson from comment #3)
> (In reply to stein from comment #0)
> > Description of problem:
> > Specify 2 NFS mount entries in /etc/fstab, each with a DNS hostname for the
> > server name.
> > 
> > If 2 different DNS hostnames are specified but both hostnames point to the
> > same IP address, the mount command will use the DNS hostname associated with
> > the first filesystem that is mounted, rather than the hostname specified for
> > each entry.
> > 
> > The output of the df command also shows the incorrect hostname that does not
> > match the /etc/fstab entry
> 
> Why in the world would you want two hostnames pointing to the same IP
> address... That is a DNS misconfiguration... IMHO...


How is having 2 DNS names pointing to the same IP address a DNS misconfiguration?  DNS allows this.  You can have 2 services running on the same server, each with a different hostname.

Comment 5 stein 2016-04-29 12:47:56 UTC
This problem does not occur in RHEL5 or RHEL6.  This bug was introduced in RHEL7.

Comment 6 Steve Dickson 2016-05-19 18:29:25 UTC
(In reply to stein from comment #4)
> (In reply to Steve Dickson from comment #3)
> 
> 
> How is having 2 DNS names pointing to the same IP address a DNS
> misconfiguration?  DNS allows this.  You can have 2 services running on the
> same server, each with a different hostname.

What would be the purpose of having a configuration like this?
Cluster failover or something?

Comment 7 stein 2016-05-19 21:18:03 UTC
A service has a file share associated with it.  That service has multiple instances - dev, qa, prod.

The file share for dev has a DNS name of dev.fileshare.example.com
The file share for qa has a DNS name of qa.fileshare.example.com
The file share for prod has a DNS name of prod.fileshare.example.com

dev.fileshare.example.com & qa.fileshare.example.com share the same server so they both resolve to 192.168.1.1
prod.fileshare.example.com is on its own server and resolves to to 192.168.11.1

Comment 8 Steve Dickson 2016-08-23 16:57:52 UTC
have you tried the 'nosharecache' mount option?

Comment 9 stein 2016-09-06 15:00:23 UTC
Using the legacy caching behavior of 'nosharecache' resolves this.

Comment 10 Steve Dickson 2016-09-12 13:39:36 UTC
Closing due to Comment 9