ceph / ceph-iscsi

Ceph iSCSI tools
GNU General Public License v3.0
63 stars 59 forks source link

Restart rbd-target-api failed when disk does not have owner #211

Open kevinzs2048 opened 4 years ago

kevinzs2048 commented 4 years ago
o- / ......................................................................................................................... [...]
  o- cluster ......................................................................................................... [Clusters: 1]
  | o- ceph .......................................................................................................... [HEALTH_WARN]
  |   o- pools .......................................................................................................... [Pools: 5]
  |   | o- device_health_metrics .................................................... [(x1), Commit: 0.00Y/96235M (0%), Used: 0.00Y]
  |   | o- images .................................................................. [(x1), Commit: 0.00Y/96235M (0%), Used: 16128K]
  |   | o- rbd ........................................................................ [(x1), Commit: 0.00Y/96235M (0%), Used: 64K]
  |   | o- vms ........................................................................ [(x1), Commit: 0.00Y/96235M (0%), Used: 64K]
  |   | o- volumes ...................................................................... [(x1), Commit: 3G/96235M (3%), Used: 320K]
  |   o- topology ................................................................................................ [OSDs: 1,MONs: 1]
  o- disks .......................................................................................................... [3G, Disks: 3]
  | o- volumes ...................................................................................................... [volumes (3G)]
  |   o- volume-54d959c4-347b-4173-9017-4098ecc9bcb0 .................... [volumes/volume-54d959c4-347b-4173-9017-4098ecc9bcb0 (1G)]
  |   o- volume-73473fa5-a9f6-49fc-81f7-cc097af0ce6d .................... [volumes/volume-73473fa5-a9f6-49fc-81f7-cc097af0ce6d (1G)]
  |   o- volume-8a827b7d-f6f3-4687-8cea-24f4dd670a31 .................... [volumes/volume-8a827b7d-f6f3-4687-8cea-24f4dd670a31 (1G)]
  o- iscsi-targets ............................................................................... [DiscoveryAuth: None, Targets: 1]
    o- iqn.1993-08.org.opendev:01:a9aa4032d2c1 ........................................................... [Auth: None, Gateways: 1]
      o- disks .......................................................................................................... [Disks: 3]
      | o- volumes/volume-54d959c4-347b-4173-9017-4098ecc9bcb0 .......................................... [Owner: localhost, Lun: 2]
      | o- volumes/volume-73473fa5-a9f6-49fc-81f7-cc097af0ce6d ................................................... [Owner: , Lun: 1]
      | o- volumes/volume-8a827b7d-f6f3-4687-8cea-24f4dd670a31 .......................................... [Owner: localhost, Lun: 0]
      o- gateways ............................................................................................ [Up: 1/1, Portals: 1]
      | o- localhost ........................................................................................ [192.168.122.184 (UP)]
      o- host-groups .................................................................................................. [Groups : 0]
      o- hosts ....................................................................................... [Auth: ACL_ENABLED, Hosts: 1]
        o- iqn.1993-08.org.debian:01:8a7fa9c0e017 ....................................................... [Auth: CHAP, Disks: 2(2G)]
          o- lun 0 ..................................... [volumes/volume-8a827b7d-f6f3-4687-8cea-24f4dd670a31(1G), Owner: localhost]
          o- lun 1 .............................................. [volumes/volume-73473fa5-a9f6-49fc-81f7-cc097af0ce6d(1G), Owner: ]
/> cd iscsi-targets/iqn.1993-08.org.opendev:01:a9aa4032d2c1/
/iscsi-target...:a9aa4032d2c1> cd disks/
/iscsi-target...032d2c1/disks> ls
o- disks ................................................................................................................ [Disks: 3]
  o- volumes/volume-54d959c4-347b-4173-9017-4098ecc9bcb0 ................................................ [Owner: localhost, Lun: 2]
  o- volumes/volume-73473fa5-a9f6-49fc-81f7-cc097af0ce6d ......................................................... [Owner: , Lun: 1]
  o- volumes/volume-8a827b7d-f6f3-4687-8cea-24f4dd670a31 ................................................ [Owner: localhost, Lun: 0]

Some time in the intermediate state, the disk does not have owner. At this stage if we restart rbd-target-api, it will fail when define_target -> bind_alua_group_to_lun. The access to "owning_gw = disk_config['owner']" at target.py L423 will fail.

kevinzs2048 commented 4 years ago

/assign