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

Optimize the speed of creating disks #100

Closed
wants to merge 1 commit into from

Conversation

swimfish09
Copy link

#99

# process each storage object added to the gateway, and map to the tpg
for stg_object in lio_root.storage_objects:

for tpg in self.tpg_list:
self.logger.debug("processing tpg{}".format(tpg.tag))

if not self.lun_mapped(tpg, stg_object):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this patch what is the creation time now?

What part of lun_mapped was the issue? Was it constantly scanning the lun dir in configfs or something else?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before:
image
after:
image

# process each storage object added to the gateway, and map to the tpg
for stg_object in lio_root.storage_objects:

for tpg in self.tpg_list:
self.logger.debug("processing tpg{}".format(tpg.tag))

if not self.lun_mapped(tpg, stg_object):
if not tpg_stg_object_dict.has_key(str(tpg.tag) + "-" + stg_object.name):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we actually need to call lun_mapped for this as LUN() checks if the object is already mapped for us. We could just do:

for stg_object in lio_root.storage_objects:
    for tpg in self.tpg_list:
        try:
            mapped_lun = LUN(tpg, lun=lun_id, storage_object=stg_object)
            ....
        except RTSLibError as err:
            if "already exists in configFS" not in str(err):
                self.logger.error("LUN mapping failed: {}".format(err))
                self.error = True
                self.error_msg = str(err)
                return

           #Already created. Ignore and loop to the next tpg.
           continue
.....

Oh yeah, could your post your patch to this GH:

https://github.com/ceph/ceph-iscsi

instead of ceph-iscsi-config/cli?

ceph-iscsi is the repo that will be used going forward. ceph-iscsi-config/cli is more only used for a older version of the tools/lib.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when catch a exception, configuration will be cleaned and the program exit.

@mikechristie
Copy link
Contributor

Closing this PR. We are using:

ceph/ceph-iscsi#17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants