[pve-devel] [Feature request] add disk for lxc from the API and WebUI

Emmanuel Kasper e.kasper at proxmox.com
Thu Nov 12 16:06:13 CET 2015


On 11/12/2015 04:01 PM, lyt_yudi wrote:
> hi,all
> 
> current, add disk for the lxc from cli. like this
> 
> # cat /etc/pve/lxc/100.conf
> arch: amd64
> cpulimit: 2
> cpuunits: 1024
> hostname: test
> memory: 2048
> net0: bridge=vmbr0,hwaddr=F2:07:24:D6:DE:28,ip=172.16.1.100/12,name=eth0,type=veth
> onboot: 1
> ostype: centos
> rootfs: local:100/vm-100-disk-1.raw,size=16G
> swap: 2048
> lxc.mount.entry: /dev/sdb dev/sdb none bind,mode=1777,create=file 0 0
> lxc.mount.entry: /dev/sdc dev/sdc none bind,mode=1777,create=file 0 0
> lxc.mount.entry: /dev/sdd dev/sdd none bind,mode=1777,create=file 0 0
> lxc.mount.entry: /dev/sde dev/sde none bind,mode=1777,create=file 0 0
> lxc.cgroup.devices.allow: b 8:16 rwm
> lxc.cgroup.devices.allow: b 8:32 rwm
> lxc.cgroup.devices.allow: b 8:48 rwm
> lxc.cgroup.devices.allow: b 8:60 rwm 
> 
> if can add like this feature, pretty good!
> 
> Whether the planned? 
> 
> thanks .
> 

Hi lyt_yudi

You can already do this, but it is not implemented in the GUI

mp0: local:102/vm-102-disk-3.raw,mp=/mnt/,size=1G
mp1: /dev/dm-3,mp=/mnt1/,size=1G


mp0 will mount here a disk image to /mnt
mp1 will mount the block device /dev/dm-3 to /mnt1 inside the container

I advise you the first synthax, as it allows you cool stuff like online
reszsing with pct resize

Emmanuel




More information about the pve-devel mailing list