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:

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!