Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
S slapos.core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 26
    • Merge requests 26
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • slapos.core
  • Merge requests
  • !585

Merged
Created Nov 29, 2023 by Xavier Thompson@xavier_thompsonOwner

format: Support partition capabilities in computer definition file

  • Overview 5
  • Commits 3
  • Changes 1

This goes with !584 (merged)

Feature

This allows partition capabilities to be specified in the computer definition file (conventionally slapformat-definition.cfg), like this:

[partition_0]
...
capability_list =
  fast-network
  more_disk_space
  yet another capability

...

Capabilities are line-separated and may otherwise contain whitespace. Whitespace at the beginning and end of each line is stripped.

Usage

As of current slapformat implementation, the computer definition file must exhaustively define the computer: this means it must have a section for the computer and a section for each partition_X, with required fields such as address and user. The ability to manually specify some things and automatically fill-in the rest is on the wishlist for a better slapformat :)

A practical usage is therefore to generate slapformat-definition.cfg automatically and then edit it manually:

  1. Edit slapos.cfg to generate slapformat-definition.cfg
    [slapformat]
    output_definition_file = path/to/slapformat-definition.cfg
  2. Run slapos node format --now to generate slapformat-definition.cfg
  3. Edit generated slapformat-definition.cfg to add capabilities
  4. Edit slapos.cfg to use slapformat-definition.cfg
    [slapformat]
    input_definition_file = path/to/slapformat-definition.cfg
  5. slapos node format --now to send the capabilities to master

Fixes

The netiface module sometimes returns netmask values like ffff:ffff:ffff:ffff:ffff:ffff::/96. This was already caught and fixed on the fly in some cases, but not all, causing the generate-edit-use slapformat-definition.cfg pattern above to fail. To avoid this, all usages of netiface.ifaddresses are replaced with a function that normalizes netmasks.

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: feat/slapos-computer-partitions-capabilities-format
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7