[SOLVED] qmrestore doesn't reserve VMID

shantanu

Well-Known Member
Mar 30, 2012
112
11
58
Hi,

I am using he following version:
# pveversion -v
proxmox-ve: 4.4-78 (running kernel: 4.4.35-2-pve)
pve-manager: 4.4-5 (running version: 4.4-5/c43015a5)
pve-kernel-4.4.35-1-pve: 4.4.35-77
pve-kernel-4.2.6-1-pve: 4.2.6-36
pve-kernel-4.4.35-2-pve: 4.4.35-78
lvm2: 2.02.116-pve3
corosync-pve: 2.4.0-1
libqb0: 1.0-1
pve-cluster: 4.0-48
qemu-server: 4.0-102
pve-firmware: 1.1-10
libpve-common-perl: 4.0-85
libpve-access-control: 4.0-19
libpve-storage-perl: 4.0-71
pve-libspice-server1: 0.12.8-1
vncterm: 1.2-1
pve-docs: 4.4-1
pve-qemu-kvm: 2.7.1-1
pve-container: 1.0-90
pve-firewall: 2.0-33
pve-ha-manager: 1.0-38
ksm-control-daemon: 1.2-1
glusterfs-client: 3.5.2-2+deb8u3
lxc-pve: 2.0.6-5
lxcfs: 2.0.5-pve2
criu: 1.6.0-1
novnc-pve: 0.5-8
smartmontools: 6.5+svn4324-1~pve80
zfsutils: 0.6.5.8-pve13~bpo80


I have a scenario where multiple VMs can get created from a single image (backup) file in parallel.

I use the command "/usr/bin/pvesh get /cluster/nextid" to get the next possible vmid and then start a qmrestore immediately.

The problem seems to be that, qmrestore doesn't "block" or "reserve" the VMID it has started with.
So, all the other parallel jobs (which are also doing a /cluster/nextid) keep getting the same VMID as "next" and all of them fail. (only the first one succeeds).

Is there proper way to handle this?

Regards,
Shantanu Gadgil
 
You need to handle that yourself in your script ...
OK. Understood. :(

I am doing a random wait and pgrepping on qmrestore to wait (for now), so that only one qmrestore runs at a time.
It works, just seemed as if I was missing something obvious.

Thanks,
Shantanu
 
FWIW, if anyone stumbles upon this, the clone from existing VMID does indeed block/reserve the new VMID.
So, a simple wait-and-retry loop will work.

@dietmar can this be considered as a feature request for qmrestore as well?

Thanks and Regards,
Shantanu
 
well, for
FWIW, if anyone stumbles upon this, the clone from existing VMID does indeed block/reserve the new VMID.
So, a simple wait-and-retry loop will work.

@dietmar can this be considered as a feature request for qmrestore as well?

Thanks and Regards,
Shantanu

yes, we already reserve the ID early on for container restore operations, the same should be possible for VMs as well. please file an enhancement request at bugzilla.proxmox.com (for qemu-server)
 

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!