-
Notifications
You must be signed in to change notification settings - Fork 28
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
Conversation
# 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): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 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): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
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.
Closing this PR. We are using: |
#99