Unable to create a VM in a specific network namespace using the Domain XML descriptions and API for libvirt + QEMU over KVM

Roberto Jacob Da Silva robertoj at microsoft.com
Tue Feb 28 22:54:54 UTC 2023


I have a system where I spawn a single libvirt daemon process in the default network namespace.

Once the daemon is running, I create and start VMs using the virDomainDefineXML API (defines a VM or "domain" but does not boot it) followed by the virDomainCreate API (boot the VM).

Now, I am trying to create these VMs in generic network namespaces provided by the user e.g., /var/run/netns/<my-network-namespace>.

While searching the libvirt documentation (i.e., https://libvirt.org/formatdomain.html), I couldn't find any configuration options, which would support this network namespace specification via the domain XML APIs.

Is there any way to accomplish this with the domain XML APIs?

If not, what's the recommended approach to allow a libvirt client to request the libvirt server to create and boot VMs in distinct network namespaces?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20230228/be5ea928/attachment.htm>


More information about the libvirt-users mailing list