Skip to content

Add registeredIPAddresses (reserve specific IPs in IPAM without NIC allocation)#435

Open
yingzhan-msft wants to merge 2 commits into
mainfrom
users/yingzhan/moc-reserveip
Open

Add registeredIPAddresses (reserve specific IPs in IPAM without NIC allocation)#435
yingzhan-msft wants to merge 2 commits into
mainfrom
users/yingzhan/moc-reserveip

Conversation

@yingzhan-msft
Copy link
Copy Markdown
Contributor

Add registeredIPAddresses (reserve specific IPs in IPAM without NIC allocation)

Add proto support for the new registeredIPAddresses feature, which lets a
caller mark specific IPs as reserved in IPAM without allocating them to a
NIC/LB. The reserved IPs are persisted on each IPPool and survive
restarts.

Proto changes:

  • rpc/common/moc_common_networkcommon.proto:

    • IPPool.registeredIPAddresses (field 7): per-pool list of registered IPs
      (storage layer; rehydration loops directly without re-running pool
      range-routing).
    • IPUpdateErrorCode enum: per-IP failure codes
      (UNKNOWN, INVALID_FORMAT, OUT_OF_RANGE, SUBNET_NOT_FOUND,
      ALREADY_ALLOCATED, NO_POOLS_IN_SUBNET).
    • IPAddressUpdateFailure message: { SubnetName, IPAddress, Code, Error }.
  • rpc/cloudagent/network/{logicalnetwork,virtualnetwork}/*.proto:

    • UpdateRegisteredIPs RPC.
    • {Logical,Virtual}NetworkIPUpdateRequest / Response.
    • {Logical,Virtual}SubnetIPUpdate { SubnetName, RegisteredIPAddresses[] }
      (subnet-scoped flat list; cloudagent routes IPs to pools by range).

The dual layer (subnet-scoped on the wire, per-pool in storage) keeps the
RPC ergonomic while making rehydration cheap and self-describing.

…llocation)

Add proto support for the new registeredIPAddresses feature, which lets a
caller mark specific IPs as reserved in IPAM without allocating them to a
NIC/LB. The reserved IPs are persisted on each IPPool and survive
restarts.

Proto changes:
- rpc/common/moc_common_networkcommon.proto:
  - IPPool.registeredIPAddresses (field 7): per-pool list of registered IPs
    (storage layer; rehydration loops directly without re-running pool
    range-routing).
  - IPUpdateErrorCode enum: per-IP failure codes
    (UNKNOWN, INVALID_FORMAT, OUT_OF_RANGE, SUBNET_NOT_FOUND,
    ALREADY_ALLOCATED, NO_POOLS_IN_SUBNET).
  - IPAddressUpdateFailure message: { SubnetName, IPAddress, Code, Error }.

- rpc/cloudagent/network/{logicalnetwork,virtualnetwork}/*.proto:
  - UpdateRegisteredIPs RPC.
  - {Logical,Virtual}NetworkIPUpdateRequest / Response.
  - {Logical,Virtual}SubnetIPUpdate { SubnetName, RegisteredIPAddresses[] }
    (subnet-scoped flat list; cloudagent routes IPs to pools by range).

The dual layer (subnet-scoped on the wire, per-pool in storage) keeps the
RPC ergonomic while making rehydration cheap and self-describing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@yingzhan-msft yingzhan-msft force-pushed the users/yingzhan/moc-reserveip branch from 962d2cc to 4bb9f73 Compare May 11, 2026 17:35
The Error field on LogicalNetworkIPUpdateResponse and
VirtualNetworkIPUpdateResponse was never reachable on the wire:
the cloudagent only set it together with a non-OK gRPC status, and
gRPC clients discard the response body on non-OK status. Document
Failures as the per-IP failure channel and the gRPC status as the
whole-batch failure channel; regenerate the .pb.go files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@yingzhan-msft yingzhan-msft marked this pull request as ready for review May 19, 2026 00:41
// This RPC is independent of spec Update: it does not run Validate or
// validateUpdate, does not touch ProvisionState, and does not fan out
// to nodeagents.
rpc UpdateRegisteredIPs(LogicalNetworkIPUpdateRequest) returns (LogicalNetworkIPUpdateResponse) {}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refrain from making API changes. We do not plan to make any API changes in MOC.

It is in bug fix mode.

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.

2 participants