ceph / ceph-iscsi-cli

NOTICE: moved to https://github.com/ceph/ceph-iscsi
GNU General Public License v3.0
25 stars 25 forks source link

hostgroup issue #56

Closed vatelzh closed 6 years ago

vatelzh commented 6 years ago

o- host-groups ......................................................................... [Groups : 1] | o- linux ..................................................................... [Hosts: 1, Disks: 1] | | o- iqn.2016-04.com.test.sn2 ................................................................ [host] | | o- rbd.disk9 ............................................................................. [disk] o- hosts ................................................................................. [Hosts: 2] o- iqn.2016-04.com.test.sn1 ............................................. [Auth: CHAP, Disks: 1(16G)] | o- lun 0 ........................................................... [rbd.disk9(16G), Owner: gw2] o- iqn.2016-04.com.test.sn2 ............................................. [Auth: None, Disks: 1(16G)] o- lun 0 ........................................................... [rbd.disk9(16G), Owner: gw2]

I added two hosts and a disk to hostgroup linux, and I removed a host from the group. The relationship between host and lun is still existing, and I can't add this host to group again. Is this a bug?

pcuzner commented 6 years ago

No it's not a bug. The idea is that once a host is a member of a group, that's where lun allocation policy is done. When you remove a host from a host group, the luns allocated still remain since we don't know whether there are services still running on the host that require the luns - so leaving them there is the safe thing to do.

Maybe you could raise an RFE for a purge option, so the host is removed from the group and it's luns get removed as a non-default behavior?

You can't add a host with luns to a host group, since it's luns and lun-ids may conflict with the lun policy and lun-id's within the host group. To add a host it needs to be unused ie. no luns allocated. With a host group the luns and lun-ids are the same for all members of the group - that's why the host needs to be 'empty'.

vatelzh commented 6 years ago

Thanks for your answer. Very clearly.

letterwuyu commented 6 years ago

@vatelzh, I'm sorry to disturb you, I want to ask you that your group added host has come into effect?When I add host and disk for group, I quit gwcli, and then from new entry, I find that the configuration of host and disk on group has disappeared.

vatelzh commented 6 years ago

I'm sorry to disturb you, I want to ask you that your group added host has come into effect?

@letterwuyu yes.

When I add host and disk for group, I quit gwcli, and then from new entry, I find that the configuration of host and disk on group has disappeared.

could you show the output of gwcli and targetcli and using rados -p rbd get gateway.conf gateway.conf to checkout if the relationship is in this file.

letterwuyu commented 6 years ago

@vatelzh thanks for your answer.