Modernize LCIP provisioning, templates, testing, and deployment #1

Open
opened 2026-11-18 16:14:34 +01:00 by André Keller · 0 comments
Owner

Goal

Modernize LCIP, the Python/libvirt cloud-image provisioning tool, while keeping it small, reliable, and suitable for Ubuntu 24.04+ (including Ubuntu 26.04). Review the current repository before designing changes and implement the work in small, independently reviewable steps.

Requirements

  • Review the current architecture, VM definition schema, CLI, safety/error handling, and libvirt integration.
  • Support multiple VM disks, potentially located on different libvirt storage pools, with predictable device assignment and safe handling of existing volumes.
  • Introduce template inheritance to remove duplicated cloud-init configuration across Ubuntu releases; handle missing parents and inheritance cycles.
  • Add a seed-only regeneration operation (for example after network configuration changes) without rebuilding disks or domains; document shutdown/restart considerations and safe cloud-init cache reset inside the guest.
  • Make CPU configuration explicit and configurable. Review the current mixture of qemu64, host-model, and qemu64 with SSSE3 overrides across Intel/AMD hypervisors before selecting defaults.
  • Review cloud-image downloading and provide unattended refresh of images for configured templates. Prefer a dedicated LCIP command (such as lcip update-images) if it is simpler; otherwise retain a clean shared implementation. Avoid unnecessary downloads, validate downloads appropriately, and preserve the last working image on failure.
  • Review and update the existing LCIP Puppet module to manage VM definitions, templates, and scheduled image refreshes (cron or systemd timer). Puppet should not silently recreate running VMs or destroy existing disks. Request the current module snapshot before implementation.
  • Modernize the Python implementation using features available with Ubuntu 24.04+, improving typing, validation, subprocess handling, cleanup, error messages, and separation of testable logic from external operations where useful.
  • Migrate from setup.py to pyproject.toml, preserving the CLI entry point and Debian packaging compatibility.
  • Add pytest coverage that runs without a hypervisor, using fixtures/mocks for libvirt and external commands; cover definitions, templates, cloud-init, domain XML, disks/pools, CPU features, image updates, CLI, and seed regeneration.
  • Update Debian packaging and build instructions to align with established project conventions and Ubuntu targets.
  • Migrate the repository from GitHub to Forgejo; add validation and Debian package build/publishing workflows using existing Forgejo conventions; retire the Launchpad PPA only after the replacement package source is operational.
  • Create/update concise operator documentation for installation, configuration, provisioning, disks, templates, CPU settings, image refresh, seed regeneration and cloud-init cache reset, Puppet management, tests, and packaging.

Acceptance criteria

  • Changes are divided into small, reviewable patches and preserve existing provisioning behavior unless an intentional migration is documented.
  • VM provisioning supports multiple disks and distinct storage pools; cloud-init templates reuse shared configuration.
  • Seed-only regeneration does not modify root or data disks, and the guest-side reinitialization procedure is documented.
  • Image refresh can run unattended without risking existing VM disks or discarding a working cached image on failure.
  • Puppet manages configuration and scheduled updates without destructive automatic reprovisioning.
  • Automated pytest tests run without access to libvirt/QEMU.
  • Modern Python and Debian packages build on supported Ubuntu releases.
  • Forgejo workflows publish usable packages before the old PPA is retired.

Implementation approach

  1. Review the current LCIP repository and identify correctness/safety concerns; agree on interfaces before major changes.
  2. Establish packaging/test foundations and isolate external dependencies where needed.
  3. Implement disks/pools, template inheritance, seed regeneration, CPU configuration, and image management incrementally.
  4. Review and extend the Puppet module, then update documentation.
  5. Migrate to Forgejo and establish package builds/publishing before decommissioning the PPA.

Keep this a focused provisioning utility, not a general VM orchestration framework. Request fresh repository snapshots (including the Puppet module and example Forgejo workflows) before modifying those components.

## Goal Modernize LCIP, the Python/libvirt cloud-image provisioning tool, while keeping it small, reliable, and suitable for Ubuntu 24.04+ (including Ubuntu 26.04). Review the current repository before designing changes and implement the work in small, independently reviewable steps. ## Requirements - [ ] Review the current architecture, VM definition schema, CLI, safety/error handling, and libvirt integration. - [ ] Support multiple VM disks, potentially located on different libvirt storage pools, with predictable device assignment and safe handling of existing volumes. - [ ] Introduce template inheritance to remove duplicated cloud-init configuration across Ubuntu releases; handle missing parents and inheritance cycles. - [ ] Add a seed-only regeneration operation (for example after network configuration changes) without rebuilding disks or domains; document shutdown/restart considerations and safe cloud-init cache reset inside the guest. - [ ] Make CPU configuration explicit and configurable. Review the current mixture of `qemu64`, `host-model`, and `qemu64` with SSSE3 overrides across Intel/AMD hypervisors before selecting defaults. - [ ] Review cloud-image downloading and provide unattended refresh of images for configured templates. Prefer a dedicated LCIP command (such as `lcip update-images`) if it is simpler; otherwise retain a clean shared implementation. Avoid unnecessary downloads, validate downloads appropriately, and preserve the last working image on failure. - [ ] Review and update the existing LCIP Puppet module to manage VM definitions, templates, and scheduled image refreshes (cron or systemd timer). Puppet should not silently recreate running VMs or destroy existing disks. Request the current module snapshot before implementation. - [ ] Modernize the Python implementation using features available with Ubuntu 24.04+, improving typing, validation, subprocess handling, cleanup, error messages, and separation of testable logic from external operations where useful. - [ ] Migrate from `setup.py` to `pyproject.toml`, preserving the CLI entry point and Debian packaging compatibility. - [ ] Add pytest coverage that runs without a hypervisor, using fixtures/mocks for libvirt and external commands; cover definitions, templates, cloud-init, domain XML, disks/pools, CPU features, image updates, CLI, and seed regeneration. - [ ] Update Debian packaging and build instructions to align with established project conventions and Ubuntu targets. - [ ] Migrate the repository from GitHub to Forgejo; add validation and Debian package build/publishing workflows using existing Forgejo conventions; retire the Launchpad PPA only after the replacement package source is operational. - [ ] Create/update concise operator documentation for installation, configuration, provisioning, disks, templates, CPU settings, image refresh, seed regeneration and cloud-init cache reset, Puppet management, tests, and packaging. ## Acceptance criteria - Changes are divided into small, reviewable patches and preserve existing provisioning behavior unless an intentional migration is documented. - VM provisioning supports multiple disks and distinct storage pools; cloud-init templates reuse shared configuration. - Seed-only regeneration does not modify root or data disks, and the guest-side reinitialization procedure is documented. - Image refresh can run unattended without risking existing VM disks or discarding a working cached image on failure. - Puppet manages configuration and scheduled updates without destructive automatic reprovisioning. - Automated pytest tests run without access to libvirt/QEMU. - Modern Python and Debian packages build on supported Ubuntu releases. - Forgejo workflows publish usable packages before the old PPA is retired. ## Implementation approach 1. Review the current LCIP repository and identify correctness/safety concerns; agree on interfaces before major changes. 2. Establish packaging/test foundations and isolate external dependencies where needed. 3. Implement disks/pools, template inheritance, seed regeneration, CPU configuration, and image management incrementally. 4. Review and extend the Puppet module, then update documentation. 5. Migrate to Forgejo and establish package builds/publishing before decommissioning the PPA. Keep this a focused provisioning utility, not a general VM orchestration framework. Request fresh repository snapshots (including the Puppet module and example Forgejo workflows) before modifying those components.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
tools/lcip#1
No description provided.