Full automated Ubuntu installation

bigbrother

New Member
May 22, 2021
23
2
3
25
Hi

My question is, do you guys could help me to understand how it is possible to install
Ubuntu on PM in a fully automated way including specific VM guest tuning.

Could you give me some hint please?

Thx bb
 
Last edited:
Start reading on https://pve.proxmox.com/pve-docs/
If you have detailed questions, just ask again after you searched the forum.

(If you ask such general questions, no one can give full answers)
 
  • Like
Reactions: morlies
Start reading on https://pve.proxmox.com/pve-docs/
If you have detailed questions, just ask again after you searched the forum.

(If you ask such general questions, no one can give full answers)
Hi Tom

I built my own repo based on hashi corp's tool packer: packer-proxmox
This approach builds a hypervisor guest image which can be used as a template to clone additional VM's.

But this requires anytime manual steps in order to clone a VM based on cloud-init.

I'm searching for a solution like vagrant or terraform to built my env in a IAC manner.

Or, (as I've seen) clone the vm template fully via API but I'm not familar so far with the possibilities of PM
(I know, I will RTFM regarding API of course).

But maybe there are some hints that could help me find a more convenient solution.

Thank you!
 
Last edited:
  • Like
Reactions: fahadysf
Cloning can be done via the command line but there is no real IAC tool within Proxmox.
There are some ansible roles around which automate the creation of VMs but I never tested one of those.
PM is still more the »pet« approach than the »cattle« one. ;)
 
Hi Tom

I built my own repo based on hashi corp's tool packer: packer-proxmox
This approach builds a hypervisor guest image which can be used as a template to clone additional VM's.

But this requires anytime manual steps in order to clone a VM based on cloud-init.

I'm searching for a solution like vagrant or terraform to built my env in a IAC manner.

Or, (as I've seen) clone the vm template fully via API but I'm not familar so far with the possibilities of PM
(I know, I will RTFM regarding API of course).

But maybe there are some hints that could help me find a more convenient solution.

Thank you!
Were you able to make progress on this. I have had reasonable success with cloud-init VM deployment automation with terraform. Ping me and we can chat about it.
 
It's relatively straight forwards to create Proxmox templates using Hashicorp Packer with the Proxmox builders (ISO or clone from an existing template), along with various provisioners - depending on what you want to 'bake' into your image. Cloud-init is fully supported including subiquity if you want build Ubuntu templates.

https://www.packer.io/plugins/builders/proxmox/iso
https://www.packer.io/plugins/builders/proxmox/clone

This approach will get you to a fully automated and repeatable build process without any need for manual intervention whatsoever.

I typically 'bake' a base OS image (using the Proxmox ISO builder), install all package security updates but not much else. Then use that template as the basis for other specialised templates. Here you face a choice between 'bake' or 'fry' and I won't rehash the whole debate around that. But basically you need to decide what software installation and configuration you want to perform at BUILD time (bake), and for that you would use Packer, and what is more usefully performed at LAUNCH time (fry). For launch time, you can use Terraform, Ansible, scripting, whatever ...

For me the choice comes down to the need to be able to launch new instances (VMs) rapidly and reliably, so I don't want to do too much at launch time that will compromise either of those. That said, I also don't want to maintain a large number of machine image variants since building each of them takes time. Some things can ONLY be done at launch time of course.

On the whole you shouldn't need more than a small handful of images (Proxmox templates). If you have more than 10, you probably ought to revisit your decision.

Anyway. there are as many views on this topic as there are variants on how to do it, so my advice is to pick an approach that works for you and then just be consistent.

Bottom line is you will be doing BOTH, so get familiar with launch time provisioning tooling as well, especially Terraform and Ansible:

https://registry.terraform.io/providers/Telmate/proxmox/latest
https://docs.ansible.com/ansible/latest/user_guide/index.html

HtHs

Fraser.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!