[pve-devel] lxc container config format
lyt_yudi
lyt_yudi at icloud.com
Sat Aug 1 07:28:16 CEST 2015
Great! i like this. simply is good choice!
> 在 2015年8月1日,下午1:05,Dietmar Maurer <dietmar at proxmox.com> 写道:
>
> Hi all,
>
> we currently try to use the original lxc configuration format to
> store our container configuration, because
> I initially thought we need that to use things like 'lxc-snapshot'.
> But it turns out that we make snapshots using our own commands, and we
> do not store snapshot config in 'lxc-snapshot' format at all.
>
> For example a simple config looks like:
>
> # cat /etc/pve/lxc/101/config
> lxc.include = /usr/share/lxc/config/debian.common.conf
> lxc.arch = i386
> lxc.cgroup.cpu.cfs_period_us = 100000
> lxc.cgroup.cpu.cfs_quota_us = 150000
> lxc.cgroup.cpu.shares = 1073
> lxc.cgroup.memory.limit_in_bytes = 536870912
> lxc.cgroup.memory.memsw.limit_in_bytes = 1073741824
> lxc.rootfs = loop:/var/lib/vz/images/101/vm-101-rootfs.raw
> lxc.utsname = ct1
> pve.disksize = 8
> pve.volid = local:101/vm-101-rootfs.raw
> lxc.network.type = veth
> pve.network.bridge = vmbr0
> lxc.network.hwaddr = B6:87:08:C2:93:AB
> pve.network.ip = dhcp
> lxc.network.name = eth0
> lxc.network.veth.pair = veth101.0
>
> As you see, this is clumsy, and can be translated to:
>
> arch: i386
> os: debian
> cpulimit: 1.5
> cpuunits: 1073
> rootfs: local:101/vm-101-rootfs.raw,size=8
> hostname: ct1
> memory: 512
> swap: 512
> net0: name=eth0,hwaddr=B6:87:08:C2:93:AB,bridge=vmbr0,ip=dhcp
>
> We already expose this simpler config on the API, for example you can
> get it with
>
> # pct config 101
>
> So I wonder if we can/should simply store the configuration using that
> simplified format? Any objections?
>
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
More information about the pve-devel
mailing list