Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix disk owner access fail #212

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions ceph_iscsi_config/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ def bind_alua_group_to_lun(self, config, lun, tpg_ip_address=None):

disk_config = [disk for _, disk in config.config['disks'].items()
if disk['backstore_object_name'] == stg_object.name][0]
owning_gw = disk_config['owner']
tpg = lun.parent_tpg

if not tpg_ip_address:
Expand All @@ -436,13 +435,15 @@ def bind_alua_group_to_lun(self, config, lun, tpg_ip_address=None):
target_config = config.config["targets"][self.iqn]

is_owner = False
gw_config = target_config['portals'].get(owning_gw, None)
# If the user has exported a disk through multiple targets but
# they do not have a common gw the owning gw may not exist here.
# The LUN will just have all ANO paths then.
if gw_config:
if tpg_ip_address in gw_config["portal_ip_addresses"]:
is_owner = True
owning_gw = disk_config.get('owner')
if owning_gw:
gw_config = target_config['portals'].get(owning_gw, None)
# If the user has exported a disk through multiple targets but
# they do not have a common gw the owning gw may not exist here.
# The LUN will just have all ANO paths then.
if gw_config:
if tpg_ip_address in gw_config["portal_ip_addresses"]:
is_owner = True

try:
alua_tpg = alua_create_group(settings.config.alua_failover_type,
Expand Down