Changing the configuration of a VM

leila

New Member
Apr 26, 2023
13
0
1
I need to write a script that contains the following:

1. If the vm is on, shut it down.
2. Change its RAM.
3. Change its CPU core.
4. Add the hard drive to it.
5. Transfer to the new destination (new host) and turn it on there.

I would be grateful if someone could guide me.
 
The Proxmox manual described the command-line interface and configuration file format. And there are lots of bash tutorials on the internet. Proxmox VE also provides a REST API to manage VMs, if you prefer.
I found these:

qm shutdown VMID
qm set VMID --memory X
qm set VMID --smp X
 
for add hard drive:

qm set VMID --scsi1 YourVMStorageId:X

X is the amount of hard drive to add.
 
Last edited: