MAAS API does not allow changing an fstype or mount_point on LVM volume-groups

Bug #1881136 reported by Nick Niehoff
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Status tracked in 3.6
3.4
Won't Fix
Medium
Unassigned
3.5
Won't Fix
Medium
Unassigned
3.6
Triaged
Medium
Unassigned

Bug Description

The MAAS CLI provides methods to set the fstype and mount_point of a normal partition:

maas $PROFILE partition format $SYSTEM_ID $DEVICE_ID $PARTITION_ID fstype=fat32
maas $PROFILE partition mount $SYSTEM_ID $DEVICE_ID $PARTITION_ID mount_point=/boot/efi

However, if this is an LVM logical volume you can't. You can create one with:

maas $PROFILE volume-groups create $SYSTEM_ID partitions=$LVM_PARTITION name=vgtest
maas $PROFILE volume-group create-logical-volume $SYSTEM_ID $VG_ID name=lvtest size=$AVAILABLE_SIZE

But when trying to set the fstype or mount_point with the partition command with the CLI you need a partition_id but the blockdevice is doesn't contain one:

{
  "id_path": null,
  "size": 32103202816,
  "block_size": 4096,
  "tags": [],
  "partition_table_type": null,
  "partitions": [],
  "uuid": "002df611-e116-49da-b6a8-a1069dc35f2f",
  "path": "/dev/disk/by-dname/lvtest",
  "used_size": 0,
  "numa_node": null,
  "used_for": "Unused",
  "filesystem": null,
  "serial": null,
  "id": 413,
  "available_size": 32103202816,
  "storage_pool": null,
  "type": "virtual",
  "name": "vgtest-lvtest",
  "model": null,
  "system_id": "p6fhme",
  "resource_uri": "/MAAS/api/2.0/nodes/p6fhme/blockdevices/413/"
}

I grabbed a tcpdump from UI and it passes null to the WebSocket for the partition_id:

Line-based text data (1 lines)
    {"type":0,"request_id":32,"method":"machine.update_filesystem","params":{"system_id":"p6fhme","block_id":404,"partition_id":null,"fstype":"xfs","mount_point":null,"mount_options":null}}

There doesn't seem to be a way to pass null to either the CLI or the API.

Tags: api cli
Dougal Matthews (d0ugal)
tags: added: cli
tags: added: api
Changed in maas:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Jerzy Husakowski (jhusakowski) wrote :

The inconsistency between what's possible via the UI vs API/CLI is unintentional.

Changed in maas:
importance: High → Medium
milestone: none → 3.4.0
Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.x
Changed in maas:
milestone: 3.4.x → 3.5.x
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.