File

In MAAS, the term file refers to user-uploaded or MAAS-managed files that serve various purposes, such as boot resources, firmware, cloud-init scripts, and configuration snippets. These files are generally managed through the MAAS CLI and API.

Scope and use cases

MAAS supports file management for several key areas:

  1. Cloud-init user data & scripts

    • Files can be uploaded as user-data, curtin preseed, or early command scripts.
    • Example: cloud-init configurations for machine provisioning.
  2. Firmware & driver injection

    • Custom firmware, drivers, or kernel modules can be attached to machines.
    • Example: Uploading non-standard NIC drivers.
  3. Boot resources (custom kernels & images)

    • Users can provide custom kernel images, bootloader configurations, and PXE boot files.
    • Example: Custom Ubuntu images or alternative OS boot files.
  4. Configuration snippets

    • Custom DHCP, DNS, and network-related settings can be injected via files.

MAAS CLI file management

Files are managed via the MAAS CLI using various endpoints. Key operations include:

1. Uploading a file:

maas <profile> files create name=myfile metadata="{'description': 'Custom script'}" < myscript.sh

Uploads myscript.sh with metadata.

2. Listing available files:

maas <profile> files read

Displays all uploaded files, including metadata.

3. Retrieving a specific file:

maas <profile> files read <file-id>

Downloads or displays file details.

4. Deleting a file:

maas <profile> files delete <file-id>

Removes a file from MAAS.

Key considerations

  • Files are not version-controlled within MAAS — updates overwrite existing entries.
  • Scope varies by use case. Some files apply globally, while others are machine- or VLAN-specific.
  • Permissions & access: Only authorized users can manage or retrieve files.
  • File validation: MAAS does not automatically validate file correctness, so testing is necessary.

Last updated 9 hours ago.