Code Monkey home page Code Monkey logo

Comments (4)

mikechristie avatar mikechristie commented on August 13, 2024

The iSCSI spec says the name is not case sensitive. The kernel and rtslib will take the capital letters and just convert it to lower case. The user space tools are ignoring the normalized name that rtslib returns and will use the name with capital letters. On deletion we then later mismatch and think we already deleted it.

We should be using the name returned from rtslib.normalize_wwn.

I will make a patch and link it here.

from ceph-iscsi-cli.

mikechristie avatar mikechristie commented on August 13, 2024

Here are some patches which should fix the issue:

ceph/ceph-iscsi#12

For your existing setup with the bad name, I think you are stuck. You can manually delete everything by doing

rados -p rbd rm gateway.conf

then rebooting the iscsi gateways. When they come up it will be with a empty config and no objects.

from ceph-iscsi-cli.

dazhi509 avatar dazhi509 commented on August 13, 2024

thanks. but I found another issue.

1: I make a image in command rbd create iotest/datest --size 10G ,

2: and then I use gwcli to create an iqn, create iqn.1994-05.com.redhat:75c3d5efde0

3: and create a disk create pool=iotest image=datest size=10G which is the same name as i created in command rbd create iotest/datest --size 10G .

4: i add the disk to my iqn in command disk add iotest.datest

5: after all success, i remove the disk, in curl --insecure --user admin:admin -d disk=iotest.datest -X DELETE https://192.168.122.69:5000/api/clientlun/iqn.2017-08.org.ceph:iscsi-gw0,

6: and remove the iqn curl --insecure --user admin:admin -X DELETE https://192.168.122.69:5000/api/client/iqn.1994-05.com.redhat:myhost4

7: then I remove my image in ceph, by doing rbd rm iotest/datest

it seems ok for all I done, but when I try to come in gwcli again, it shows

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 812, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.7/threading.py", line 765, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/site-packages/gwcli/storage.py", line 76, in _get_disk_size
    with rbd.Image(ioctx, image) as rbd_image:
  File "rbd.pyx", line 1397, in rbd.Image.__init__ (/home/jenkins-build/build/workspace/ceph-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/12.2.10/rpm/el7/BUILD/ceph-12.2.10/build/src/pybind/rbd/pyrex/rbd.c:11876)
ImageNotFound: [errno 2] error opening image datest at snapshot None

KeyError: u'iotest.datest'

and gwcli cannot work again!
I find in log that the image ``` datest`` is still in config file:

"disks": {
        "iotest.datest": {
            "created": "2019/01/17 01:10:09",
            "image": "datest",
            "owner": "node3",
            "pool": "iotest",
            "pool_id": 7,
            "updated": "2019/01/17 01:10:09",
            "wwn": "f0b79a61-3470-4b2a-b9e9-f8574410fb13"
        }
}

i use targetcli and it shows that the image I created iotest.datest is still there

/> ls
o- / ......................................................................................................................... [...]
  o- backstores .............................................................................................................. [...]
  | o- block .................................................................................................. [Storage Objects: 0]
  | o- fileio ................................................................................................. [Storage Objects: 0]
  | o- pscsi .................................................................................................. [Storage Objects: 0]
  | o- ramdisk ................................................................................................ [Storage Objects: 0]
  | o- user:glfs .............................................................................................. [Storage Objects: 0]
  | o- user:qcow .............................................................................................. [Storage Objects: 0]
  | o- user:rbd ............................................................................................... [Storage Objects: 2]
  |   o- iotest.rbd-01 ...................................................... [iotest/rbd-01;osd_op_timeout=30 (500.0GiB) activated]
  |   | o- alua ................................................................................................... [ALUA Groups: 4]
  |   |   o- ano2 ............................................................................... [ALUA state: Active/non-optimized]
  |   |   o- ano3 ............................................................................... [ALUA state: Active/non-optimized]
  |   |   o- ao ..................................................................................... [ALUA state: Active/optimized]
  |   |   o- default_tg_pt_gp ....................................................................... [ALUA state: Active/optimized]
  |   o- iotest.datest ........................................................... [iotest/datest;osd_op_timeout=30 (10.0GiB) activated]
  |     o- alua ................................................................................................... [ALUA Groups: 4]
  |       o- ano1 ............................................................................... [ALUA state: Active/non-optimized]
  |       o- ano3 ............................................................................... [ALUA state: Active/non-optimized]
  |       o- ao ..................................................................................... [ALUA state: Active/optimized]
  |       o- default_tg_pt_gp ....................................................................... [ALUA state: Active/optimized]

I have suffered from this issue for a while.

I think I cannot delete any ceph image if this image ever map to an iqn in case of gwcli goes wrong.

from ceph-iscsi-cli.

mikechristie avatar mikechristie commented on August 13, 2024

It's not supported to mix different methods.

from ceph-iscsi-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.