DaanHoogland opened a new pull request, #20:
URL: https://github.com/apache/cloudstack-extensions/pull/20

   ## Summary
   
   Adds an **Orchestrator (hypervisor) extension for LXC** in `lxc/`. It lets 
CloudStack deploy and manage system containers with the classic `lxc-*` tools 
(not LXD/Incus).
   
   It is a single Rust binary (only dependencies: `serde`, `serde_json`) 
installed as the extension entry point on the management server. It drives LXC 
hosts over SSH using the system OpenSSH client, or locally with 
`transport=local`.
   
   ### Features
   - **Lifecycle:** `prepare`, `create`, `start`, `stop`, `reboot`, `delete`, 
`status`, `statuses`.
     - `create` uses `lxc-create -t download` (image from the template's 
External Details `dist`/`release`/`arch`/`variant`) or clones a golden 
container with `lxc-copy` (`clone_from`).
     - If creating a container fails partway, it is destroyed again.
     - `stop` and `delete` succeed if the container is already stopped or gone.
   - **Resources:** offering memory and vCPUs become cgroup v2 limits 
(`memory.max`, `memory.low`, `cpu.max`); cgroup v1 is optional. They are 
written to a marked block in the container config, which is rewritten on every 
start.
   - **Networking:** each NIC becomes a veth with the MAC CloudStack assigned. 
VLAN networks attach in one of two ways:
     - `vlan_mode=filter` (default): one VLAN-filtering bridge, with LXC 
setting `veth.vlan.id`.
     - `vlan_mode=bridge`: one bridge per VLAN (`eth1.<vlan>` → 
`breth1-<vlan>`), the same layout as the Network-Namespace extension.
     - `static_ip=true` is optional and makes LXC set the CloudStack-assigned 
IPv4/IPv6 address and gateway.
   - **Custom actions:** `ListSnapshots`, `CreateSnapshot`, `RestoreSnapshot`, 
`DeleteSnapshot`, `Freeze`, `Unfreeze`.
   
   ### Security
   - Anyone who can register a template can set its details, so only `dist`, 
`release`, `arch` and `variant` are read from template or instance details. The 
SSH target, `clone_from`, raw `lxc_config` and similar settings come only from 
host or extension details.
   - Every value sent to the host is shell-quoted. MACs, IPs and netmasks are 
parsed, and config lines are checked for line breaks.
   - The SSH password is passed to `sshpass` through the environment, not on 
the command line. Inline PEM keys are written to a 0600 temporary file that is 
removed after the call.
   
   ### Not supported
   No console (LXC has no VNC), no volume management, no live migration, and no 
cloud-init user data. Details are in `lxc/README.md`.
   
   ## Testing
   - `cargo test`: 21 unit tests. They cover payload parsing, settings 
resolution and precedence, rejection of hostile values, config rendering, 
parsing of `lxc-ls` and `lxc-snapshot` output, and the action flows (create, 
rollback, idempotent stop/delete) against a mock executor.
   - `cargo clippy --all-targets` is clean, and the pre-commit hooks pass.
   - End-to-end run of the real binary with `transport=local` against stub 
`lxc-*` tools: the full create → status → stop → start → reboot → delete cycle, 
plus a check that SSH failures come back as proper JSON.
   - **Not yet tested against a real LXC host or a CloudStack management 
server.**
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to