-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
feat(vm): add support for boot_order
argument for VM
#219
Conversation
Codecov ReportBase: 11.20% // Head: 11.29% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #219 +/- ##
==========================================
+ Coverage 11.20% 11.29% +0.09%
==========================================
Files 54 54
Lines 11726 11738 +12
==========================================
+ Hits 1314 1326 +12
Misses 10386 10386
Partials 26 26
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Hey @HenriAW, thanks for the PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @HenriAW ! 👋🏻
Thanks again for the PR!
I'd like to make a few changes to align it better with the PVE API and the existing code, please see my comments.
If you have any questions, feel free to toss them in, I'll be happy to discuss 🙂
Type: schema.TypeString, | ||
Description: "Specify the guest boot order", | ||
Optional: true, | ||
Default: dvResourceVirtualEnvironmentVMBootOrder, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per documentation, the boot order is specified as a comma-separate list, so I'd like to reflect that in the schema as well, i.e. to have something like:
Type: schema.TypeString, | |
Description: "Specify the guest boot order", | |
Optional: true, | |
Default: dvResourceVirtualEnvironmentVMBootOrder, | |
Type: schema.TypeList, | |
Description: "Specify the guest boot order", | |
Optional: true, | |
Elem: &schema.Schema{Type: schema.TypeString}, | |
Default: dvResourceVirtualEnvironmentVMBootOrder, |
This would also require adding a logic to convert from a list to a string and back. VM tags can be taken as an example as they are processed in a similar way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You would also need to read the boot order back from PVE to populate the current state. It is usually done in resourceVirtualEnvironmentVMReadPrimitiveValues
for values that referenced as primitives in the API model. Also keep in mind that we need to read from the "order" property of "boot" value returned by the PVE API.
@@ -120,6 +120,8 @@ output "ubuntu_vm_public_key" { | |||
- `bios` - (Optional) The BIOS implementation (defaults to `seabios`). | |||
- `ovmf` - OVMF (UEFI). | |||
- `seabios` - SeaBIOS. | |||
- `boot_order` - (Optional) Specify the guest boot order (defaults to `c`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're referring to the "legacy" parameter of the boot order which specifies a disk by its letter. We should probably switch to the device names: https://pve.proxmox.com/pve-docs/chapter-qm.html#qm_options
boot_order
ccccccjejlebcblviluhhcektiegvbhvgcldutugtrrdboot_disk flags for VM
boot_order
ccccccjejlebcblviluhhcektiegvbhvgcldutugtrrdboot_disk flags for VMboot_order
argument for VM
Community Note
Closes #214
boot_order
andboot_disk
flags added to the VM resource. These are passed to theboot
andbootdisk
parameters in the Proxmox VE API described here.