Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to set a domain id for a vm in xen at all? I'd imagine that changing it while it is running would be problematic, but if I can even set it in the config file or when xm create foo is run that would be helpful.

share|improve this question
Why do you want to do this? If you want to use a UID use a fixed UID in your config. – Nils Aug 30 '11 at 20:07
Well, for one, vifs and taps are named bades on the domid, and I'd like to make them deterministic for certain VMs. UIDs aren't going to help with this, and they also aren't displayed with the standard tools such as "xm list", so I'd have to build a map so I know what Dom IDs are associated with which UIDs. – Jed Daniels Sep 2 '11 at 20:14
You could use xm list -l. What Linux in which version are you running, which xen-version are you using? Do you want to fix the DomU-ID, or is it enough to get the current ID for a certain VM? – Nils Sep 12 '11 at 20:11
I want to fix it. E.g. DomU "A" always gets DomID "3". I'm running debian squeeze with Xen 4.0. – Jed Daniels Sep 12 '11 at 23:12
The answer of Michael Trausch is correct. Think of the DomID as a dynamic sequence number. But I am pretty sure there is another way of fixing your real problem. Since you wrote about taps you propably want to do something with the network device associated with the DomU within the Dom0. Cant you wrap that so you can use something like xm list $DOMU|awk '[print $2}'`? – Nils Sep 13 '11 at 19:10
up vote 1 down vote accepted

The domain ID is set dynamically, at the time of the xm create command. IDs are sequentially assigned integers. If a domain is restarted, it will get the next available integer ID for its domain ID. If you have 30 guests running, and you start them all at boot, they will be assign domain ID numbers 1 - 30 (the dom0 takes the first number, 0). Now, let's say that domain #3 needs to restart sometime later; when it restarts, it will get domain ID 31 (assuming that no other guests have been restarted between host node startup and the point where node #3 was restarted).

In short, no, you cannot set this property of the VM.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.