观察结果:
问题:
我如何找到使lxc webpanel按预期运行的缺失因素?当我在bashshell中发出lxc命令时,或者当我从python解释器调用lxc webpanel相同的def时,lxc命令失败。在
目标:
能够使用bashcli或python会话来管理lxc容器
系统信息:
uname -r
:3.13.0-35-powerpc64-smp使用lxc webpanel创建了一个名为“test container”的容器。在
观察1:lxc webpanel试用截图
观察2:bash CLI中的lxc命令
在:lxc-info -qn test-container
输出:
test-container doesn't exist
{cd3}
输出:
attach.c: lxc_attach: 635 failed to get the init pid
观察结果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!
注意:lxc-checkconfig
输出:
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
这条评论❝The user id in the lxc instance should equal the user id in the host.❞让我找到了我的解决方案。在
当我以root用户身份运行IPython会话时,一切都按预期运行。哼!在
ps -aux | grep python
sudo lxc-info name test-container
相关问题 更多 >
编程相关推荐