How to turn qm config into qm create

1.1k Views Asked by At

I'm using Proxmox 6.2. It has a UI to create a VM. If I SSH into the main Proxmox node I can do qm config <vm-id> to see all the config for a node I've just created with that UI-wizard. If I copy that out to a text editor I can fairly easily turn that into a qm create arg list (add dashes for keys, remove colons from key names) and then re-use that to create similar VMs within the same terminal.

Is there a way to do that without the text editor? Some sed/swk fu, or maybe even a built-in feature of qm that escapes me?

1

There are 1 best solutions below

0
On

One option would be to create a template of your VM and then linked clones of it.

Additionally, you can also copy the configuration file of the VM. For example, for the default storage "local", you will find the VM configuration files in (out of my head, maybe a little off) /var/lib/vz/images/qemu-server/.conf But in this case you have to pay a little attention because copying this does not automatically create disks, for example.

What might also be interesting to experiment with is "qm showcmd". This shows the exact qemu command that gets executed when you start your VM, which includes all settings for the VM.