Hello
I'm playing with some scripting stuff, but got into some issues.
I'm trying to find out if a virtual machine with id $vmid already exists or not IN THE CLUSTER. The web interface stops me from creating virtual machines with duplicate ids, so the check is surely built in.
Ideas:
I could check for $vmid.conf in /etc/pve/nodes/*/qemu-server (also ctx dir), but seems to be too 'bloaty'
qm status $vmid does not work if the vm is located on another machine from cluster
also I would like that the check will be universal (against VMs & also containers)
btw: the qm create will return errors if that id is already used by some vm/ctx ?
ps: I'm not interested in getting the next valid id in cluster, but checking that the desired vmid is not currently used by another vm or container in cluster
thank you
I'm playing with some scripting stuff, but got into some issues.
I'm trying to find out if a virtual machine with id $vmid already exists or not IN THE CLUSTER. The web interface stops me from creating virtual machines with duplicate ids, so the check is surely built in.
Ideas:
I could check for $vmid.conf in /etc/pve/nodes/*/qemu-server (also ctx dir), but seems to be too 'bloaty'
qm status $vmid does not work if the vm is located on another machine from cluster
also I would like that the check will be universal (against VMs & also containers)
btw: the qm create will return errors if that id is already used by some vm/ctx ?
ps: I'm not interested in getting the next valid id in cluster, but checking that the desired vmid is not currently used by another vm or container in cluster
thank you