Surface minimum allowable partition size over websocket

Bug #1913512 reported by Caleb Ellis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Expired
Medium
Unassigned
3.0
Won't Fix
Undecided
Unassigned

Bug Description

In the angular codebase there are a lot of constants and code used to determine the minimum allowable partition size of a disk, e.g:

// From models/partitiontable.py - must be kept in sync.
var INITIAL_PARTITION_OFFSET = 4 * 1024 * 1024;
var END_OF_PARTITION_TABLE_SPACE = 1024 * 1024;
var PARTITION_TABLE_EXTRA_SPACE =
  INITIAL_PARTITION_OFFSET + END_OF_PARTITION_TABLE_SPACE;
var PREP_PARTITION_SIZE = 8 * 1024 * 1024;

// From models/partition.py - must be kept in sync.
var PARTITION_ALIGNMENT_SIZE = 4 * 1024 * 1024;
var MIN_PARTITION_SIZE = PARTITION_ALIGNMENT_SIZE;

$scope.availablePartitionSpace = function (disk) {
  var space_to_reserve = 0;
  if (
    !angular.isString(disk.original.partition_table_type) ||
    disk.original.partition_table_type === ""
  ) {
    // Disk has no partition table, so reserve space for it.
    space_to_reserve = PARTITION_TABLE_EXTRA_SPACE;
    // ppc64el node requires that space be saved for the prep
    // partition.
    if ($scope.node.architecture.indexOf("ppc64el") === 0) {
      space_to_reserve += PREP_PARTITION_SIZE;
    }
  }
  return ConverterService.roundByBlockSize(
    disk.original.available_size - space_to_reserve,
    PARTITION_ALIGNMENT_SIZE
  );
};

As far as I can tell, all of this code is just used to determine whether to show the "Add partition" action in the UI. Can we remove this logic from the frontend code, and expose a parameter like `minimum_partition_size` over the websocket somewhere?

Alberto Donato (ack)
Changed in maas:
importance: Undecided → Medium
status: New → Triaged
milestone: none → 3.0.1
Revision history for this message
Alberto Donato (ack) wrote :

If that's the only reason, we could also add a boolean flag to disks to report whether partitions can be created on it.

Changed in maas:
milestone: 3.0.1 → none
Revision history for this message
Adam Collard (adam-collard) wrote :

Is this still a problem in recent MAAS? Noting that we've moved from Angular to ReactJS?

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.