Hi,
the thing about reusing/uniqueness of VMID have been discussed several times here. But I have found strange behavior related to API. Imagine following scenario:
1) create VM having VMID = 100 and call /api2/json/nodes/<NODE>/qemu/100/status/current => data as object are returned
2) remove VM with VMID = 100
3) create VM having VMID = 100 again and call /api2/json/nodes/<NODE>/qemu/100/status/current => data are null
But in Proxmox GUI everything seems working fine. No issues there, it is related to API only.
All on all, it seems I have to maintain a list of already used VMIDs to avoid this behavior which is ok when I am using API only to create new VM (so I can generate and pass clean VMID). Problem raises once someone (eg. Proxmox admin) will create VM inside Proxmox GUI/outside API which recommends him available VMID no matter it was used already in the past. Then the process must be automatized outside Proxmox GUI via API, such VM cloned, new clean VMID assigned and the old VM deleted. But this can happen during admin's VM setup under his hands which is not so cool.
Are there any reasons current status is not working in API on re-used VMID? Or is it a bug?
the thing about reusing/uniqueness of VMID have been discussed several times here. But I have found strange behavior related to API. Imagine following scenario:
1) create VM having VMID = 100 and call /api2/json/nodes/<NODE>/qemu/100/status/current => data as object are returned
2) remove VM with VMID = 100
3) create VM having VMID = 100 again and call /api2/json/nodes/<NODE>/qemu/100/status/current => data are null
But in Proxmox GUI everything seems working fine. No issues there, it is related to API only.
All on all, it seems I have to maintain a list of already used VMIDs to avoid this behavior which is ok when I am using API only to create new VM (so I can generate and pass clean VMID). Problem raises once someone (eg. Proxmox admin) will create VM inside Proxmox GUI/outside API which recommends him available VMID no matter it was used already in the past. Then the process must be automatized outside Proxmox GUI via API, such VM cloned, new clean VMID assigned and the old VM deleted. But this can happen during admin's VM setup under his hands which is not so cool.
Are there any reasons current status is not working in API on re-used VMID? Or is it a bug?