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

Fail gracefully if target/lun count is above 256 for CORE #27

Open
william-gr opened this issue Nov 9, 2022 · 4 comments
Open

Fail gracefully if target/lun count is above 256 for CORE #27

william-gr opened this issue Nov 9, 2022 · 4 comments
Assignees

Comments

@william-gr
Copy link
Contributor

It depends on kern.cam.ctl.max_ports tunable.

@databunnysg
Copy link
Contributor

Noted! Start investigation!

@YiHuangDB
Copy link
Contributor

A first round of assessment:
Set kern.cam.ctl.max_luns 4 kern.cam.ctl.max_ports 4 and ctl_load YES in truenas core 12 tunable, I can see those variables updated after reboot. I can create more than 5 volumes using cinder driver. When not change freebsd default value kern.cam.ctl.max_ports 256, I can create >256 volumes using cinder driver. And use iscsiadm I can attach >5 iscsi target sessions from client os, and >256 iscsi target sessions successfully.
I am further looking into any negative effects from openstack operations for kern.cam.ctl.max_ports and kern.cam.ctl.max_luns.

@YiHuangDB
Copy link
Contributor

Here is summary of existing TrueNAS cinder driver behaviors under different kern.cam.ctl.max_ports/kern.cam.ctl.max_luns configurations:

  1. When Openstack TrueNAS volume total number > kern.cam.ctl.max_ports/kern.cam.ctl.max_luns, openstack create or delete TrueNAS volume successful.
  2. When Openstack TrueNAS attached volumes total number > kern.cam.ctl.max_ports or kern.cam.ctl.max_luns, openstack attach or detach TrueNAS volume action timeout then failed.

Looking for further resolution for this issue.

@YiHuangDB
Copy link
Contributor

YiHuangDB commented Dec 24, 2022

Some update:

The actual attach/detach volume action timeout is happening in upstream cinder code here:
https://github.com/openstack/cinder/blob/392e27aa950374041fbfc827a160f835fd438e70/cinder/volume/driver.py#L1129
And then further os-brick upstream actual exception throw here:
https://github.com/openstack/os-brick/blob/a519dd8d07a65896b6151087c6b38b5294129bb6/os_brick/initiator/connectors/iscsi.py#L505

The possible solution without impact upstream code is to check cinder attached volume count < kern.cam.ctl.max_ports/kern.cam.ctl.max_luns here before return connection meta to upstream and fail gracefully:

def initialize_connection(self, volume, connector):

Working on actual code fix.

YiHuangDB added a commit to YiHuangDB/cindertruenas that referenced this issue Dec 28, 2022
YiHuangDB added a commit to YiHuangDB/cindertruenas that referenced this issue Dec 28, 2022
databunnysg pushed a commit to databunnysg/iXsystemscinder that referenced this issue Dec 28, 2022
william-gr added a commit that referenced this issue Jan 18, 2023
#27 fix , #23 pep8 compliance and minor fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants