[GH-ISSUE #39] argument issues with qemu Clone/MoveDisk and policy on API backward compatibility #12

Closed
opened 2026-03-03 14:44:38 +03:00 by kerem · 2 comments
Owner

Originally created by @jqueuniet on GitHub (Jan 12, 2023).
Original GitHub issue: https://github.com/luthermonson/go-proxmox/issues/39

Hi,

I'm having issues using this client implementation of qemu Clone and MoveDisk.

MoveDisk seems focused on moving disks between storage backends and forces the use of the optional storage parameter, whereas I would like to use it to move disks from one VM to another while keeping the same storage backend, for which I need the optional parameters format, target-disk and target-vmid.

Clone has similar issues and forces the usage of the target optional parameter even though it only works with shared storage backends. I'm using local ZFS pools with templates in the local filesystem, and thus needs the full, storage and format optional parameters instead.

I could do a PR implementing all this while keeping the current optional parameters, but as those methods are using hardcoded args, this either means duplicating methods or breaking API compatibility, and I would like to ask for opinions on this subject first.

Originally created by @jqueuniet on GitHub (Jan 12, 2023). Original GitHub issue: https://github.com/luthermonson/go-proxmox/issues/39 Hi, I'm having issues using this client implementation of qemu `Clone` and `MoveDisk`. `MoveDisk` seems focused on moving disks between storage backends and forces the use of the optional `storage` parameter, whereas I would like to use it to move disks from one VM to another while keeping the same storage backend, for which I need the optional parameters `format`, `target-disk` and `target-vmid`. `Clone` has similar issues and forces the usage of the `target` optional parameter even though it only works with shared storage backends. I'm using local ZFS pools with templates in the local filesystem, and thus needs the `full`, `storage` and `format` optional parameters instead. I could do a PR implementing all this while keeping the current optional parameters, but as those methods are using hardcoded args, this either means duplicating methods or breaking API compatibility, and I would like to ask for opinions on this subject first.
kerem closed this issue 2026-03-03 14:44:38 +03:00
Author
Owner

@luthermonson commented on GitHub (Jan 12, 2023):

MoveDisk does no justice to the move_disk api end point at all and i totally agree. maybe it can be rewritten by having a MoveDIskOptions which can just be passed as nil if you have none and use it if you need it? Move storage to that and make disk a mandatory string?

Clone also lacks some optionals doesn't it. Maybe the same thing? Make the newid mandatory and have a CloneOptions with the optional options and make it a pointer if you want to pass no params?

<!-- gh-comment-id:1381073240 --> @luthermonson commented on GitHub (Jan 12, 2023): `MoveDisk` does no justice to the move_disk api end point at all and i totally agree. maybe it can be rewritten by having a `MoveDIskOptions` which can just be passed as nil if you have none and use it if you need it? Move storage to that and make `disk` a mandatory string? `Clone` also lacks some optionals doesn't it. Maybe the same thing? Make the newid mandatory and have a `CloneOptions` with the optional options and make it a pointer if you want to pass no params?
Author
Owner

@jqueuniet commented on GitHub (Jan 13, 2023):

Discussion resolved with PR #40

<!-- gh-comment-id:1382373130 --> @jqueuniet commented on GitHub (Jan 13, 2023): Discussion resolved with PR #40
Sign in to join this conversation.
No labels
pull-request
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
starred/go-proxmox#12
No description provided.