执行LXC launch命令报错:Failed instance creation问题求助
LXC启动实例报错"No root device could be found"的解决办法
我执行以下LXC命令尝试创建实例:
ros@ros-Virtualbox:/$ sudo lxc launch -p row ubuntu:20.04 turtlebot Creating turtlebot Error: Failed instance creation: Failed creating instance record: Failed initialising instance: Failed getting root disk: No root device could be found
已确认LXC已安装,尝试过使用ubuntu而非ubuntu:20.04,但问题依旧,需要解决办法。
排查解决步骤:
检查自定义配置文件
row的存储设置
你指定了-p row自定义配置文件,大概率是该配置的存储项出错。执行命令查看配置详情:sudo lxc profile show row重点看
devices区块,正常的根磁盘配置应包含存储池指定,示例如下:devices: root: path: / pool: default type: disk如果缺少
pool项,或者pool名称对应的存储池不存在,就会触发根设备找不到的错误。确认存储池存在且可用
执行命令查看当前LXC存储池列表:sudo lxc storage list若没有可用存储池,创建一个默认的目录型存储池:
sudo lxc storage create default dir若已有存储池,确保配置文件
row里的pool名称和实际存在的存储池名称一致。用默认配置测试实例创建
暂时跳过自定义配置,用默认配置启动测试实例:sudo lxc launch ubuntu:20.04 turtlebot-test如果这个命令能成功,说明问题确实出在
row配置文件上,回到第一步修正即可。检查虚拟机内的存储驱动兼容性
因为是在VirtualBox虚拟机中运行LXC,要确保存储驱动兼容。查看当前LXC使用的存储后端:sudo lxc info | grep "Storage backend"推荐使用
dir或zfs(系统支持的话),避免使用在虚拟机环境中兼容性差的驱动。
内容的提问来源于stack exchange,提问作者Alex
相关产品推荐
相关产品推荐

