mirror of
https://github.com/CloudNebulaProject/zmgr.git
synced 2026-04-10 13:10:42 +00:00
Rust CLI that creates/destroys/imports illumos zones from KDL template configs with automatic IP allocation from named pools. Registry lives under /etc/zmgr as flat KDL files — zone entries double as the IPAM ledger. Includes default templates for ipkg (OI) and nlipkg (OFL) brands, matching the existing shell scripts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.9 KiB
1.9 KiB
Registry Format
All files use KDL v2 syntax. The registry root defaults to /etc/zmgr/ but can be overridden with --registry.
config.kdl
zonepath-prefix "/zones"
default-template "oi"
| Field | Type | Default | Description |
|---|---|---|---|
zonepath-prefix |
string | /zones |
Parent directory for zone roots |
default-template |
string | oi |
Template used when --template is omitted |
templates/*.kdl
template "oi" {
brand "ipkg"
autoboot #false
ip-type "exclusive"
pool "internal"
}
| Field | Type | Required | Description |
|---|---|---|---|
brand |
string | yes | Zone brand (ipkg, nlipkg, etc.) |
autoboot |
bool | no | Boot zone after install (default: #false) |
ip-type |
string | no | IP type (default: exclusive) |
pool |
string | yes | IPAM pool name to allocate from |
pools/*.kdl
pool "internal" {
network "10.1.0.0/24"
gateway "10.1.0.1"
stub "oinetint0"
range-start "10.1.0.10"
range-end "10.1.0.250"
}
| Field | Type | Required | Description |
|---|---|---|---|
network |
CIDR | yes | Network in CIDR notation |
gateway |
IPv4 | yes | Default router for zones in this pool |
stub |
string | yes | Etherstub/VNIC parent for zone VNICs |
range-start |
IPv4 | yes | First allocatable address |
range-end |
IPv4 | yes | Last allocatable address |
zones/*.kdl
zone "myzone" {
template "oi"
address "10.1.0.10/24"
gateway "10.1.0.1"
vnic "myzone0"
stub "oinetint0"
created "2026-03-22"
}
These files are created by zmgr create and zmgr import. They serve as the IPAM allocation ledger — scanning all zone files determines which IPs are in use.
publishers/*.kdl
publisher "openindiana.org" {
origin "https://pkg.openindiana.org/hipster"
}
IPS publisher configurations. Currently informational — future work could apply these during zone install.