Project

General

Profile

Bug #25619

Validate LUN ID for associated targets

Added by Shawn Cox about 1 year ago. Updated 11 months ago.

Status:
Resolved
Priority:
Important
Assignee:
William Grzybowski
Category:
OS
Target version:
Seen in:
TrueNAS - TrueNAS-11.0-U2.1
Sprint:
Severity:
New
Backlog Priority:
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

Dropdown menu provides 0-24. You can add a number greater than 24, and the web gui will display it but when you go to edit the number shows 0.

Also, Josh S. mentioned we support up to 65K or so? An ID of 10,000 or generates the following console error:
error in configuration file at line 30 near '"test"': LU number is too big

It will still display the customer value then show 0 on edit.

lunid250.jpg (28.9 KB) lunid250.jpg Shawn Cox, 08/17/2017 06:43 PM
lunid10000.jpg (50.7 KB) lunid10000.jpg Shawn Cox, 08/17/2017 06:44 PM
editkeepslunid.png (26.2 KB) editkeepslunid.png after edit, lunid is not defaulted to 0 Rishabh Chauhan, 11/06/2017 05:50 PM
lun_guide.png (33.6 KB) lun_guide.png lunid limit stated in docs Rishabh Chauhan, 11/06/2017 05:50 PM
lunid2023to2024.png (30.3 KB) lunid2023to2024.png boundary condition Rishabh Chauhan, 11/06/2017 05:50 PM
lunid10000.png (28.4 KB) lunid10000.png check if lunid is greater than 1023 Rishabh Chauhan, 11/06/2017 05:50 PM
12186
12187
12937
12938
12939
12940

Associated revisions

Revision 11175beb (diff)
Added by William Grzybowski about 1 year ago

feat(gui): make LUN ID a free form text field and validate it

Ticket: #25619

Revision d93082ce (diff)
Added by William Grzybowski about 1 year ago

fix(gui): iscsi_lunid is not required

Ticket: #25619

Revision 69adc2ed (diff)
Added by William Grzybowski about 1 year ago

feat(gui): make LUN ID a free form text field and validate it

Ticket: #25619

Revision b4a68a15 (diff)
Added by William Grzybowski about 1 year ago

fix(gui): iscsi_lunid is not required

Ticket: #25619

Revision 55c90cd2 (diff)
Added by Dru Lavigne about 1 year ago

Fine-tune LUN ID values description.
Ticket: #25619

History

#1 Updated by Dru Lavigne about 1 year ago

  • Status changed from Untriaged to 15

The docs team recently confirmed this for the Guide: "select the value of the ID or type in the desired value; FreeNAS® supports up to 1024 LUNs".

Does it not allow you to type in a number between 0-1024?

#2 Updated by Cyber Jock about 1 year ago

  • Target version set to 11.0-U3

There's multiple problems. While I agree the doc team should have some stuff added, I think we need to collectively discuss what the proper behavior should be and what the limits are for us with LUN IDs. So let me explain...

First problem:

My understanding is that our iscsi LUN ID limit is either 255(or 254, something around there) or something like 65535. My admittedly hasty google search found https://forums.freebsd.org/threads/45857/ which claims an 8-bit number per the iscsi protocol for LUN ID values, which would be 255 LUNs. This doesn't seem to be documented anywhere, and the WebGUI doesn't seem to give much of a clue what the limit is, but the dropdown only goes to 24. So to a casual observer we seem to be limited to 24 LUNs.

1. We should definitely document the maximum number of allowed LUNs in the manual for future reference, after validating if the limit is truly 255. (mav probably knows this off the top of his head)
2. The WebGUI needs to either give us the options for the full 255 or not use a dropdown and have us type the number.

Second problem:

If we enter a value higher than 24, but less than 255 we can save the changes and all is well. If we then choose to edit the associated targets by clicking on an associated target and clicking the 'edit' button the LUN ID will have changed to zero. If we don't realize that the value has actually changed without our intervention, we could accidentally lose access to that LUN when we click 'Okay' to save the changes. Not to mention possibly have 2 different associated targets compete for the same LUN value. I think we can all agree that if you go to edit the associated target settings, the window should show us the current values, not modified values.

I'm guessing that since the WebGUI defaults to listing only the first 24 numbers, something gets angry when you choose something outside its designed range.

Third problem:

If we enter a value higher than 255, the WebGUI will let us do that and will not validate that our input makes sense and the LUN will never be accessible. This generated the error Shawn mentioned above, "error in configuration file at line 30 near '"test"': LUN number is too big" in the footer and /var/log/messages. However not all customers enable the footer, so they would see a silent failure of their iscsi services.

I hope this explains it all. So I think:

1. mav needs to tell us what the limit actually is.
2. doc team update the manual with the maximum allowed LUN ID.
2. dev team needs to fix the WebGUI to validate the inputs and not have the WebGUI change values on us without human input.

I had to put a target version as it is a required field, so I chose 11.0-U3. Please change it as appropriate.

#3 Updated by Dru Lavigne about 1 year ago

  • Status changed from 15 to Unscreened
  • Assignee changed from Release Council to William Grzybowski

#4 Updated by William Grzybowski about 1 year ago

  • Status changed from Unscreened to 15
  • Priority changed from No priority to Important
  • Target version changed from 11.0-U3 to TrueNAS 11.1-U1

Alexander Motin, can you tell us what the LUN ID limit is?

#5 Updated by Dru Lavigne about 1 year ago

  • Assignee changed from William Grzybowski to Alexander Motin

#6 Updated by Alexander Motin about 1 year ago

  • Status changed from 15 to Unscreened
  • Assignee changed from Alexander Motin to William Grzybowski

CTL limit on maximal LUN is controlled by tunable/sysctl kern.cam.ctl.lun_map_size. Its default value is 1024, which allows LUNs from 0 to 1023. Limitation of first 256 LUNs (0-255) often happen on initiator side (VMware, Windows, etc.), as a limitation of historical "Single level LUN structure using peripheral device addressing method".

So ideal it would be to report error if entered value is >= kern.cam.ctl.lun_map_size, and possibly warning if it is above 255.

#7 Updated by William Grzybowski about 1 year ago

  • Project changed from TrueNAS to FreeNAS
  • Category changed from OS to OS
  • Target version deleted (TrueNAS 11.1-U1)

Changing to FreeNAS since its not TN specific.

#8 Updated by William Grzybowski about 1 year ago

  • Status changed from Unscreened to Screened
  • Target version set to 11.1

#9 Updated by William Grzybowski about 1 year ago

  • Status changed from Screened to Ready For Release

#11 Updated by Dru Lavigne about 1 year ago

  • Subject changed from LUN ID for associated targets to Validate LUN ID for associated targets

#12 Updated by Dru Lavigne about 1 year ago

  • Target version changed from 11.1 to 11.1-BETA1

#13 Updated by Dru Lavigne 12 months ago

  • Status changed from Ready For Release to Resolved

#14 Updated by Rishabh Chauhan 11 months ago

12937
12938
12939
12940

After reading through the comments and testing it, I was able to conclude that while editing the Id does not change to '0' by default, shown in figure with lunid 56.
Also, since supported lunId is 0-1023, i tried to put 10000 as id, i got a clear error stating the limits, I tested the boundary condition as well, i.e 1023 and 1024 and the error was clear.
Also, the doc states the limit of lunid as well as seen in the screenshot.

Also available in: Atom PDF