I've made a tool to import Cloud Images

Master of the Wind

New Member
Aug 27, 2024
6
0
1
Hello guys!

I've made a Python script that makes importing Cloud Images easy.

Instead of manually search and download distros' cloud ready images, and then do the steps in the documentation, this script gives you a list to pick a distro, and then automatically download and imports the image.

I've tried to do the same that Proxmox does with Container images.

The script runs local on the server, basically it sends "qm" commands when need to interact with Proxmox. It does not use the API.

I've uploaded to Github, feel free to use it, it's public: https://github.com/ggMartinez/Proxmox-Cloud-Image-Importer . Also, it has an installer script to add Python PIP, Git, and a few python packages.

Runs well on Proxmox 7 and Proxmox 8.

I've created a public gists that it's a JSON file with the name and link for each of the images, it's also public. Later I'll look for a better way to keep the list, at least something that's not that manual.

Any feedback is appreciated!!!
 
It does not use the API.
That's a pity. Maybe look into that and pack your importer into a Docker container image. I would newer run stuff from the internet on my hypervisor and wouldn't install additional packages, especially development packages either.

I was under the impression, that those cloud images are tailored for Azure, AWS and so on and do not work as well as they could with Proxmox VE due to specialized kernel versions.

Who provides thoses images? How often are they updated?

We use our own infrastructure for LX(C) templates that are updated regularly and are 100% under our own control, for KVM VMs we fully rely on network installation and automation to always have the newest packages and configuration on install. I always thought, that the template system in general is too limited (especially KVM templates, which are not updateable).
 
I truly don't understad your scrutiny.

Your impresion was wrong. The images are generic cloud images from the providers that, as I wrote on the readme, was tested on both Proxmox 7 and 8, and works. You thought that was not tested? The ones tailored to AWS or Azure are other files. And also, if you check, the images are from their official providers. I only made a JSON file with the URLs.

The script uses this Github Gist as a source. These are the sources for the images:

Code:
https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2
https://repo.almalinux.org/almalinux/9/cloud/x86_64/images/AlmaLinux-9-GenericCloud-latest.x86_64.qcow2
https://repo.almalinux.org/almalinux/8/cloud/x86_64/images/AlmaLinux-8-GenericCloud-latest.x86_64.qcow2
https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2
https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img
https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
https://download.opensuse.org/repositories/Cloud:/Images:/Leap_15.6/images/openSUSE-Leap-15.6.x86_64-NoCloud.qcow2
https://download.opensuse.org/repositories/Cloud:/Images:/Leap_15.5/images/openSUSE-Leap-15.5.x86_64-NoCloud.qcow2
https://download.opensuse.org/repositories/Cloud:/Images:/Leap_15.4/images/openSUSE-Leap-15.4.x86_64-NoCloud.qcow2
https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2

As you can see, all came from their vendors' side. Not hosted on some random server in nowhere to be known. Just a plain JSON file. And all of them are generic, usually they have the cloud provider tailored to on the name (For example, for Fedora's EC2 image the filename is "Fedora-Cloud-Base-AmazonEC2.x86_64-40-1.14.raw.xz", and for Ubuntu's Azure image the filename is "jammy-server-cloudimg-amd64-azure.vhd.tar.gz")

Did you even check the repository?

You would not run stuff from the internet on your Hypervisor, but you are open to run a tool on a Docker container that connects and does stuff on your Hypervisor, that also comes from the internet?

Doing net installs takes time. Time that would not be needed to take if I can have a template ready to be cloned, and then provision stuff with Ansible. Maybe it's a habit aquired from the ages that download speed was crap in my country.

I don't work that much with LXC. I don't even work that much with Proxmox (or any plain hypervisor), in my 8hs job we use AWS at big scale, and for other projects I'm in, we use CloudStack. I work mostly with VMs for network services (call me old fashioned, but I don't trust LXC's isolation 100%), and then for my apps I tend to work on an environment focused on Kubernetes Clusters.

It's seems that you are more focused on LXC. That's not bad, just that this script would be of not much use for you. There's no point focusing on LXC for this script, Proxmox already has the option to import LXC templates on the UI.

Finally, I made the script for my Proxmox Server in on my Homelab. And after using it, I polished it a little bit and thought that could be useful to someone. The script is open. To use it, or to don't use it.
 
Last edited:
I wrote on the readme, was tested on both Proxmox 7 and 8
I'm not talking about a one-time test if they work. Regular testing by the vendor if they work. One thing that does not work with most cloud images I tried is the use of the virtualized watchdog. Most Debian-based cloud images use the cloud kernel and the driver for the watchdog is missing. Also a lot of vmware drivers for high precision timing and vmware framebuffer console support is not included in the cloud kernel. These are thing people care about and that is what I was talking about.


Did you even check the repository?
The repository yes and I did not find a repo file. Having the list outside of the repo is confusing and potentially a security risk. Why not provide the list with the repo?


You would not run stuff from the internet on your Hypervisor, but you are open to run a tool on a Docker container that connects and does stuff on your Hypervisor, that also comes from the internet?
The API is much more secure and restrictive than running shell commands.


Doing net installs takes time. Time that would not be needed to take if I can have a template ready to be cloned, and then provision stuff with Ansible. Maybe it's a habit aquired from the ages that download speed was crap in my country.
Updating the images afterwards is better? Normally they don't get updates regularly and need packages thereafter. The network install time is therefore more pedicable than using the cloud image. If the cloud image is new, the install time may be shorter, yet while time goes one and update pile up, things may change. Also having a local mirror will solve the speed problems (for both setups). You can also still go with ansible after installing via network.
 

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!