mirror of
https://github.com/Telmate/proxmox-api-go.git
synced 2026-04-25 23:45:55 +03:00
[PR #489] [MERGED] fix: Preserve volume path for LVM-based disks #504
Labels
No labels
good first issue
issue/confirmed
issue/critical
proposal/accepted
pull-request
type/bug
type/enhancement
type/feature
type/question
type/refactoring
type/testing
type/testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/proxmox-api-go#504
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Telmate/proxmox-api-go/pull/489
Author: @pavel-z1
Created: 10/20/2025
Status: ✅ Merged
Merged: 10/23/2025
Merged by: @Tinyblargon
Base:
master← Head:fix/lvm-disk-update📝 Commits (1)
633876efix: Preserve volume path for LVM-based disks📊 Changes
6 files changed (+27 additions, -5 deletions)
View changed files
📝
proxmox/config__qemu__disk.go(+10 -4)📝
proxmox/config__qemu__disk__ide.go(+3 -0)📝
proxmox/config__qemu__disk__sata.go(+3 -0)📝
proxmox/config__qemu__disk__scsi.go(+3 -0)📝
proxmox/config__qemu__disk__virtio.go(+3 -0)📝
proxmox/config__qemu__disk_test.go(+5 -1)📄 Description
fix: Preserve full volume path for LVM-based disks
Issue
When updating a QEMU virtual machine that uses disks on LVM-based storage, the Proxmox API returns a
500 can't activate LVerror.This occurs because the API client incorrectly parses the disk identifier (e.g.,
storage:vm-123-disk-0). It retains the storage pool and the disk's numeric ID but discards the full volume path (e.g.,vm-123-disk-0). During a subsequent update operation (like changing disk bandwidth or backup settings), the client sends an incomplete identifier back to the API, which causes the operation to fail as the logical volume cannot be found.Error Example
An attempt to update a VM resource results in the following error:
Error: error updating VM: 500 can't activate LV '/dev/lun-st1-db/vm-153-disk-0': Failed to find logical volume "lun-st1-db/vm-153-disk-0" (params: map[... scsi0:lun-st1-db:vm-153-disk-0,aio=native,discard=on ...])The Fix
This pull request corrects the disk parsing and handling logic to ensure the full volume path is preserved throughout the lifecycle of the object and used during subsequent API operations.
qemuDiskstruct is updated with aVolumePathfield to store the complete volume identifier.parseDiskfunction is modified to correctly extract and store thisVolumePath.VolumePathduring internal data conversions.mapToApiValuesfunction now uses the preservedVolumePathwhen constructing API requests for disk updates, ensuring the correct, full identifier is always sent to Proxmox.This change resolves the update failure for LVM-backed disks without affecting other storage types.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.