Open klamontagne opened 9 years ago
Feel free to send a PR that sorts the mons, as a workaround. The cookbook should learn how to delete the old line from fstab and add a new line with the new mons in case the actual mons change, but I'm not sure how to do that.
The line in fstab could be tagged with an option or a comment, but I can't think of a way to do that with the mount resource. The mount point itself could be considered such a tag.
There are a couple of "clever" ways to work around the problem in a wrapper cookbook, such as
The :mount action could be disabled if it manually checks that there is something mounted at that mountpoint. That will prevent problems of busy mounts when switching mons around. Before the mount:enable action happens, it could clip out any existing ceph mounts for the same mountpoint from the fstab file. Changing from kcephfs to fuse.ceph, for example, wouldn't be very automated. A user could make their own wrapper cookbook to run once and unmount the old mode. Otherwise, I think it would be safe to just edit fstab and then rely on reboots or have the user manually remount. I think that's about all it can do towards #171
What do you think?
I do indeed have a basic workaround in my wrapper for this recurring problem.
mountpath = Pathname.new(node['ceph']['cephfs_mount'])
ceph_cephfs node['ceph']['cephfs_mount'] do
use_fuse node['ceph']['cephfs_use_fuse']
if mountpath.mountpoint?
action :enable
else
action [:enable, :mount]
end
end
I currently have the following mounted fs in my fstab:
chef-client tries to mount the "new" fs and mount exits unsuccessfuly:
It seems that the order of mons is not kept between runs. (1,3,4,2 vs 1,4,3,2)