Description of problem: The ceph_volume_client always creates snapshots in '.snap' folder. But the snapshot folder name can be modified using `client_snapdir` config setting. Need to let ceph_volume_client fetch the `client_snapdir` option, and use that to create snapshots. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Steps to verify the fix, //Create a ceph auth ID # ceph auth get-or-create client.bangalore mds 'allow *' mon 'allow *' osd 'allow rw' -o /etc/ceph/ceph.client.bangalore.keyring //Append the following to the client's ceph.conf file to set //snapshot dir as '.mgroad' for client.bangalore [client.bangalore] client_mount_uid = 0 client_mount_gid = 0 client_snapdir = .mgroad // Now try creating a snapshot 'snapshot00' of a Ceph dir 'share00' // using python ceph_volume_client. // ceph_volume_client module is part of `python-cephfs` package // and it's a wrapper around librados/libcephfs // In python2.x interpreter you run the following commands to do so >>> import ceph_volume_client >>> vc = ceph_volume_client.CephFSVolumeClient('bangalore', '/etc/ceph/ceph.conf', 'ceph') >>> vc.connect() >>> volpath = ceph_volume_client.VolumePath(None, 'share00') >>> volume = vc.create_volume(volpath, 5) >>> volsnap = vc.create_snapshot_volume(volpath, 'snapshot00') >>> vc.disconnect() // Mount the Ceph file system via fuse using ID 'bangalore' # sudo ceph-fuse --id=bangalore /mnt/ceph-fuse // Check whether snapshot 'snapshot00' is created within // '.mgroad' snapdir # cd /mnt/ceph-fuse/ // Get into the directory 'share00' # cd volumes/_nogroup/share00/ // Its snapshot should be in the desired snapdir and not // in the default '.snap' snapdir # cd .mgroad # ls snapshot00 // You should be able to see the 'snapshot00'
(In reply to Ram Raja from comment #18) Please do the following in your client machine. > Steps to verify the fix, > > //Create a ceph auth ID > # ceph auth get-or-create client.bangalore mds 'allow *' mon 'allow *' osd > 'allow rw' -o /etc/ceph/ceph.client.bangalore.keyring > > //Append the following to the client's ceph.conf file to set > //snapshot dir as '.mgroad' for client.bangalore > [client.bangalore] > client_mount_uid = 0 > client_mount_gid = 0 > client_snapdir = .mgroad > > // Now try creating a snapshot 'snapshot00' of a Ceph dir 'share00' > // using python ceph_volume_client. > // ceph_volume_client module is part of `python-cephfs` package > // and it's a wrapper around librados/libcephfs > // In python2.x interpreter you run the following commands to do so > >>> import ceph_volume_client > >>> vc = ceph_volume_client.CephFSVolumeClient('bangalore', '/etc/ceph/ceph.conf', 'ceph') > >>> vc.connect() > >>> volpath = ceph_volume_client.VolumePath(None, 'share00') > >>> volume = vc.create_volume(volpath, 5) > >>> volsnap = vc.create_snapshot_volume(volpath, 'snapshot00') > >>> vc.disconnect() > > > // Mount the Ceph file system via fuse using ID 'bangalore' > # sudo ceph-fuse --id=bangalore /mnt/ceph-fuse > > // Check whether snapshot 'snapshot00' is created within > // '.mgroad' snapdir > # cd /mnt/ceph-fuse/ > > // Get into the directory 'share00' > # cd volumes/_nogroup/share00/ > > // Its snapshot should be in the desired snapdir and not > // in the default '.snap' snapdir > # cd .mgroad > # ls > snapshot00 > > // You should be able to see the 'snapshot00'
Thanks for the verification steps. Moving this bug to verified state.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:3387