Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix disk import when VM template has multiple disks #96

Merged
merged 1 commit into from
Jul 22, 2022

Conversation

bpg
Copy link
Owner

@bpg bpg commented Jul 22, 2022

The disk import operation is not exposed via Proxmox APIs, so implemented as a sequence of commands run as an inline script via ssh.
qm importdisk is used to import a disk into VM from an external file, however, it auto-generates the disk ID.
The following command qm set is used to assign the imported disk to a VM, and it requires the disk ID as a parameter.

Update the import logic to read the disk ID from the output of qm importdisk command rather than trying to assume it from a number of disks defined in the VM.

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #88

@bpg bpg added the go label Jul 22, 2022
The disk import operation is not exposed via Proxmox APIs, so implemented as a sequence of commands run as an inline script via ssh.
`qm importdisk` is used to import a disk into VM from an external file, however, it auto-generates the disk ID.
The following command `qm set` is used to assign the imported disk to a VM, and it requires the disk ID as a parameter.

Update the import logic to read the disk ID from the output of `qm importdisk` command rather than trying to assume it from a number of disks defined in the VM.
@bpg bpg added the 🐛 bug Something isn't working label Jul 22, 2022
@bpg bpg merged commit 37fe0e0 into main Jul 22, 2022
@bpg bpg deleted the vm-multiple-disks-fix branch July 22, 2022 23:03
@bpg bpg removed the 🐛 bug Something isn't working label Jul 23, 2022
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.

Error creating VM with multiple disks on different storages
1 participant