Open chrisbenincasa opened 1 year ago
Update on my attempt here, here's the WIP: https://github.com/hashicorp/packer-plugin-proxmox/compare/main...chrisbenincasa:packer-plugin-proxmox:ct-create?expand=1
Few notes:
pct exec
commands to run inside of the container. This functionality also isn't exposed by the APIThis is a very good improvement , it's a must have to automate basically everything with packer
It appears the missing piece is in APIv2 https://pve.proxmox.com/pve-docs/api-viewer/index.html#/nodes/{node}/lxc/{vmid}/interfaces
It's been a while but if I remember correctly, that API endpoint will only return an IP address if it was statically assigned by the host node and not if DHCP was used
I just tested with an LXC container configured to use DHCP. The API gives me the IP given by DHCP. :)
pvesh get /nodes/ank/lxc/104/interfaces --noborder
hwaddr name inet inet6
00:00:00:00:00:00 lo 127.0.0.1/8 ::1/128
bc:24:11:39:62:84 eth0 192.168.10.219/24 fe80::be24:11ff:fe39:6284/64
Oh that's awesome! That will definitely simplify the implementation
hey @chrisbenincasa, outstanding work you have in the PR. This is definitely a must have to build images and container templates on my homelab. Do you know if it's far from stable or it can be used as is?
Please search the existing issues for relevant feature requests, and use the reaction feature (https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to add upvotes to pre-existing requests.
Community Note
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request. If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Description
New builders for creating and cloning CTs (containers) and / or converting them into templates
Use Case(s)
Containers are a core feature of Proxmox, alongside VMs. It would be useful to automate the creation of container templates, etc.
Potential configuration
I have a minimal working version of container creation in my fork of the plugin. I'd be happy to take a stab at implementing the new builders! The configuration I have looks like:
Potential References
https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/lxc https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/lxc/{vmid}/template