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

[Feature Request] Template based new VM #4

Open
tobsowo opened this issue Nov 3, 2022 · 6 comments
Open

[Feature Request] Template based new VM #4

tobsowo opened this issue Nov 3, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@tobsowo
Copy link

tobsowo commented Nov 3, 2022

Ability for a user to have a ready made installed and configured VM with an automated email for login URL with server info and login credentials.

An example use case installing Mautic on a new server from template without the need for any human interaction.

@notbasetwo
Copy link
Member

This should really be broken down in to multiple problems, this is quite a big goal as automated deployment in this way isn't really baked in to Proxmox.

In reality, you would need cloudinit support to be configured inside the module (not too hard) and if you wanted this automated in the "give it an IP and stuff" - an IPAM system.

@tobsowo
Copy link
Author

tobsowo commented Nov 22, 2022

This should really be broken down in to multiple problems, this is quite a big goal as automated deployment in this way isn't really baked in to Proxmox.

In reality, you would need cloudinit support to be configured inside the module (not too hard) and if you wanted this automated in the "give it an IP and stuff" - an IPAM system.

I'm not really technically sound in this just believe it's something that's achievable. Maybe you can share more details about how this can be done.

Thank you.

@tobsowo
Copy link
Author

tobsowo commented Nov 22, 2022

Just reading up on cloud-init and found this.
https://pve.proxmox.com/wiki/Cloud-Init_Support

This is interesting to know.

@notbasetwo
Copy link
Member

Just reading up on cloud-init and found this. https://pve.proxmox.com/wiki/Cloud-Init_Support

This is interesting to know.

Yes, this is very possible. cloud-init is super powerful and with the right configuration, can also even be made to work with Microsoft Windows.

This just requires being implemented in to the module prior to templates working. There are a few steps before it can become a reality.

IP-address management (IPAM) is also not present and is needed to provide traditional VPS-style networking where everyone gets an IP assigned to them & what not. This has security implications too (e.g. ensuring that firewalling is configured correctly so that users can't just go and use any 'ol network address).

@notbasetwo
Copy link
Member

notbasetwo commented Nov 30, 2022

Going on from this, this is possible in Proxmox by doing the following (depending on virtualisation type):

LXC Container:

  • Create/download template file for your distro/application of choice. (Canonical have tons of these, Proxmox has loads in their UI by default).
  • Create a container with the template file, passing all the information for configuration with it (IP, hostname, username/password, etc.)
  • Boot the container, wait for it to finish what it needs to do.
  • Done!

QEMU VM:

  • Create/download template VM for your distro/application of choice. (these will normally need some work on top of a standard "cloud" image (e.g. installing qemu-quest-tools)).
  • Clone the template VM in Proxmox. (mechanic to wait for this to finish must be present)
  • Adjust VM's specifications in the new VM inc. resizing the disk.
  • Add appropriate firewall rules to prevent wrong IPs being used (see: IP Sets in Proxmox).
  • Edit cloudinit information to contain new username, password (and/or SSH key) and network information.
  • Boot the VM, wait a bit for it to finish what it needs to do.
  • Done!

"Re-installing" for both is not really a mechanic in Proxmox, the easiest way to do this is just delete & re-create the VM using above process.

The QEMU process may seem overly drawn out & long winded - but this is essentially what the PVE is doing for you in LXC containers. Proxmox provides little to no native ways to do this cleanly. QEMU throws additional issues due to the added complexities in VM templates. #13

I have a mockup locally for how this could work (very dirty and quick script) using the PVE2 library if anyone wants to see it (if they are interested in implementing this).

@tobsowo
Copy link
Author

tobsowo commented Nov 30, 2022

I have a mockup locally for how this could work (very dirty and quick script) using the PVE2 library if anyone wants to see it (if they are interested in implementing this).

I would want to try this out.

@Anuril Anuril moved this to 0.1.0 in Proxmox Module Roadmap Sep 20, 2023
@Anuril Anuril added the enhancement New feature or request label Sep 20, 2023
@Anuril Anuril self-assigned this Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 0.1.0
Development

No branches or pull requests

3 participants