Skip to content

[Feature]: Golden container disk image with pre-installed workload tools #16

Description

@mrhillsman

Problem Statement

Virtwork currently installs workload tools (stress-ng, fio, iperf3, pgbench) at VM boot time via cloud-init package installation. This approach adds boot latency, depends on external package repositories being available, and increases the chance of transient failures during provisioning.

Proposed Solution

Build a pre-baked golden container disk image with all workload tools pre-installed. VMs would boot ready to run workloads immediately, with no package installation step required.

The golden image should include:

  • stress-ng — CPU/memory workloads; also supports thermal, I/O, and scheduler stress
  • fio — Disk workloads; can simulate disk saturation scenarios
  • iperf3 — Network workloads
  • pgbench / postgresql-server — Database workloads
  • tc (traffic control) / iproute-tc — Network chaos: latency injection, packet loss, bandwidth throttling
  • iptables-nft — Network partition simulation, port blocking
  • kill / pkill — Process chaos (available by default in base image)
  • fallocate / dd — Disk fill chaos
  • tc-netem — Advanced network emulation (jitter, reordering, duplication)

Files to Create

  • build/golden-image/Containerfile — Multi-stage build definition based on Fedora 41 with all tools pre-installed

Files to Modify

  • internal/workloads/cpu.go — Remove dnf install from cloud-init; assume stress-ng is pre-installed
  • internal/workloads/memory.go — Remove dnf install from cloud-init; assume stress-ng is pre-installed
  • internal/workloads/database.go — Remove dnf install from cloud-init; assume postgresql-server and pgbench are pre-installed
  • internal/workloads/network.go — Remove dnf install from cloud-init; assume iperf3 is pre-installed
  • internal/workloads/disk.go — Remove dnf install from cloud-init; assume fio is pre-installed
  • internal/constants/defaults.go — Update default container disk image to the golden image

Expected Outcome

  • A Containerfile in build/golden-image/ that extends quay.io/containerdisks/fedora:41 and installs all required packages
  • Image published to a container registry (e.g., quay.io/opdev/virtwork-golden:latest)
  • Default --container-disk-image value updated to point to the golden image
  • All existing workload cloud-init scripts simplified to remove package installation steps
  • Cloud-init scripts only configure and start systemd services
  • Boot time reduced significantly

Alternatives Considered

Not provided

Area

CLI / Configuration, VM provisioning, Workloads

Additional Context

This feature is a prerequisite for the chaos engineering workload requests. The chaos workloads depend on tools (tc, iptables, etc.) being pre-installed in the golden image.

Related Issues: See chaos workload requests that depend on this issue.

Split from #15

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.size/XLDenotes a PR that changes 500-999 lines, ignoring generated files.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions