Project

General

Profile

Bug #35398

Size exception when creating zvolumes

Added by Waqar Ahmed about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
No priority
Assignee:
Vaibhav Chauhan
Category:
GUI (new)
Target version:
Severity:
New
Reason for Closing:
Duplicate Issue
Reason for Blocked:
Needs QA:
Yes
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

When we create a zvol in new UI right now, it asks us to enter values in gbs, mbs etc. Once the values have been entered, they are sent to middlewared after being changed into bytes. Now say if I am to enter 11.6 GiB, that is going to result in a float value when changed to bytes. Middlewared does not accept float values for size, which raises an exception. So the idea is, that the value should be rounded off to the nearest byte and then sent to Middlewared. Like if the bytes are 123.8, the number can be changed to 124 and then sent over to Middlewared.


Related issues

Is duplicate of FreeNAS - Bug #36228: Fix traceback in new UI when checking the force button in the create a zvol screen Done
Blocked by FreeNAS - Bug #35665: Getting traceback when trying to create zvol integer in bytesClosed

Associated revisions

Revision 60e5fb19 (diff)
Added by Erin Clark about 1 year ago

WIP convert float to int for volsize on zvols

Ticket: #35398

History

#1 Updated by Erin Clark about 1 year ago

  • Status changed from Unscreened to Screened

#2 Updated by Erin Clark about 1 year ago

I am trying to pass the following input in { name: "feevol1", comments: undefined, volsize: 1503238554, volsize_unit: "B", force: undefined, sync: "INHERIT", compression: "INHERIT", deduplication: "INHERIT", sparse: undefined, volblocksize: "16K" } after converting 1.5 GiB to a rounded up integer in bytes but I get this error:

"'>' not supported between instances of 'NoneType' and 'float'" 

trace: Object { class: "TypeError", frames: (15) […], formatted: "Traceback (most recent call last):\n File \"/usr/local/lib/python3.6/site-packages/middlewared/main.py\", line 154, in call_method\n result = await self.middleware.call_method(self, message)\n File \"/usr/local/lib/python3.6/asyncio/coroutines.py\", line 110, in next\n return self.gen.send(None)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/main.py\", line 1013, in call_method\n return await self._call(message['method'], serviceobj, methodobj, params, app=app, io_thread=False)\n File \"/usr/local/lib/python3.6/asyncio/coroutines.py\", line 110, in next\n return self.gen.send(None)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/main.py\", line 953, in call\n return await methodobj(*args)\n File \"/usr/local/lib/python3.6/asyncio/coroutines.py\", line 110, in next\n return self.gen.send(None)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/service.py\", line 277, in create\n f'{self._config.namespace}.create', self, self.do_create, [data]\n File \"/usr/local/lib/python3.6/asyncio/coroutines.py\", line 110, in next\n return self.gen.send(None)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/main.py\", line 953, in _call\n return await methodobj(*args)\n File \"/usr/local/lib/python3.6/asyncio/coroutines.py\", line 110, in next\n return self.gen.send(None)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/schema.py\", line 658, in nf\n return await f(*args, **kwargs)\n File \"/usr/local/lib/python3.6/asyncio/coroutines.py\", line 110, in next\n return self.gen.send(None)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/plugins/pool.py\", line 626, in do_create\n await self._common_validation(verrors, 'pool_dataset_create', data, 'CREATE')\n File \"/usr/local/lib/python3.6/asyncio/coroutines.py\", line 110, in next\n return self.gen.send(None)\n File \"/usr/local/lib/python3.6/site-packages/middlewared/plugins/pool.py\", line 794, in __common_validation\n data['volsize'] > (avail_mem * 0.80) and\nTypeError: '>' not supported between instances of 'NoneType' and 'float'\n" }

#3 Updated by Waqar Ahmed about 1 year ago

Kindly correct me if I am wrong but I don't think you are passing in the correct payload for api v2 pool.dataset ? Could you please let me know which URL you used to make the API call ?

#4 Updated by Erin Clark about 1 year ago

  • Blocked by Bug #35665: Getting traceback when trying to create zvol integer in bytes added

#5 Updated by Erin Clark about 1 year ago

I figured out the bug I had before but now I have another issue I'm not quite sure the best way to mathematically handle. Simply rounding gives me this: pool_dataset_create.volsize: Volume size should be a multiple of volume block size which makes sense since rounding to the nearest byte isn't taking blocksize into account. Maybe I should round to the nearest block?

#6 Updated by Waqar Ahmed about 1 year ago

That is a constraint which we cannot escape. Volume size has to be multiple of the block size selected. So I would suggest from the end user point of view, that we can let them know we would be rounding this off to the next block because the value you selected is not a multiple of the block size selected. Thoughts ?

#7 Updated by Waqar Ahmed about 1 year ago

Actually looking at the block sizes again, I don't think it's that large of a value to bug the user. We can maybe just round it off either to the next one or the previous one. Thoughts William ?
Secondly, looking at the new UI, the block sizes need to be changed. The acceptable block sizes for a ZVOL are

Str('volblocksize', enum=[
            '512', '1K', '2K', '4K', '8K', '16K', '32K', '64K', '128K',
        ]),

Whereas, in the new UI right now, the end user can select up to 1024K. That should be corrected as well

#8 Updated by Erin Clark about 1 year ago

  • Assignee changed from Erin Clark to Vaibhav Chauhan

VB is working on this one

#9 Updated by Erin Clark about 1 year ago

  • Related to Bug #36228: Fix traceback in new UI when checking the force button in the create a zvol screen added

#10 Updated by Erin Clark about 1 year ago

  • Status changed from Screened to Ready for Testing

#11 Updated by Dru Lavigne about 1 year ago

  • Related to deleted (Bug #36228: Fix traceback in new UI when checking the force button in the create a zvol screen )

#12 Updated by Dru Lavigne about 1 year ago

  • Is duplicate of Bug #36228: Fix traceback in new UI when checking the force button in the create a zvol screen added

#13 Updated by Dru Lavigne about 1 year ago

  • Status changed from Ready for Testing to Closed
  • Target version changed from 11.2-RC2 to N/A
  • Reason for Closing set to Duplicate Issue

Also available in: Atom PDF