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

[Proxmox-clone] add cloud-init config #7

Closed
ghost opened this issue Apr 20, 2021 · 5 comments · Fixed by #142
Closed

[Proxmox-clone] add cloud-init config #7

ghost opened this issue Apr 20, 2021 · 5 comments · Fixed by #142

Comments

@ghost
Copy link

ghost commented Apr 20, 2021

This issue was originally opened by @RemiDesgrange as hashicorp/packer#10251. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


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

Proxmox clone could have some key to setup cloud-init (user, ssh key etc...)

Use Case(s)

Being able to override cloud-init base template we inherit from.

Potential configuration

"cloud_init": {
  "user": "user",
  "password": "pass",
  "ssh_keys": "XXXX"
  "ip_config": "ip=dhcp",
  "dns_domain": "example.com",
  "dns_servers": "1.1.1.1"
}
@modem7
Copy link

modem7 commented Nov 29, 2022

This would also be useful for the ISO builder.

@sebastian-de
Copy link
Contributor

@modem7 proxmox-api-go supports Cloud-Init options only for clones:
https://github.com/Telmate/proxmox-api-go/blob/f357e13975a13680029bf6fb0530760cec3f1ae4/proxmox/config_qemu.go#L92
I haven't tried if this is a limitation of the Proxmox API itself, though.

But I actually don't see a use case for Cloud-Init with the ISO builder.

Anyway, once #130 is merged I'll open a PR that adds Cloud-Init options to the clone builder. If you're interested, my changes are here: https://github.com/sebastian-de/packer-plugin-proxmox/tree/clone-cloud-init-v3

@modem7
Copy link

modem7 commented Dec 12, 2022

But I actually don't see a use case for Cloud-Init with the ISO builder.

I totally understand where you're coming from here. The proper way to do it would be to have a bare template with no additional settings in cloud-init etc, then use Terraform or similar to deploy a (set of) VM(s).

My particular use case is purely using Packer (and maybe Ansible) to make a base template, then in Proxmox, just right clicking > clone. The process is probably a remnant of my pre-Packer days more than anything, but just trying to cover the "this is how I do things, might be useful for others also".

If it's just a me thing, happy to close this off as there are more important features like secureboot and memory ballooning etc.

@sebastian-de
Copy link
Contributor

Ah, so we're talking about two different things. The proxmox-clone builder uses Cloud-Init for the templating itself (to be able to connect to the VM and run provisioners). User and SSH-key are always set to to the ones used by the SSH communicator during build. These are currently not cleaned up correctly and can be found in templates created with the clone builder: #112

To create a pre-configured Cloud-Init drive that gets attached to the final template would be a different matter. But I guess this should be possible.

@modem7
Copy link

modem7 commented Dec 12, 2022

User and SSH-key are always set to to the ones used by the SSH communicator during build. These are currently not cleaned up correctly and can be found in templates created with the clone builder: #112

Oh cool, wasn't actually aware of this! That's a pretty nifty trick (but also, understandly annoying bug).

To create a pre-configured Cloud-Init drive that gets attached to the final template would be a different matter. But I guess this should be possible.

Aye, I know it's possible via the qm set command, but unsure about the API. Also, given the above information, I wonder how it'd handle the clone builder if it was called after having it set by the ISO builder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants