Bug 1916138 - [RFE] Add support of "namespace" parameter for ocf:ceph:rbd
Summary: [RFE] Add support of "namespace" parameter for ocf:ceph:rbd
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: RBD
Version: 5.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 5.0
Assignee: Ilya Dryomov
QA Contact: Harish Munjulur
Ranjini M N
URL:
Whiteboard:
Depends On: 1939231
Blocks: 1959686
TreeView+ depends on / blocked
 
Reported: 2021-01-14 10:07 UTC by Josef Zimek
Modified: 2024-03-25 17:50 UTC (History)
7 users (show)

Fixed In Version: ceph-16.1.0-486.el8cp
Doc Type: Enhancement
Doc Text:
.ocf:ceph:rbd cluster resource agent supports namespaces Previously, it was not possible to use ocf:ceph:rbd cluster resource agent for images that exist within a namespace. With this release, the new `pool_namespace` resource agent parameter can be used to handle images within the namespace.
Clone Of:
Environment:
Last Closed: 2021-08-30 08:27:52 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Ceph Project Bug Tracker 48964 0 None None None 2021-01-22 15:33:58 UTC
Red Hat Issue Tracker RHCEPH-1217 0 None None None 2021-08-30 00:17:17 UTC
Red Hat Product Errata RHBA-2021:3294 0 None None None 2021-08-30 08:28:07 UTC

Description Josef Zimek 2021-01-14 10:07:55 UTC
Description of problem:

Resource type ocf:ceph:rbd is provided by ceph package (/src/ocf/rbd.in) and supports following options:

  name (required): Name of the RBD device.
  pool: Name of the RADOS pool where the RBD has been created
  snap: Name of the device snapshot to map.
  cephconf: Location of the Ceph configuration file
  mon: Address (or comma-separated list of addresses) of monitor servers to connect to. Overrides values from configuration file.
  user: Username to use when mapping the device. Required if Ceph authentication is enabled on the monitor.
  secret: File containing an authentication secret. Required if Ceph authentication is enabled on the monitor.


However if user utilizes ceph cluster with rbd pool and namespaces he/she cannot create resource with namespace and therefore resource doesn't work.

Add support of "namespace" parameter for ocf:ceph:rbd resource type.


Version-Release number of selected component (if applicable):
ceph-12.2.7-9.el8

Comment 2 Jason Dillaman 2021-01-21 21:40:33 UTC
Resetting to RHCS product / RBD component as this OCF resource agent is distributed under RHCS via the "ceph-resource-agents" package.

Comment 6 Harish Munjulur 2021-03-13 19:32:53 UTC
Verified the RFE. Steps followed are as below:

[ceph: root@magna021 ~]# ceph osd pool application enable rbd rbd
enabled application 'rbd' on pool 'rbd'
[ceph: root@magna021 ~]# rbd pool init -p rbd
[ceph: root@magna021 ~]# rbd namespace ls
[ceph: root@magna021 ~]# rbd namespace create --namespace testnamespace
[ceph: root@magna021 ~]# rbd namespace create --namespace othernamespace
[ceph: root@magna021 ~]# rbd namespace ls --format=json
[{"name":"othernamespace"},{"name":"testnamespace"}]
[ceph: root@magna021 ~]# ceph auth get-or-create client.rbduser mon 'profile rbd' osd 'profile rbd pool=rbd namespace=testnamespace' -o /etc/ceph/client.rbduser.keyring
[ceph: root@magna021 ~]# ceph auth get-or-create client.otheruser mon 'profile rbd' osd 'profile rbd pool=rbd namespace=othernamespace' -o /etc/ceph/client.otheruser.keyring
[ceph: root@magna021 ~]# ceph auth get client.rbduser
exported keyring for client.rbduser
[client.rbduser]
	key = AQBGEU1gGcVGHxAAY/uKb+KieMfaar1xXxe2/g==
	caps mon = "profile rbd"
	caps osd = "profile rbd pool=rbd namespace=testnamespace"
[ceph: root@magna021 ~]# ceph auth get client.otheruser
exported keyring for client.otheruser
[client.otheruser]
	key = AQBPEU1gg40yHxAAeRtTr++xahZJiCgS4PgIsA==
	caps mon = "profile rbd"
	caps osd = "profile rbd pool=rbd namespace=othernamespace"
[ceph: root@magna021 ~]# rbd create --namespace testnamespace rbdimg1 --size 1G
[ceph: root@magna021 ~]# rbd create --namespace othernamespace rbdimg2 --size 1G
[ceph: root@magna021 ~]# rbd ls --long
NAME        SIZE     PARENT  FMT  PROT  LOCK
data-disk1  200 GiB            2            
fio_test      2 GiB            2            
rbd_pool      1 GiB            2            
[ceph: root@magna021 ~]# rbd --namespace testnamespace ls --long
NAME     SIZE   PARENT  FMT  PROT  LOCK
rbdimg1  1 GiB            2            
[ceph: root@magna021 ~]# rbd --namespace othernamespace ls --long
NAME     SIZE   PARENT  FMT  PROT  LOCK
rbdimg2  1 GiB            2            
[ceph: root@magna021 ~]# rbd map --namespace testnamespace rbdimg1  -n  client.rbduser --keyring=/etc/ceph/client.rbduser.keyring
/dev/rbd1
[ceph: root@magna021 ~]# rbd map --namespace othernamespace rbdimg2 -n client.otheruser --keyring=/etc/ceph/client.otheruser.keyring
/dev/rbd2
[ceph: root@magna021 ~]# rbd showmapped
id  pool       namespace       image    snap  device   
0   testbench                  image01  -     /dev/rbd0
1   rbd        testnamespace   rbdimg1  -     /dev/rbd1
2   rbd        othernamespace  rbdimg2  -     /dev/rbd2

Comment 9 Harish Munjulur 2021-03-15 19:11:17 UTC
package missing have raised BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1939231

Comment 12 Harish Munjulur 2021-03-31 19:46:29 UTC
Verified working as expected: change in the below command "namespace" should be "pool_namespace"

# pcs resource create rbd_map_gsitlani ocf:ceph:rbd user=“admin” pool=“rbd” name="test-rbd" cephconf=“/etc/ceph/ceph.conf” pool_namespace="node1" op monitor interval=“10s” timeout=“20s”

Thanks gsitlani++ for the help with steps.

Comment 17 errata-xmlrpc 2021-08-30 08:27:52 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 (Red Hat Ceph Storage 5.0 bug fix and enhancement), 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-2021:3294


Note You need to log in before you can comment on or make changes to this bug.