Skip to content

Conversation

@alexlovelltroy
Copy link
Member

Checklist

  • My code follows the style guidelines of this project
  • I have added/updated comments where needed
  • I have added tests that prove my fix is effective or my feature works
  • I have run make test (or equivalent) locally and all tests pass
  • DCO Sign-off: All commits are signed off (git commit -s) with my real name and email
  • REUSE Compliance:
    • Each new/modified source file has SPDX copyright and license headers
    • Any non-commentable files include a <filename>.license sidecar
    • All referenced licenses are present in the LICENSES/ directory

Description

This pull request adds support for specifying the starting IP address for both BMC and node IP allocation, allowing users to reserve lower IPs in a subnet (e.g., for gateways or DNS) and begin allocation at a desired address. The implementation introduces new command-line flags, updates the allocation logic, and adds comprehensive tests and documentation.

Key changes include:

Feature: Start IP allocation at a specific address

  • Added --start-ip flag to init-bmcs and --node-start-ip flag to discover, enabling users to skip a range of IPs at the beginning of the subnet for both BMC and node allocations. [1] [2] [3] [4]
  • Updated allocation logic in internal/netalloc/ipam.go with a new ReserveUpTo method, which reserves all IPs before the specified start IP. This is used by both initbmcs.Generate and discover.UpdateNodes. [1] [2] [3] [4]

Documentation updates

  • Enhanced README.md with usage examples and explanations for the new --start-ip and --node-start-ip flags, clarifying how to reserve IPs at the start of a subnet. [1] [2]

Testing

  • Added unit tests for the new ReserveUpTo method and for generating BMC entries with a specified start IP, ensuring correct behavior and error handling. [1] [2]

Internal API changes

  • Updated function signatures and calls in initbmcs.Generate and discover.UpdateNodes to accept the new start IP parameters, maintaining backward compatibility. [1] [2] [3]

These changes provide more flexible IP management and improve usability for network administrators.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

For more info, see Contributing Guidelines.

… allocation

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
@alexlovelltroy alexlovelltroy merged commit db6365d into main Dec 11, 2025
2 checks passed
@alexlovelltroy alexlovelltroy deleted the feature/specify-starting-ip branch December 11, 2025 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants