[libvirt-users] how to change existing domain xml?

Matthias Bolte matthias.bolte at googlemail.com
Tue Jan 24 17:44:40 UTC 2012

2012/1/24  <p-man314 at mail.ru>:
> Hi.
> I'm trying to change network settings for a domain via libvirt (the driver
> is xenapi) with no success.
> According to its sources, 'virsh edit' uses virDomainGetXMLDesc(), allows to
> edit the received xml and then use virDomainDefineXML(). In case of xenapi
> driver it leads to a new vm creation (with the same name and edited
> settings).

virDomainDefineXML is the right API function. The problem is that the
XenAPI driver currently has a bug here. It should check (via UUID and
name) if the domain XML refers to an existing domain and update this
domain or the if the given domain XML doesn't refer to an existing
domain and define a new one instead.

The XenAPI driver does not check this and always defines a new domain.

So unfortunately you cannot edit the config of an existing domain
until this bug is fixed,

You might be able to workaround this bug by undefining the domain
first and then redefining it.

Matthias Bolte

More information about the libvirt-users mailing list