如何使用lxc配置文件集?

月刊

我想从命令行编辑LXD配置文件。这是通过lxc profile set

lxc profile get <profile> <key> 获取配置文件配置。

lxc profile set <profile> <key> <value> 设置配置文件配置。

预期的格式是<key> <value>什么?来自的输出lxc show profile表明是一个虚线结构:

root@ubuntu ~# lxc profile show zoneminder
name: zoneminder
config:
  raw.lxc: lxc.aa_allow_incomplete=1
description: ""
devices:
  eth0:
    name: eth0
    nictype: bridged
    parent: zoneminder0
    type: nic

但是我get什么都没做(更不用说-了set)。我尝试了各种各样的咒语(例如lxc profile get zoneminder name,,lxc profile get zoneminder lxc.name...,以获得name上面的值),但是它们都不返回任何内容。

斯蒂芬·沃伦

获取值的基本语法为:

$ lxc profile get default somekey

但是,要获得某些东西,您需要先进行设置。看来您只能设置已知的键值,即那些对lxd有意义的键值:

$ lxc profile set default rubbish 1
error: Bad key: rubbish

$ lxc profile set default limits.cpu 1

...然后您可以检索它:

$ lxc profile get default limits.cpu
1

$ lxc profile show default
name: default
config:
  limits.cpu: "1"
description: Default LXD profile
devices:
  eth0:
    name: eth0
    nictype: bridged
    parent: lxdbr0
    type: nic

设备看起来很特殊。常规的获取/设置访问配置文件的“ config”子字段,但是您需要使用特殊的命令来操作设备:

$ lxc profile device get default eth0 nictype
bridged

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Docker / LXC中的AppArmor配置文件

如何使用python读取配置文件

如何使用Gradle复制配置文件

如何使用sed编辑配置文件

OpenVPN如何使用多个配置文件

如何获取可可数据集的Xception配置文件?

如何在Ubuntu 14.04上启动lxc容器而没有“不使用配置文件执行'/ sbin / init'可能会使主机崩溃”错误

如何使用配置文件提供程序插件从Jenkins管道中的配置文件读取属性

如何使用Maven配置文件设置Spring Active配置文件

如何使用其他配置文件覆盖特定于配置文件的属性?

如何找到配置文件?

使用 ListView 配置文件

如何使用非默认的工匠配置文件URL配置工匠配置文件客户端和工匠配置文件管理控制台?

如何使用Gradle基于配置文件构建Quarkus容器?

如何使用Yocto修改rootfs配置文件?

如何在Liberty配置文件中使用MicroProfile FaultTolerance

如何使用Heroku管理多个Spring配置文件

如何使用Spring配置文件表达式?

如何让 MyBatis 使用本地 DTD 配置文件

如何使用.xinitrc加载xmodmap配置文件

如何获取mailutils使用的配置文件的位置

如何使用 configparser 对象获取配置文件路径

如何在配置文件中使用路由助手

如何使用linux命令传递输入和配置文件

如何为RabbitMQ / Erlang使用多个配置文件

Angular 2-如何使用配置文件

如何使用JSON作为javascript配置文件

Snakemake:如何有效使用配置文件

如何使用sed替换配置文件的变量?