[lxc-users] Adding a second disk to a container
Joshua Schaeffer
jschaeffer0922 at gmail.com
Wed Jul 12 19:44:13 UTC 2017
I'm wondering what the best/recommended approach is to adding a second disk to a container. I'm using LXD 2.15 on Ubuntu 16.04. As an example I have a container where I've limited the disk size to 20GB:
lxduser at blllxd01:~$ lxc config show bllcloudctl01 | grep -A 4 root
root:
path: /
pool: int_lxd
size: 20GB
type: disk
This works great, but say I want the container to have another disk device that is mounted elsewhere like /mnt/disk1. I've tried adding that in my config but I alway get an error about needing the source. Since I'm using ZFS I don't have an actual block device to pass to the source. I then played around with storage volumes, which appears to work, but I always get an error when editing the volume:
lxduser at blllxd01:~$ lxc storage volume create int_lxd vol1
Storage volume cinder created
lxduser at blllxd01:~$ lxc storage volume set int_lxd vol1 size=240GB
error: ETag doesn't match: 834842d9406bd41f2f23c097e496434c3c263a022ef3fb1aaf214b13e4395771 vs b37ae1157f2a46dc1b24b2b561aefccc168ba822d5057330e94ca10ba47ccfb6
If I create the storage volume with the size parameter is works, but doesn't set the right size:
lxduser at blllxd01:~$ lxc storage volume delete int_lxd vol1
Storage volume cinder deleted
lxduser at blllxd01:~$ lxc storage volume create int_lxd vol1 size=240GB
Storage volume cinder created
lxduser at blllxd01:~$ lxc storage volume show int_lxd vol1
config:
*size: 10GB*
description: ""
name: vol1
type: custom
used_by: []
I really just learned about storage volumes so I'm not even sure if I'm using them correctly or in the correct context here. Also, I get that ETag error whenever I edit the volume, even if I didn't make changes:
lxduser at blllxd01:~$ lxc storage volume delete int_lxd vol1
Storage volume cinder deleted
lxduser at blllxd01:~$ lxc storage volume create int_lxd vol1
Storage volume vol1 created
lxduser at blllxd01:~$ lxc storage volume edit int_lxd vol1
/[I immediately exit the editor without making any changes]/
Config parsing error: ETag doesn't match: 446844b3e6b6bc70d7a101b5b281e4cc8fb568cfcd66424f32b2027c8215032a vs 9e27a7a4de3badc96a0046c111094164619f7cfc6351534c7b7236769c85ace1
Press enter to open the editor again
I just want the container to look like it has two disks, one mounted on / and the other mounted under /mnt.
Thanks,
Joshua Schaeffer
More information about the lxc-users
mailing list