Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Ceph mount using DNS name #142

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KarlJorgensen
Copy link

@KarlJorgensen KarlJorgensen commented Apr 19, 2022

Case in point: For Ceph file systems, the mount command can look like this:

mount -t ceph -o mds_namespace=ns1,name=ovirt,secret=xxx monitors.storage.example.com:/ /mnt

but the resulting entry in /proc/mounts will NOT look identical, as ceph will resolve DNS names into their IP addresses:

192.168.1.5,192.168.1.6,192.168.1.7:/ /mnt ceph rw,seclabel,relatime,name=ovirt,secret=<hidden>,acl,mds_namespace=ovirt 0 0

(in this example monitors.storage.example.com was a DNS entry
resolving to 3 IP addresses).

Lesson learned: We cannot rely on mount options being carried
unmolested into /proc/mounts...

Bug-Url: https://bugzilla.redhat.com/1995610

@nirs nirs changed the title Fix for https://bugzilla.redhat.com/show_bug.cgi?id=1995610 Support Ceph mount using DNS name Apr 20, 2022
# /proc/mounts than was given to the mount command...
#
# E.g. ceph will resolve DNS names given into IP
# addresses to be presented in /proc/mounts...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 2 issues with this change:

  1. It affects all kinds of mounts to solve a ceph specific issue. We need a fix that does not change the system behavior with other mounts.
  2. Even for ceph mount, this is incorrect. With this change if you have 2 ceph mounts, one mounted and one not, mounting the second mount will fail since we will consider it as mounted, comparing only the remote file part "/", which is same in both mounts.

I think that what we learn from this is not that we cannot expect to find the mount options in /proc/mounts, but that we cannot work with ceph mounts since they behave in a non-standard way.

We need a way to detect if a mount is mounted. The current code accept a "server:path" format and mount it at /rhev/data-center/mnt/srever:path. Since mounts can become stale, and can be unmounted, we must make sure that /rhev/data-center/mnt/srever:path is mounted, and that the remove server and path match.

In summary, a fix must not change anything for other storage, and provide a good way to match the mount with the server:path. A possible solution can be resolving the DNS name before the mount so the local mount path will match /proc/mounts. Or maybe a change in ceph to disable resolving before the mount.

This change also break the tests:
https://github.com/oVirt/vdsm/actions/runs/2192442081

Case in point: For Ceph file systems, the mount command can look like
this:

    mount -t ceph -o mds_namespace=ns1,name=ovirt,secret=xxx monitors.storage.example.com:/ /mnt

but the resulting entry in /proc/mounts will NOT look identical, as
ceph will resolve DNS names into their IP addresses:

    192.168.1.5,192.168.1.6,192.168.1.7:/ /mnt ceph rw,seclabel,relatime,name=ovirt,secret=<hidden>,acl,mds_namespace=ovirt 0 0

(in this example "monitors.storage.example.com" was a DNS entry
resolving to 3 IP addresses).

Lesson learned: We cannot rely on mount options being carried
unmolested into /proc/mounts...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants