COPILOT instructions — VM backup management (project scaffold)
Purpose
This document provides context and instructions for an automated assistant (copilot) to start building a project that manages VM backups for the Madagascar cluster. The detailed backup behaviors (retention, snapshot type, schedule) will be added later. For now we focus on cluster context, knowledge sources, file contracts, and recommended initial tasks.
Context & what the agent already knows
madagascar and node names are available under clusters.madagascar.nodes in cluster-context/madagascar.json.cluster-context/madagascar.json is the canonical source of cluster context available to this project: it may contain node hostnames, network information, and references to where configurations originate.madagascar-changelog.json (if present in the same directory) is an append-only changelog recommended for recording automation changes; prefer appending entries rather than rewriting.Primary goals for the backup project (to be specified later)
cluster-context/madagascar.json for cluster information and to avoid stepping on other projects' config.Files the assistant should read and keep in mind
cluster-context/madagascar.json — primary source of truth for node hostnames, network addresses, and where configuration is defined.madagascar-changelog.json — append-only log to record changes made by automation (if present).CHANGELOG.md — human-readable changelog documenting all cluster changes with issue references.issues/ directory — contains detailed issue documentation. Each issue has format ISSUE-YYYY-NNN.md.Data contract (minimal) — how cluster-context/madagascar.json will be used by backups
clusters.madagascar.nodes keysnodes.<node>.hosts (ssh target or provisioning endpoint)wan/thunderbridge)madagascar-changelog.json (id, timestamp, project: backups, summary, details, affectedResources)backups.json manifest in repo or storage describing performed backups.Assumptions (inferred, verify early)
cluster-context/madagascar.json.Starter tasks for the copilot (priority order)
./discover_vms.sh (or Python) that:
./cluster-context/madagascar.json to get nodes and hostnames.qm list or pvesh / pct list for containers).backups/manifest-<date>.json with the discovered VMs../run_backup.sh which takes a VM id and node, creates a snapshot/export, and uploads it to configured storage. Keep steps idempotent and record metadata../prune_backups.sh to remove old backups according to retention policy (to be defined).cluster-context/madagascar.json or backup metadata must append an entry in cluster-context/madagascar-changelog.json describing reason and affected resources.Developer guidance & best practices
cluster-context/madagascar.json as the source of truth for discovery; do not hardcode hostnames elsewhere.cluster-context/madagascar.json, always also append a changelog entry and prefer atomic updates (write to tmp file then rename).cluster/cluster-context/madagascar.json for node, IP, and service info.scripts/check_thunderbridge.sh:
dmesg), interface status (ip link show), and bridge membership (bridge link).issues/ as Markdown files using TEMPLATE.md.CHANGELOG.md for every fix, enhancement, or regression.-o LogLevel=ERROR).deploy/attempt1/deploy_tb.sh <node>scripts/check_thunderbridge.shissues/ and CHANGELOG.mdcluster/cluster-context/madagascar.json: Node, network, and backup server definitionsissues/: Issue tracker and templatesCHANGELOG.md: Change documentationscripts/check_thunderbridge.sh: Cluster network health checkdeploy/attempt1/deploy_tb.sh: Network deployment scriptNext steps for the user
If you want, I can now scaffold ./discover_vms.sh, ./run_backup.sh (stubs), and a small backups/README.md describing configuration fields. Which do you prefer I create first: discovery script (bash) or Python scaffold?