[GH-ISSUE #187] Feature Proposal: qemu disk structure change #39

Open
opened 2026-02-28 00:40:17 +03:00 by kerem · 3 comments
Owner

Originally created by @Tinyblargon on GitHub (Aug 15, 2022).
Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/187

In the current implementation it is only possible to configure 31 disks in total. Proxmox allows you to configure 4 ide, 6 sata, 16 virtio and 31 scsi drives for a total of 57 drives. I was thinking about re-implementing this at some point in this project and the terraform provider.

Current structure

"disk": {
	"0": {},
	"1": {},
	"2": {},
	"3": {},
	"4": {},
	"5": {},
	"6": {},
	"7": {},
	"8": {},
	"9": {},
	"10": {},
	"11": {},
	"12": {},
	"13": {},
	"14": {},
	"15": {},
	"16": {},
	"17": {},
	"18": {},
	"19": {},
	"20": {},
	"21": {},
	"22": {},
	"23": {},
	"24": {},
	"25": {},
	"26": {},
	"27": {},
	"28": {},
	"29": {},
	"30": {}
}

Proposed structure

"disk": {
	"ide": {
		"0": {},
		"1": {},
		"2": {},
		"3": {}
	},
	"sata": {
		"0": {},
		"1": {},
		"2": {},
		"3": {},
		"4": {},
		"5": {}
	},
	"virtio": {
		"0": {},
		"1": {},
		"2": {},
		"3": {},
		"4": {},
		"5": {},
		"6": {},
		"7": {},
		"8": {},
		"9": {},
		"10": {},
		"11": {},
		"12": {},
		"13": {},
		"14": {},
		"15": {}
	},
	"scsi": {
		"0": {},
		"1": {},
		"2": {},
		"3": {},
		"4": {},
		"5": {},
		"6": {},
		"7": {},
		"8": {},
		"9": {},
		"10": {},
		"11": {},
		"12": {},
		"13": {},
		"14": {},
		"15": {},
		"16": {},
		"17": {},
		"18": {},
		"19": {},
		"20": {},
		"21": {},
		"22": {},
		"23": {},
		"24": {},
		"25": {},
		"26": {},
		"27": {},
		"28": {},
		"29": {},
		"30": {}
	}
}
Originally created by @Tinyblargon on GitHub (Aug 15, 2022). Original GitHub issue: https://github.com/Telmate/proxmox-api-go/issues/187 In the current implementation it is only possible to configure 31 disks in total. Proxmox allows you to configure 4 ide, 6 sata, 16 virtio and 31 scsi drives for a total of 57 drives. I was thinking about re-implementing this at some point in this project and the terraform provider. Current structure ```json "disk": { "0": {}, "1": {}, "2": {}, "3": {}, "4": {}, "5": {}, "6": {}, "7": {}, "8": {}, "9": {}, "10": {}, "11": {}, "12": {}, "13": {}, "14": {}, "15": {}, "16": {}, "17": {}, "18": {}, "19": {}, "20": {}, "21": {}, "22": {}, "23": {}, "24": {}, "25": {}, "26": {}, "27": {}, "28": {}, "29": {}, "30": {} } ``` Proposed structure ```json "disk": { "ide": { "0": {}, "1": {}, "2": {}, "3": {} }, "sata": { "0": {}, "1": {}, "2": {}, "3": {}, "4": {}, "5": {} }, "virtio": { "0": {}, "1": {}, "2": {}, "3": {}, "4": {}, "5": {}, "6": {}, "7": {}, "8": {}, "9": {}, "10": {}, "11": {}, "12": {}, "13": {}, "14": {}, "15": {} }, "scsi": { "0": {}, "1": {}, "2": {}, "3": {}, "4": {}, "5": {}, "6": {}, "7": {}, "8": {}, "9": {}, "10": {}, "11": {}, "12": {}, "13": {}, "14": {}, "15": {}, "16": {}, "17": {}, "18": {}, "19": {}, "20": {}, "21": {}, "22": {}, "23": {}, "24": {}, "25": {}, "26": {}, "27": {}, "28": {}, "29": {}, "30": {} } } ```
Author
Owner

@mleone87 commented on GitHub (Aug 24, 2022):

that would be great and, IMHO, it should have been like that from the beginning.
Unfortunately this will have a massive impact on terraform provider so it will have to be reworked on this part from scratch

<!-- gh-comment-id:1225376866 --> @mleone87 commented on GitHub (Aug 24, 2022): that would be great and, IMHO, it should have been like that from the beginning. Unfortunately this will have a massive impact on terraform provider so it will have to be reworked on this part from scratch
Author
Owner

@Tinyblargon commented on GitHub (Feb 16, 2023):

Started reworking on a new Qemu disk structure in https://github.com/Tinyblargon/proxmox-api-go/tree/Overhaul-Qemu-Disks

<!-- gh-comment-id:1432919022 --> @Tinyblargon commented on GitHub (Feb 16, 2023): Started reworking on a new Qemu disk structure in https://github.com/Tinyblargon/proxmox-api-go/tree/Overhaul-Qemu-Disks
Author
Owner

@Tinyblargon commented on GitHub (Apr 3, 2023):

@mleone87 I've re-implemented the the disk structure.
Due to the the size of this change I was unable to keep the old disk implementation working.
Do we have any plans for moving forward with big breaking changes like this?
Currently i have marked the old implementation as deprecated. it might be better to remove it since i couldn't keep it working and it riddled with bugs that cause it to panic.

This new implementation is able to deal with:

  • linked clones
  • pass-through disks
  • virtual disks
  • cdrom (pass-through and iso file)
  • cloud-init drive

Also the logic for resizing and moving disk has been added to this project.
This means that developers can call the update function and all the CRUD operations related to disks are handled by it.
(some of these parts had to be updated as well, as they did not implement all options proxmox allows.)

I'm currently finalizing the implementation of the terraform provider.

About 70% of the code is tests, as there where many edge cases.

I have already fixed the merge conflicts.
https://github.com/Tinyblargon/proxmox-api-go/tree/Overhaul-Qemu-Disks-Merge

<!-- gh-comment-id:1494165170 --> @Tinyblargon commented on GitHub (Apr 3, 2023): @mleone87 I've re-implemented the the disk structure. Due to the the size of this change I was unable to keep the old disk implementation working. Do we have any plans for moving forward with big breaking changes like this? Currently i have marked the old implementation as deprecated. it might be better to remove it since i couldn't keep it working and it riddled with bugs that cause it to panic. This new implementation is able to deal with: - linked clones - pass-through disks - virtual disks - cdrom (pass-through and iso file) - cloud-init drive Also the logic for resizing and moving disk has been added to this project. This means that developers can call the update function and all the CRUD operations related to disks are handled by it. (some of these parts had to be updated as well, as they did not implement all options proxmox allows.) I'm currently finalizing the implementation of the terraform provider. About 70% of the code is tests, as there where many edge cases. I have already fixed the merge conflicts. https://github.com/Tinyblargon/proxmox-api-go/tree/Overhaul-Qemu-Disks-Merge
Sign in to join this conversation.
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/proxmox-api-go#39
No description provided.