available_size for md devices is higher than space available resulting in failures

Bug #1882809 reported by David Andruczyk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Expired
Medium
Unassigned

Bug Description

I've been fighting with an issue when creating the following configuration:

4 or more devices in a RAID10 configuration
RAID10 device partitioned into two partitions.
Two separate volume grouts created on the separate partitions.

When using both MAAS and the python-libmaas API to configure the machine, if I use the available size for the RAID device when partitioning it, it consistently results in a build failure.

Creating the partitions with some free space on the device (the amount needed seems to depend on the size of the device, the bigger device, the more you seem to set aside (but a fixed percentage of the full disk) allows the build to succeed, so there's a math problem within MAAS.

I deployed a machine using an undersized partitioning of the RAID10 device which works.

Using fdisk to show the disk, I get

root@use1-maas-test-17:~# fdisk -l /dev/md2
Disk /dev/md2: 10.9 TiB, 12002065907712 bytes, 23441534976 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes
Disklabel type: gpt
Disk identifier: 5895A0FD-7CB8-4526-862C-E0515D1C4B68

Device Start End Sectors Size Type
/dev/md2p1 2048 7812491263 7812489216 3.7T Linux filesystem
/dev/md2p2 7812491264 22660556799 14848065536 6.9T Linux filesystem

Querying MAAS for the same block device shows:
{
                "size": 12002336309248,
                "block_size": 512,

There's a discrepancy there of 270401536 bytes (maas thinks the device is bigger than it really is by 270401536 bytes (270MB) in this case of a RAID10 or 4 6T drives) and if you let it use the full space in the gui or via the API it results in a failure during partitioning (AND in most cases NO LOG EITHER back to the maas GUI).

I'm also noticing discrepancies on the physical device partitions
The physical device size matches between the OS and maas, but the partition sizes do NOT.

/dev/sdd
Command (? for help): p
Disk /dev/sdd: 11721045168 sectors, 5.5 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 80D01024-7A50-402C-8F1C-D1F7D78139F9
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 11721045134
Partitions will be aligned on 2048-sector boundaries
Total free space is 11373 sectors (5.6 MiB)

Number Start (sector) End (sector) Size Code Name
   1 2048 4095 1024.0 KiB EF02
   2 4096 11721035775 5.5 TiB 8300

Command (? for help):

{
                "firmware_version": "T7J0",
                "size": 6001175126016,
                "block_size": 4096,
                "available_size": 0,
                "uuid": null,
                "id": 7486,
                "serial": "5000cca24dc83007",
                "name": "sdd",
                "filesystem": null,
                "partition_table_type": "GPT",
                "partitions": [
                    {
                        "uuid": "2c1b90c8-c289-476e-82e5-7d2e17f6cacd",
                        "size": 6001168220160,
                        "bootable": false,
                        "tags": [],
                        "id": 5188,
                        "filesystem": {
                            "fstype": "raid",
                            "label": null,
                            "uuid": "4f7d7e3a-3951-4ca3-9bdd-e217e99df9f5",
                            "mount_point": null,
                            "mount_options": null
                        },
                        "device_id": 7486,
                        "path": "/dev/disk/by-dname/sdd-part2",
                        "used_for": "Active raid-10 device for md2",
                        "type": "partition",
                        "system_id": "ydrxfb",
                        "resource_uri": "/MAAS/api/2.0/nodes/ydrxfb/blockdevices/7486/partition/5188"
                    }
                ],
                "storage_pool": null,
                "tags": [
                    "rotary",
                    "allocated"
                ],
                "id_path": "/dev/disk/by-id/scsi-SATA_HGST_HUS726060AL_NCGL0B4Z",
                "path": "/dev/disk/by-dname/sdd",
                "used_for": "GPT partitioned with 1 partition",
                "model": "HGST_HUS726060AL",
                "type": "physical",
                "used_size": 6001174511616,
                "system_id": "ydrxfb",
                "resource_uri": "/MAAS/api/2.0/nodes/ydrxfb/blockdevices/7486/"
            },

so the disk size from the OS is 6001175126016 bytes which matches what maas says for "size"
However the size of partitions for that device don't line up quite right.

Revision history for this message
David Andruczyk (dandruczyk) wrote :

There seems to be a similar problem with logical volumes, you cannot use all the space listed by maas, you have to "leave some free" for the evident math bugs..
NOTE this is on maas 2.6.2-7841-ga10625be3-0ubuntu1~18.04.1

description: updated
Alberto Donato (ack)
Changed in maas:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Jerzy Husakowski (jhusakowski) wrote :

Is this issue still present on a recent MAAS version (3.0.1+)? A similar issue (https://bugs.launchpad.net/maas/+bug/1938296) was fixed recently.

Changed in maas:
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for MAAS because there has been no activity for 60 days.]

Changed in maas:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.