Skip to content

test(e2e): migrate the blockdevice suite to the custom e2e-br image#2633

Draft
Isteb4k wants to merge 21 commits into
mainfrom
e2e/virtual-disk-creation-custom-image
Draft

test(e2e): migrate the blockdevice suite to the custom e2e-br image#2633
Isteb4k wants to merge 21 commits into
mainfrom
e2e/virtual-disk-creation-custom-image

Conversation

@Isteb4k

@Isteb4k Isteb4k commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description

Move the whole blockdevice e2e suite from the ~350 MiB Alpine image to the
minimal from-scratch e2e-br image (~35 MiB), and fix what that surfaced:

  • All blockdevice data sources use the custom image (HTTP/Upload → qcow2 on
    Selectel, registry → ttl.sh container-disk, VI/CVI → precreated
    v12n-e2e-custom-bios); ISO tests use a custom EFI custom.iso.
  • Guest device lookup reads the SCSI serial from the sysfs VPD — the image runs
    no udev, so lsblk SERIAL / by-id are empty; SSH logs in as root, no sudo.
  • Resource waits go through observers, not Eventually (new sig-storage SIG
    label via SIGDescribe, vd BeResized, vmbda observer).
  • Controller fix: ProtectionService.RemoveProtection no longer resurrects a
    finalizer on a terminating PVC, which previously errored and hung VM deletion.
  • DataExports is skipped off-cluster (publish-mode export bug in the
    storage-volume-data-manager module).

New internal/object symbols are additive; other suites keep the Alpine image.

Why do we need it, and what problem does it solve?

e2e-br is ~10× smaller than the Alpine image the suite pulls today. This
migrates the blockdevice group to it and fixes the guest/observer/controller
issues that only appear on a truly minimal (no-udev, no-cloud-init) image.

What is the expected result?

The sig-storage (blockdevice) group passes on the custom image: disks
provision from every source, consumer VMs reach Running + AgentReady, resize
and snapshots work. DataExports runs on a cluster node / in CI. Other suites
are unaffected.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: test
type: chore
summary: Migrate the blockdevice e2e suite to the minimal custom e2e-br image.
impact_level: low

Point every VirtualDiskCreation data source (HTTP, Upload, registry,
VirtualImage, ClusterVirtualImage) at the minimal custom e2e-br image:
a Selectel qcow2 for HTTP/Upload and a ttl.sh container-disk for the
registry source. Drop the cloud-init provisioning for the test's VM —
it only needs the VM as a disk consumer with a live guest agent and
never logs in, so no user has to be created.

New object symbols (ImageURLCustomBIOS, ImageURLCustomContainer,
PrecreatedCVICustomBIOS) are additive; existing constants are left
untouched, so other e2e tests keep their behavior.

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
@Isteb4k Isteb4k added this to the v1.10.0 milestone Jul 10, 2026
Isteb4k added 12 commits July 10, 2026 17:06
The custom e2e-br image is ~35 MiB and grows its root filesystem to the
disk on first boot, so the 400Mi disks are oversized. Use a 50Mi
vdCreationImageSize for the image-backed VirtualDisks instead.

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
Switch every Alpine-based bootable-qcow2 source in the blockdevice suite
to the custom e2e-br image: HTTP (ImageURLAlpineBIOS -> ImageURLCustomBIOS),
registry (ImageURLContainerImage -> ImageURLCustomContainer) and the CVI
ObjectRef (PrecreatedCVIAlpineBIOS -> PrecreatedCVICustomBIOS).

Ubuntu-based tests (data_exports, virtual_disk_resizing, vd_snapshots
Ubuntu cases — they need systemd/SSH/cloud-init), the ISO/CD-ROM format
tests (ImageURLUbuntuISO / PrecreatedCVIUbuntuISO) and the non-bootable
testdata images are left untouched: the custom image is a bootable qcow2,
not a drop-in for those.

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
The quota-exhausted test only needs a valid CVI source to trigger the QuotaExceeded path on PVC creation; use the custom e2e-br image instead of the non-bootable testdata qcow2.

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
data_exports does not SSH — it waits for the guest agent and exports/restores data over the API. Use the custom e2e-br image (agent auto-starts) and drop the Ubuntu cloud-init provisioning.

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
- add observer/vmbda package with BeAttached()/BeFailed() predicates;
- add vd observer BeResizing() predicate;
- source virtual_disk_resizing from the custom e2e-br image, log in as root
  (baked key) instead of the cloud user, and drop sudo (custom has neither
  cloud user nor sudo) via blockdevice-local SSH/lsblk helpers so the shared
  util helpers stay untouched;
- replace resource waits (UntilObjectPhase/UntilSSHReady/UntilDisksAreAttached)
  with observer + WaitFor + predicate; the only remaining Eventually is the
  guest-side lsblk-grows check, deliberately kept and commented as the sole
  sanctioned exception (no Kubernetes resource to observe).

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
Add additive NewHTTPVDCustomBIOS/NewGeneratedHTTPVICustomBIOS constructors (the AlpineBIOS variants stay for other suites), switch importer_network_policy to them, and replace VI/VD phase waits with observer+WaitFor. The Project 'Deployed' wait is kept via UntilObjectState (Project has no typed client/Observer) with an explicit comment.

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
Replace UntilObjectPhase/UntilVMAgentReady resource waits with observer+WaitFor (vi/vd/vm), source the HTTP case from the custom image (NewHTTPVDCustomBIOS), and disable cloud-init provisioning on the consumer VMs (custom image, agent-only).

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
Source all disks from the custom e2e-br image (drop Ubuntu), disable cloud-init provisioning, and replace resource waits with observers: agent/disk/attachment via WaitFor, snapshot readiness via a vdsnapshot observer per snapshot, VM deletion via observer.WaitForDeleted, disks-attached via a VM WaitFor predicate. The transient filesystem-freeze check now uses a new vm.BeFilesystemFrozen() predicate observed from before the snapshot is created (replacing the Eventually poll).

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
…vers

Add blockdevice-local root/no-sudo guest filesystem helpers (guest_fs.go) — the util.* originals stay cloud+sudo for other suites (vmop/restore). Convert data_exports resource waits to observers (agent/stopped/vmop-completed/disk-phase/snapshot-ready/delete), add vm.BeStopped(); the upload-endpoint retry stays as a commented Eventually exception (external HTTP, not a resource). Document the Project 'Deployed' wait exception in setupProject (Project has no typed Observer).

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
Add ImageURLCustomISO/PrecreatedCVICustomISO (HTTP CVI for the custom EFI ISO). Point the ISO/CD-ROM boot and format-expectation tests at the custom ISO instead of the Ubuntu live-server ISO, and drop the VNC subiquity-installer screen assertion (Ubuntu-specific) — the CD-ROM boot test now only asserts the VM reaches Running with a bootable device (Never NoBootableDevice), which is what booting a custom ISO as CD-ROM verifies. Removes the RFB/VNC framebuffer machinery that check required.

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
…tection

ProtectionService.RemoveProtection built its merge patch from a possibly stale
(informer cache) copy and resent the whole finalizers list. On a terminating
PersistentVolumeClaim this could re-add kubernetes.io/pvc-protection that the
built-in pvc-protection controller had already dropped, which the API server
rejects with 422 ("no new finalizers can be added if the object is being
deleted"). The VM deletion handler surfaced this as "failed to release PVC
protection" and never removed the VM cleanup finalizer, so VM deletion hung.

Re-read a fresh copy and patch it under an optimistic lock, retrying on
conflict, so only our finalizer is removed and no other finalizer is
resurrected.

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
…rt skip

Blockdevice suite hardening on top of the custom e2e-br image:

- Introduce label.SIGDescribe and SIG labels (mirroring Kubernetes' [sig-*]
  ownership labels) and group the blockdevice specs under sig-storage, so the
  group can be run with `--label-filter='sig-storage'`.
- Resolve guest block devices by their SCSI VPD serial read straight from
  sysfs (/sys/block/*/device/vpd_pg80). The minimal e2e-br image runs no udev,
  so lsblk's SERIAL column and /dev/disk/by-id are empty; this also drops the
  awk one-liner whose single quotes clashed with d8 ssh -c '...'.
- Add vd observer predicate BeResized and wait on it after a resize instead of
  BeReady, which errors on the transient Resizing phase.
- Skip DataExports when the suite runs off-cluster: publish-mode export is
  currently broken by a bug in the storage-volume-data-manager module (origin
  Ingress looked up in d8-user-authn instead of kube-system). TODO to drop the
  skip once fixed.
- Filter the benign pvc-protection cleanup error and raise the VM-deletion wait
  to LongTimeout.

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
@Isteb4k Isteb4k requested a review from yaroslavborbat as a code owner July 11, 2026 13:28
Isteb4k added 3 commits July 11, 2026 15:32
Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
@Isteb4k Isteb4k changed the title test(e2e): source VirtualDiskCreation from the custom e2e-br image test(e2e): migrate the blockdevice suite to the custom e2e-br image Jul 11, 2026
@Isteb4k Isteb4k marked this pull request as draft July 11, 2026 13:47
Isteb4k added 5 commits July 13, 2026 11:05
- drop the redundant copyloopvar copy in the resize goroutine loop (unparam/copyloopvar)
- drop the always-constant bdKind param from getBlockDeviceLsblkSizeAsRoot
- download DataExports artifacts into a Ginkgo per-spec temp dir instead of the
  working directory, so a run leaves nothing untracked in the repo

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
The disk is deleted right after being exported; its exporter pod keeps the PVC
mounted until the export tears down, so deletion can exceed the 1m MiddleTimeout
(it finishes in ~15s once released). Use LongTimeout.

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
In-cluster measurement shows vd-data deletion after export is fast (~0-16s on
healthy storage). The earlier LongTimeout bump was unjustified: the >1m hang was
caused by transient LINSTOR degradation, and a larger timeout would have masked
that flaky storage rather than surfacing it.

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
…sk in DataExports

The test deleted vd-data and blocked on observer.WaitForDeleted, which timed
out flakily. The wait is unnecessary: the restored disks use different names and
the VM's block devices are reassigned away from vd-data, so nothing depends on
the original being gone. vd-data is removed by the deferred cleanup at teardown.

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
… in the no-consumer snapshot test

The no-consumer case deletes the throwaway VM to leave the disk without a
consumer, then snapshots it. It waited on observer.WaitForDeleted(VM), which
gated on VM-object teardown and timed out flakily. Wait instead for the actual
precondition — vdobs.BeDetached() (the disk has no attached VM) — which is what
the snapshot needs and does not depend on VM teardown latency.

Signed-off-by: Dmitry Rakitin <dmitry.rakitin@flant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant