Create qcow2 images from the CLI without owner VM, possible?

Jul 23, 2019
10
0
6
Greetings, my goal is to:
  1. create a qcow2 or raw image from the command line (I would prefer qcow2 anyway) without linking it to a new or existing VM;
  2. create a partition table and a file system in it;
  3. mount it, to access data (copy, sync, from a remote source)
  4. unmount the image when finished
I am stuck at 1).
The documentation I read assumes that there must be an existing VM to attach the new image to; but probably I am missing something.

Can anybody help me please?

Proxmox VE 6.1-8

Thanks in advance forn any help you will offer.
Gabriele
 
you can reserve a special VMID and then allocate for that VMID? (the config for that VMID does not have to exist, except if you want to use the GUI). e.g., with pvesm alloc

if you specifically mean qcow2, you can also just use qemu-img to allocate it in an arbitrary path?
 
Code:
pvesm alloc local 999999 vm-999999-disk-foobar.qcow2 1G

Code:
qemu-img create -o 'preallocation=metadata' -f qcow2 test.qcow2 1G

depending on what variant you need..
 

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!