Skip to content

backport: v4.0.2 volume lifecycle fixes to v3.x as 3.2.6 - #302

Merged
TheGrandWazoo merged 8 commits into
release/3.xfrom
backport/3.2.6
Oct 13, 2026
Merged

TheGrandWazoo merged 8 commits into
release/3.xfrom
backport/3.2.6

Conversation

@TheGrandWazoo

Copy link
Copy Markdown
Owner

Backport of the v4.0.2 fixes to the archived v3.x line (ADR-013), as v3.2.6. Cherry-picked with -x from main:

Issue Original Backport Notes
#292 placeholder path() + t/ harness + prove in CI 1bbcba1 8286143 clean
#291 multipath path() owner/vtype, _naa_to_wwid(undef) 147b461 e0c5f46 clean
#294 cloud-init parse_volname c45c3b0 3d09202 clean
#294 list-context volume_size_info 664dfe6 8046880 clean
#294 volume_resize 312cfa8 d2c8dd2 conflict resolved: the WebSocket PUT → pool.dataset.update mapping is dropped, because v3.x is REST-only. The resize itself uses _api(PUT /pool/dataset/id/…), which v3 has.
#299 multipath exact-version Depends + CI guard ccc4ae2 e31b9ad clean

The last commit (54709a3) covers housekeeping:

  • $VERSION 3.2.6, plus CHANGELOG [3.2.6] with a "Not backported" note.
  • Debian changelogs 3.2.6-1.
  • README version references retargeted to "fixed in v3.2.6 / on 3.2.5 and earlier".

Testing: prove t/ gives 4 files and 55 assertions, all passing on the v3 base. The REST code path is the same one live-verified for 4.0.2 against CORE 13.0-U6.8. A v3.2.6 build has not been live-tested on a node yet.

🤖 Generated with Claude Code

TheGrandWazoo and others added 8 commits October 13, 2026 12:19
PVE's content delete (pvesm free, GUI Remove) and qm destroy call path()
only for the owner/vtype before vdisk_free. Dying when the zvol had no
iSCSI extent made orphans from failed allocs or v2-era leftovers
undeletable through PVE, even though free_image already handles the
no-extent case. activate_volume and qemu_blockdev_options keep dying on
the same condition, so the placeholder can never be opened by a VM.

Adds the first Perl unit-test harness (t/, prove in CI lint job) with a
mock TrueNAS API so plugin entry points can be tested off a PVE node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 1bbcba1)
qm destroy calls path() and skips any disk whose owner != vmid. The
multipath plugin returned the LUN id (usually 0) as the owner and the
storeid as the vtype, so every truenas-multipath disk was silently left
behind on TrueNAS while the task reported OK.

Also make _naa_to_wwid return undef for a missing NAA: it returned a
truthy "3", which pointed path()/activate_volume at /dev/mapper/3 and
bypassed the #292 placeholder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 147b461)
alloc_image already creates cloud-init drives under PVE's standard name,
but parse_volname only knew disk-N and state-* volumes, so every later
operation on the drive - including qm destroy - died with "unable to
parse TrueNAS volume name". base- variant covers templates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit c45c3b0)
…t context (#294)

PVE's content API (and the bpg/proxmox Terraform provider through it)
calls volume_size_info in list context and dies "no format" when the
second value is missing, so every disk on a truenas storage failed to
refresh. Mirrors ZFSPoolPlugin: used comes from usedbydataset, and a
missing zvol now dies instead of reporting a size of 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 664dfe6)
Without an override the base Plugin.pm resize dies "can't resize this
image format", which blocked qm disk resize, the GUI and Terraform's
cloud-image provisioning. Grows the zvol via pool/dataset update
(1 MiB-aligned, integer volsize for SCALE's Pydantic). The WebSocket
transport gains the PUT -> pool.dataset.update mapping it needs.

Multipath additionally rescans the target's kernel sessions and runs
multipathd resize map when the device is active on this node, since
QMP block_resize on a host_device can't grow past the stale dm size.

Backport note: release/3.x is REST-only, so the WebSocket PUT ->
pool.dataset.update mapping from the original commit is dropped.

(cherry picked from commit 312cfa8)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…299)

TrueNASMultipath.pm calls the base plugin's private helpers, and from 4.0.2
it also calls SUPER::volume_resize. So it only works with the truenas-proxmox
built from the same commit. `>= 3.1.0` let apt pair 4.0.2 multipath with
a 3.2.5 or 4.0.1 base, which fails at runtime. `(= ${VERSION})` makes apt
upgrade or hold the two together. A CI check fails the build if the
template ever drifts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit ccc4ae2)
The 4.0.2 fixes above are cherry-picked for v3 users who can't move to v4
yet. This adds the version bump, CHANGELOG and Debian changelog entries,
and README version numbers retargeted to the 3.x line (3.2.5 and earlier /
fixed in 3.2.6), so v3 readers aren't told to upgrade to a version on a
track they don't use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
During the 3.2.6 live test, `qm cloudinit update` failed on a running VM
on all three SCALE storages, with "Tray of the device is not open". It
passed on CORE and on v4.0.2 (even 1 s after VM start), and succeeded on
retry. Timing the REST call showed why: SCALE answers in 0.8–3.1 s,
compared with 0.09 s on CORE. That stretches PVE's open-tray → attach →
insert sequence long enough for the guest to close the tray. It isn't a
backport defect (3.2.5 couldn't do cloud-init at all). It's the slow
deprecated REST API that v4's WebSocket transport replaces. This adds a
README troubleshooting entry with workarounds, and the CHANGELOG
known-limitation and verification notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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