fix: guest qemu create wont load config correctly #510
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I don't really know what was going on in this file, and feel like things are done weirdly, however the command will work at least with this config.
I feel like the code was commented out and a workaround was added to make it work, however there were several reasons why it could not work, first because the node was not set and second because the vmid was not set.
I think this patch is not better than a workaround, I set the node but it was already set before for the vmref. However I think it may be better to let it like that for now.
Test
Tested by running :
NEW_CLI=true proxmox-api-go -i create guest qemu --file ./qemu.json 123 pve # QemuGuest (123) has been createdTested with this config :
{ "name": "test-qemu01", "bios": "seabios", "tablet": true, "memory": { "capacity": 2048 }, "ostype": "l26", "sockets": 1, "cpu": { "type": "host", "cores": 1 }, "numa": false, "kvm": true, "hotplug": "network,disk,usb", "boot": "order=ide2;net0", "scsihw": "virtio-scsi-pci", "network": { "0": { "bridge": "vmbr0", "firewall": true, "id": 0, "macaddr": "B6:8F:9D:7C:8F:BC", "model": "virtio" } } }