When using RAID 0 in MAAS3.0, the calculated total disk size is incorrect is

Bug #1947013 reported by Heather Lemon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Alberto Donato

Bug Description

After RAID 0 two disk together the calculated disk size should be disk 1 + disk 2 = total, however it is currently only size of disk 1. Seems to be a math bug in MAAS UI.

Disk 1 size
21.47 GB
Disk 2 size
11.27 GB
current total shown is 22.53 GB

actual total is 32.74 GB

Related branches

Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

disk space

Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

total disk space shown after RAID 0

Revision history for this message
Christian Grabowski (cgrabowski) wrote :

Hi there, could you please provide the output of the following:

maas $PROFILE block_devices read $MACHINE_SYSTEM_ID

This way we can see what the backend is reporting for size of each disk and the RAID 0 device.

Changed in maas:
status: New → Incomplete
Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

after logging into the CLI and running the command:

$ maas admin block_devices read vm00

reports back
argument COMMAND: invalid choice: 'block_devices' (choose from 'account', 'bcache-cache-set', 'bcache-cache-sets', 'bcache', 'bcaches', 'block-device', 'block-devices', 'boot-resource', 'boot-resources', 'boot-source', 'boot-source-selection', 'boot-source-selections', 'boot-sources', 'commissioning-script', 'commissioning-scripts', 'dhcpsnippet', 'dhcpsnippets', 'dnsresource', 'dnsresource-record', 'dnsresource-records', 'dnsresources', 'device', 'devices', 'discoveries', 'discovery', 'domain', 'domains', 'events', 'fabric', 'fabrics', 'fan-network', 'fan-networks', 'file', 'files', 'ipaddresses', 'iprange', 'ipranges', 'interface', 'interfaces', 'license-key', 'license-keys', 'maas', 'machine', 'machines', 'network', 'networks', 'node-device', 'node-devices', 'node', 'node-results', 'node-script', 'node-script-result', 'node-script-results', 'node-scripts', 'nodes', 'notification', 'notifications', 'package-repositories', 'package-repository', 'partition', 'partitions', 'pod', 'pods', 'rack-controller', 'rack-controllers', 'raid', 'raids', 'region-controller', 'region-controllers', 'resource-pool', 'resource-pools', 'sshkey', 'sshkeys', 'sslkey', 'sslkeys', 'space', 'spaces', 'static-route', 'static-routes', 'subnet', 'subnets', 'tag', 'tags', 'user', 'users', 'version', 'vlan', 'vlans', 'vm-host', 'vm-hosts', 'vmfs-datastore', 'vmfs-datastores', 'volume-group', 'volume-groups', 'zone', 'zones')

Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

virtio disk1

Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

virtio disk 2

Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

virtio disk 3

Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

virtio disk 4

Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

ubuntu@ubuntu:/var/snap/maas/common/log$ maas <profile> block-devices read nbbgm3
Success.
Machine-readable output follows:
[
    {
        "id_path": "/dev/vda",
        "size": 21474836480,
        "block_size": 512,
        "tags": [
            "ssd"
        ],
        "partitions": [],
        "path": "/dev/disk/by-dname/vda",
        "type": "physical",
        "uuid": null,
        "partition_table_type": null,
        "id": 6,
        "available_size": 21474836480,
        "name": "vda",
        "numa_node": 0,
        "model": "",
        "filesystem": null,
        "storage_pool": null,
        "used_for": "Unused",
        "used_size": 0,
        "serial": "",
        "system_id": "nbbgm3",
        "resource_uri": "/MAAS/api/2.0/nodes/nbbgm3/blockdevices/6/"
    },
    {
        "id_path": "/dev/vdb",
        "size": 10737418240,
        "block_size": 512,
        "tags": [
            "ssd"
        ],
        "partitions": [],
        "path": "/dev/disk/by-dname/vdb",
        "type": "physical",
        "uuid": null,
        "partition_table_type": null,
        "id": 7,
        "available_size": 10737418240,
        "name": "vdb",
        "numa_node": 0,
        "model": "",
        "filesystem": null,
        "storage_pool": null,
        "used_for": "Unused",
        "used_size": 0,
        "serial": "",
        "system_id": "nbbgm3",
        "resource_uri": "/MAAS/api/2.0/nodes/nbbgm3/blockdevices/7/"
    },
    {
        "id_path": "/dev/vdc",
        "size": 16535624704,
        "block_size": 512,
        "tags": [
            "ssd"
        ],
        "partitions": [],
        "path": "/dev/disk/by-dname/vdc",
        "type": "physical",
        "uuid": null,
        "partition_table_type": null,
        "id": 8,
        "available_size": 16535624704,
        "name": "vdc",
        "numa_node": 0,
        "model": "",
        "filesystem": null,
        "storage_pool": null,
        "used_for": "Unused",
        "used_size": 0,
        "serial": "",
        "system_id": "nbbgm3",
        "resource_uri": "/MAAS/api/2.0/nodes/nbbgm3/blockdevices/8/"
    },
    {
        "id_path": "/dev/vdd",
        "size": 11274289152,
        "block_size": 512,
        "tags": [
            "ssd"
        ],
        "partitions": [],
        "path": "/dev/disk/by-dname/vdd",
        "type": "physical",
        "uuid": null,
        "partition_table_type": null,
        "id": 11,
        "available_size": 11274289152,
        "name": "vdd",
        "numa_node": 0,
        "model": "",
        "filesystem": null,
        "storage_pool": null,
        "used_for": "Unused",
        "used_size": 0,
        "serial": "",
        "system_id": "nbbgm3",
        "resource_uri": "/MAAS/api/2.0/nodes/nbbgm3/blockdevices/11/"
    }
]

Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

would be good to know if these 2 are related https://bugs.launchpad.net/maas/+bug/1938296

Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

You can also test this by provisioning 10.00 GB partitions, and RAID 0 them together and it shows the correct total size of the RAID versus different block sizes. So, MAAS is having difficulty adding different block sizes together during a RAID setup.

Revision history for this message
Alberto Donato (ack) wrote :

Current logic in MAAS for calculating raid0 size is total_size = smallest_device_size * num_devices.

AFAICS the resulting size is actually the sum of device sizes.

Changed in maas:
milestone: none → next
status: Incomplete → Triaged
importance: Undecided → Medium
assignee: nobody → Alberto Donato (ack)
Alberto Donato (ack)
Changed in maas:
status: Triaged → In Progress
Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

Okay, Can we close this since it's working as intended. It was my misunderstanding on calculating different disk space sizes.

Revision history for this message
Alberto Donato (ack) wrote :

Actually the attached branch updates the logic in MAAS and fixes the count, as it seems that Linux RAID0 does report the sum of individual device size as available.

Changed in maas:
status: In Progress → Fix Committed
Revision history for this message
Heather Lemon (hypothetical-lemon) wrote :

Is there a way to quickly check if this also resolves a related issue here? https://bugs.launchpad.net/maas/+bug/1938296

Revision history for this message
Alberto Donato (ack) wrote :

That seems a different issue, not specific to RAID

Bill Wear (billwear)
Changed in maas:
milestone: next → 3.1.0-beta4
Bill Wear (billwear)
Changed in maas:
status: Fix Committed → Fix Released
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.