Skip to content

Reconcile desired VM state with observed agent state #101

Description

@halfcyan

Summary

Recover VM inventory and runtime state after manager, agent, or cluster restarts by reconciling etcd records with agent observations.

Scope

  • Load desired VM state from etcd.
  • Discover observed VMs from agents/runtime directories.
  • Recreate missing actors for desired VMs.
  • Represent desired-but-unavailable VMs as pending/error.
  • Define policy for unknown runtime VMs.
  • Make reconciliation idempotent.

Tasks

  • Define desired, observed, pending, error, and unknown VM reconciliation states.
  • Load desired VM records from etcd during manager startup.
  • Discover observed VMs from agents and local runtime directories.
  • Recreate missing VM actors for desired VMs.
  • Mark desired-but-unavailable VMs as pending or error with a reason.
  • Define and implement handling for unknown runtime VMs.
  • Make reconciliation safe to run repeatedly.
  • Add manager-restart and agent-restart tests with mocked agents.
  • Expose desired and observed state distinctly through the API.

What this should do

  • Manager restart restores VM inventory.
  • Agent restart does not permanently hide healthy local VMs.
  • Repeated reconciliation does not create duplicate VMs.
  • Desired and observed state are distinguishable in API responses.
  • Recovery behavior has mocked-agent tests.

Dependencies

  • Depends on draft issue 03.

Related issues

Issue links

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions