Can you use virsh to reset vm id sequence?

um flag

Question in regards to "Id" for running VMs, using virsh running local Qemu VMs.
command virsh list will bring up a list of the current running VMs defined, eg,
Id Name State
1 ubuntu running
upon stopping and undefining the current VM (ubuntu)
the next newly defined VM (domain) will have the "Id" of 2 instead given the "Id" of 1

Is there a way to reset this Id? or further manage this assignment? Can't seem to find more documentation on this topic when browsing the libvirt documentation.

Nikita Kipriyanov avatar
za flag
For what purpose you need that? What is your real problem which you want to solve this way? This ID is [runtime information](; it has no meaning for stopped VMs.
account404 avatar
um flag
Thanks @NikitaKipriyanov, yup I've came across the second page through one of my searches, now skimming through the first reference you provided + running VMs + rebooting my host machine, now I see that the "Id" is a runtime reference of the running VM number for the current Libvirt session. eg, if you stop and start a VM it increases for the newly started job (VM), if you reboot your machine it restarts from Id #1 for the first VM that the host machine started.
I sit in a Tesla and translated this thread with Ai:


Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.