Automate vm template download from azure / gcp storage

farhan.j

New Member
May 9, 2022
3
1
3
Hi
I am new to both ProxMox and Linux.

We will have over 100 proxmox nodes.
Created a new vm template that can be uploaded to azure or gcp storage.

Is there a way to automate template download to all proxmox nodes i.e some script or "pveam" process that run a scheduled task every day and compares the templates from storage and then downloads latest version of vm template to local storage.

I know I can clone the vms using "qm" process but stuck at automating template download.

Many Thanks
 
Hi,

Proxmox has a function to download ISO Images from an URL. This function can be triggered using the API.

As an alternative, you could just download your templates by using curl, wget or any other download application. You can automate that task by using a simple cron job or by using an ansible playbook for example.

Best regards,
Marco
 
Thank you @mgabriel for the reply.
Is there a way to compare the vm template before downloading (i-e if we publish new template then proxmox host checks if template does not exists locally and only then download). We have some remote sites with really slow connection so trying to save bandwidth.

I know we can download the template and then compare versions or check for duplication after downloading but looking for a way to only download template if it does not exist aleady on proxmox host.

Thank you.
 
Hi Farhan,

if the remote servers are under your control, I'd suggest using rsync to compare and transfer the images. Rsync only transmits the templates if they were changed. Even better, it only transmits the parts that were changed as it does a delta transfer.

Best regards,
Marco
 
  • Like
Reactions: datschlatscher
We are planning to use azure or gcp storage but we can spin up servers to host the templates.
Interesting suggestion. I will give it a go.
Thanks @mgabriel
 
  • Like
Reactions: mgabriel

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!