observations:
question:
How can I locate the missing factor that allows lxc-webpanel to function as expected? When I issue lxc commands in a bash shell or when I call the same defs that lxc-webpanel does from an python interpreter the lxc commands fail.
goal:
Be able to use the bash CLI or a python session to manage lxc containers
system info:
uname -r
: 3.13.0-35-powerpc64-smpA container named 'test-container' was created using the lxc-webpanel.
observation 1: lxc-webpanel trial screenshots
observation 2: lxc commands from bash CLI
In: lxc-info -qn test-container
Out:
test-container doesn't exist
In: lxc-attach --name test-container
Out:
attach.c: lxc_attach: 635 failed to get the init pid
observation 3: lxclite def call from ipython3
import lxclite as lxc
container = 'test-container'
lxc.info(container)
ContainerDoesntExists Traceback (most recent call last) in () ----> 1 lxc.info(container)
../../python3_dev/_lxc/lxclite/init.py in info(container) 122 if not exists(container): 123 raise ContainerDoesntExists( --> 124 'Container {} does not exist!'.format(container)) 125 126 output = _run('lxc-info -qn {}|grep -i "State\|PID"'.format(container),
ContainerDoesntExists: Container test-container does not exist!
NB: lxc-checkconfig
output:
Kernel configuration not found at /proc/config.gz; searching...
Kernel configuration found at /boot/config-3.13.0-48-powerpc64-smp
--- Namespaces ---
Namespaces: [enabled]
Utsname namespace: [enabled]
Ipc namespace: [enabled]
Pid namespace: [enabled]
User namespace: [enabled]
Network namespace: [enabled]
Multiple /dev/pts instances: [enabled]
--- Control groups ---
Cgroup: [enabled]
Cgroup clone_children flag: [enabled]
Cgroup device: [enabled]
Cgroup sched: [enabled]
Cgroup cpu account: [enabled]
Cgroup memory controller: [enabled]
Cgroup cpuset: [enabled]
--- Misc ---
Veth pair device: [enabled]
Macvlan: [enabled]
Vlan: [enabled]
File capabilities: [enabled]
Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig
This comment ❝The user id in the lxc instance should equal the user id in the host.❞ led me to my solution.
When I ran an IPython session as root, all functioned as expected. Duh!
ps -aux | grep python
root 1327 0.0 0.4 18956 13188 ? S 09:55 0:00 /usr/bin/python /srv/lwp/lwp.py
sudo lxc-info --name test-container
Name: test-container
State: STOPPED