MAAS 3.0 incorrectly calculates the amount of free space on drive
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Alberto Donato | ||
3.0 |
Fix Released
|
High
|
Alberto Donato | ||
3.1 |
Fix Released
|
High
|
Alberto Donato | ||
3.2 |
Fix Released
|
High
|
Alberto Donato |
Bug Description
It has been brought to my attention the following:
"
When doing custom partitioning in MaaS, attempt to add a new partition using the max free space the GUI presents and simply click on next. MaaS will say there is not enough free space on the drive, however lowering the partition size will rectify this issue.
I was able to reproduce the issue using a software raid setup.
In focal/MaaS 3.0 when attempting to add a partition to a software raid drive through the MaaS GUI using the full amount of disk space, the GUI will display an error indicating that
Error:Partition cannot be saved; not enough free space on the block device.
Simply lowering the partition size from something like 42.93 to 42.92 will rectify the issue.
This can be reproduced by adding a VM with two disks, choosing a blank storage layout, adding the two disks to a raid setup, and attempting to click Add Partition to the mdx device
"
Related branches
- Alberto Donato (community): Approve
-
Diff: 78 lines (+42/-3)2 files modifiedsrc/maasserver/models/blockdevice.py (+10/-3)
src/maasserver/models/tests/test_blockdevice.py (+32/-0)
- MAAS Lander: Needs Fixing
- Alberto Donato (community): Approve
-
Diff: 78 lines (+42/-3)2 files modifiedsrc/maasserver/models/blockdevice.py (+10/-3)
src/maasserver/models/tests/test_blockdevice.py (+32/-0)
- MAAS Lander: Approve
- Alberto Donato (community): Approve
-
Diff: 225 lines (+43/-48)4 files modifiedsrc/maasserver/models/blockdevice.py (+10/-3)
src/maasserver/models/tests/test_blockdevice.py (+32/-0)
src/maasserver/websockets/handlers/node.py (+1/-13)
src/maasserver/websockets/handlers/tests/test_machine.py (+0/-32)
- Jack Lloyd-Walters: Approve
- MAAS Lander: Approve
-
Diff: 216 lines (+42/-47)4 files modifiedsrc/maasserver/models/blockdevice.py (+10/-3)
src/maasserver/models/tests/test_blockdevice.py (+32/-0)
src/maasserver/websockets/handlers/node.py (+0/-12)
src/maasserver/websockets/handlers/tests/test_machine.py (+0/-32)
- MAAS Lander: Approve
- Christian Grabowski: Approve
-
Diff: 195 lines (+57/-14)6 files modifiedsrc/maasserver/forms/__init__.py (+3/-3)
src/maasserver/forms/tests/test_blockdevice.py (+2/-1)
src/maasserver/models/filesystemgroup.py (+4/-0)
src/maasserver/models/tests/test_filesystemgroup.py (+29/-0)
src/maasserver/models/tests/test_node.py (+4/-3)
src/maasserver/tests/test_preseed_storage.py (+15/-7)
tags: | added: seg sts |
Changed in maas: | |
status: | New → Triaged |
Changed in maas: | |
importance: | Undecided → High |
Changed in maas: | |
assignee: | nobody → Alexsander de Souza (alexsander-souza) |
Changed in maas: | |
status: | Triaged → In Progress |
Changed in maas: | |
milestone: | none → next |
status: | In Progress → Fix Committed |
Changed in maas: | |
milestone: | next → 3.2.0-beta1 |
Changed in maas: | |
status: | Fix Committed → Fix Released |
Changed in maas: | |
status: | New → Triaged |
tags: | added: bug-council |
tags: | removed: bug-council |
Changed in maas: | |
assignee: | nobody → Alberto Donato (ack) |
Changed in maas: | |
status: | Triaged → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
milestone: | 3.3.0 → 3.3.0-beta1 |
Changed in maas: | |
status: | Fix Committed → Fix Released |
According to the 'ERROR' mentioned above, the code is raising a validationerror exception:
File: src/maasserver/ models/ partition. py enough_ space()
Function: _validate_
https:/ /git.launchpad. net/maas/ tree/src/ maasserver/ models/ partition. py#n294
It then enters two statement that look if available_size is lower than self.size and adjusted_size.
301 if available_size < self.size: block_size( )
302 # Adjust the size by one block down to see if it will fit.
303 # This is a nice to have because we don't want to block
304 # users from saving partitions if the size is only a one
305 # block off.
306 adjusted_size = self.size - self.get_
307 if available_size < adjusted_size:
As a debug exercise, we probably should check if available_size, self.size and adjusted_size are calculated properly.