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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/vdsm/storage/mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,13 @@ def getRecord(self):
fs_specs = self.fs_spec, None

for record in _iterMountRecords():
if self.fs_file == record.fs_file and record.fs_spec in fs_specs:
if self.fs_file == record.fs_file:
# Note: We cannot compare fs_spec, as some file
# systems will record _different_ information in
# /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

return record

raise OSError(errno.ENOENT,
Expand Down
Loading