Project

General

Profile

Bug #46138

mgr/dashboard: Error creating iSCSI target

Added by Ricardo Marques 4 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Category:
cephadm
Target version:
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

Description

On the latest `master` (pacific), I get the following error when trying to create an iSCSI target in Dashboard:

From mgr logs:

Jun 22 12:20:32 master bash[16203]: dashboard.rest_client.RequestException: iscsi REST API failed request with status code 500
Jun 22 12:20:32 master bash[16203]: (b'{"message":"Unhandled exception: [errno 1] RBD permission error (error openi'
Jun 22 12:20:32 master bash[16203]:  b'ng image b\'rbd1\' at snapshot None)"}\n')
Jun 22 12:20:32 master bash[16203]: During handling of the above exception, another exception occurred:
Jun 22 12:20:32 master bash[16203]: Traceback (most recent call last):
Jun 22 12:20:32 master bash[16203]:   File "/usr/share/ceph/mgr/dashboard/services/exception.py", line 94, in dashboard_exception_handler
Jun 22 12:20:32 master bash[16203]:     return handler(*args, **kwargs)
Jun 22 12:20:32 master bash[16203]:   File "/usr/lib/python3.6/site-packages/cherrypy/_cpdispatch.py", line 54, in __call__
Jun 22 12:20:32 master bash[16203]:     return self.callable(*self.args, **self.kwargs)
Jun 22 12:20:32 master bash[16203]:   File "/usr/share/ceph/mgr/dashboard/controllers/__init__.py", line 665, in inner
Jun 22 12:20:32 master bash[16203]:     ret = func(*args, **kwargs)
Jun 22 12:20:32 master bash[16203]:   File "/usr/share/ceph/mgr/dashboard/controllers/__init__.py", line 860, in wrapper
Jun 22 12:20:32 master bash[16203]:     return func(*vpath, **params)
Jun 22 12:20:32 master bash[16203]:   File "/usr/share/ceph/mgr/dashboard/controllers/__init__.py", line 467, in wrapper
Jun 22 12:20:32 master bash[16203]:     raise ex
Jun 22 12:20:32 master bash[16203]:   File "/usr/share/ceph/mgr/dashboard/controllers/__init__.py", line 457, in wrapper
Jun 22 12:20:32 master bash[16203]:     status, value = task.wait(self.wait_for)
Jun 22 12:20:32 master bash[16203]:   File "/usr/share/ceph/mgr/dashboard/tools.py", line 648, in wait
Jun 22 12:20:32 master bash[16203]:     raise self.exception
Jun 22 12:20:32 master bash[16203]:   File "/usr/share/ceph/mgr/dashboard/tools.py", line 559, in _run
Jun 22 12:20:32 master bash[16203]:     val = self.task.fn(*self.task.fn_args, **self.task.fn_kwargs)  # type: ignore
Jun 22 12:20:32 master bash[16203]:   File "/usr/share/ceph/mgr/dashboard/controllers/iscsi.py", line 300, in create
Jun 22 12:20:32 master bash[16203]:     clients, groups, 0, 100, config, settings)
Jun 22 12:20:32 master bash[16203]:   File "/usr/share/ceph/mgr/dashboard/controllers/iscsi.py", line 767, in _create
Jun 22 12:20:32 master bash[16203]:     raise DashboardException(msg=content_message, component='iscsi')

2020-06-22_11-24-29.png View (55.9 KB) Ricardo Marques, 06/22/2020 10:47 AM

History

#1 Updated by Ricardo Marques 4 months ago

This is not a Dashboard issue because I get the same error when using `gwcli` tool:

master:~ # cephadm enter --name iscsi.iscsi_service.master.qrbvqp
INFO:cephadm:Inferring fsid 89521eb2-b471-11ea-b9e7-525400fa1bc3
[ceph: root@master /]# gwcli
/disks> attach mypool rbd1
Failed : Unhandled exception: [errno 1] RBD permission error (error opening image b'rbd1' at snapshot None)

#2 Updated by Ricardo Marques 4 months ago

  • Project changed from mgr to Orchestrator
  • Category changed from dashboard/iscsi to cephadm

#3 Updated by Matthew Oliver 4 months ago

  • Assignee set to Matthew Oliver

oh interesting, maybe there's another cap we're missing? We did lock it down some. Let me have a play and attempt to recreate.

#4 Updated by Matthew Oliver 4 months ago

I managed to recreate the issue. We lock down the caps to just have access to the pool in the config. If I create an RBD image in that pool it all works. If I create a separate rbd pool, create an image and try and attach that it'll fail as did in this bug.

So are you attempting to attach an image from another pool?

In my test env, I've created an iscsi pool for ceph-iscsi to use and so the generated cap is:

client.iscsi.test.ironic-moliver.vakabs
        key: AQBT8PNe5/aHCBAAkEFPOayDCjBp9b7OpRXTFA==
        caps: [mon] profile rbd, allow command "osd blacklist", allow command "config-key get" with "key" prefix "iscsi/" 
        caps: [osd] allow rwx pool=iscsi

We could just remove the `pool=iscsi` and open it up to all pools. In fact I did just that. if I remove the pool statement from osd. It all works.

Do we want to remove it? Are we too locked down?

#5 Updated by Sebastian Wagner 4 months ago

[12:11:22] <Lenz[m]> SebastianW: I'd assume that we only show pools that have the "rbd" application label attached in the iSCSI target creation
[12:12:14] <SebastianW> ok!

I think we have to remove it. yes

#6 Updated by Matthew Oliver 4 months ago

kk, will remove it :)

#7 Updated by Sebastian Wagner 4 months ago

  • Status changed from New to Pending Backport

#8 Updated by Sebastian Wagner 4 months ago

  • Pull request ID set to 35786

#9 Updated by Sebastian Wagner 3 months ago

  • Status changed from Pending Backport to Resolved
  • Target version set to v15.2.5

Also available in: Atom PDF