Skip to content

Conversation

@rawahars
Copy link
Contributor

This pull request introduces a major refactor and formalization of the Utility VM (UVM) builder and management interfaces. It separates the responsibilities for VM configuration, host-side management, and guest-side actions into clear, testable layers. The changes include a new, well-documented builder interface, VM manager interface, concrete builder and VM manager implementations, along with comprehensive unit tests for the builder's functionality.

The most important changes are:

Architectural Refactor and Documentation

  • Added a detailed README.md to the internal/vm package, clearly explaining the separation of concerns between the Builder, VM Manager, and Guest Manager layers, and documenting the responsibilities and flow for each layer.

Builder Interface and Implementation

  • Replaced the old UVMBuilder interface with a new, comprehensive Builder interface in internal/vm/builder.go, providing modular access to memory, processor, NUMA, device, boot, and storage QoS configuration managers.
  • Introduced a concrete implementation of the Builder interface in internal/vm/builder/builder.go for creating and configuring hcsschema.ComputeSystem documents.

VM Manager Interface and Implementation

  • Created a new comprehensive UVM interface which corresponds to VM manager functionality.
  • All the VM host side modification are responsibility of this interface.

Testing

  • Added comprehensive unit tests for builder verification.

These changes establish a foundation for future VM configuration and management features.

Refactor the UVM code to clearly separate responsibilities across the VM
layers (builder vs. vmmanager) and document the intended architecture.

This reorganizes the former `internal/vm/hcs` package into focused
builder and manager packages and updates the core interfaces/types.

Key changes:
- Introduce `internal/vm/builder` as the concrete `Builder` implementation
  for constructing HCS compute system documents.
- Add `internal/vm/vmmanager` package for host-side UVM lifecycle and
  resource management; move HCS-backed managers here.
- Replace the old `UVMBuilder` with a `Builder` interface and manager
  sub-interfaces for memory/processor/numa/device/boot/storage QoS.
- Consolidate shared VM types and errors into `internal/vm/builder_types.go`
  (guest OS, memory backing, processor config, device IDs).
- Add the `internal/vm/README.md` describing the 3-layer VM model and
  typical usage flow.
- Move HCS-specific implementations into their new packages; delete
  obsolete `internal/vm/hcs` files and rename movers (boot/memory/network/etc.).
- Normalize builder APIs to be configuration setters (no errors where

Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
@rawahars rawahars requested a review from a team as a code owner February 10, 2026 11:06
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.

1 participant