qm wait

Wait until the virtual machine is stopped. More information: https://pve.proxmox.com/pve-docs/qm.1.html.

qm wait vm_id

qm wait --timeout 10 vm_id

qm shutdown vm_id && qm wait --timeout 10 vm_id