[libvirt-users] lxc-enter-namespace support in Python API

Florian Haas florian.haas at hastexo.com
Fri Mar 13 08:47:52 UTC 2015

Hello everyone,

referring back to
in which a user discovered that there is no equivalent to "virsh -c
lxc:/// lxc-enter-namespace" in the Python API. Has that ever changed?
In that thread Daniel suggested that the user file a bug, but that
apparently never happened.

Why am I interested in this? Ansible currently supports a somewhat
limited libvirt_lxc connection driver which uses lxc-enter-namespace
to access LXC containers without SSH
That connection driver, written in Python like the rest of Ansible,
currently has to use jump through subprocess hoops with virsh to enter
the namespace, which is slow and doesn't support pipelining. Being
able to use the native Python API would help greatly. In addition, if
it were to use the Python API instead, the connection plugin could
also be extended to use lxc+ssh:// connection types so Ansible users
could potentially manage container hosts _and_ all their containers
from a single playbook, just so long as they have SSH access to the

Does anyone know whether that extension of the API is being / has been


More information about the libvirt-users mailing list