Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
This project is now read‑only. Starting Monday, February 2, please use https://ibm-ceph.atlassian.net/ for all bug tracking management.

Bug 1494980

Summary: pybind/ceph_volume_client: snapshot dir name hardcoded
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Ram Raja <rraja>
Component: CephFSAssignee: Ram Raja <rraja>
Status: CLOSED ERRATA QA Contact: Ramakrishnan Periyasamy <rperiyas>
Severity: low Docs Contact:
Priority: medium    
Version: 3.0CC: ceph-eng-bugs, ceph-qe-bugs, hnallurv, john.spray, kdreyer, pdonnell, tserlin, vakulkar
Target Milestone: rc   
Target Release: 3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: RHEL: ceph-12.2.1-3.el7cp Ubuntu: ceph_12.2.1-10redhat1xenial Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-05 23:45:31 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 Ram Raja 2017-09-24 15:14:58 UTC
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:

Comment 18 Ram Raja 2017-10-24 15:03:26 UTC
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'

Comment 19 Ram Raja 2017-10-24 15:05:20 UTC
(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'

Comment 20 Ramakrishnan Periyasamy 2017-10-25 08:24:09 UTC
Thanks for the verification steps.

Moving this bug to verified state.

Comment 23 errata-xmlrpc 2017-12-05 23:45:31 UTC
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