Containers not created properly in storage-pools

lxc

#1

Hello,
I’m having some problems getting things running in the correct locations.

I’m running Ubuntu 16.04.3 LTS with lxc/lxd 2.18.

lxc --version

2.18

I created a storage volume (data2dir) on a device that has more space available than the default storage device:

lxc storage list

±---------±------------±-------±-----------------------------------±--------+
| NAME | DESCRIPTION | DRIVER | SOURCE | USED BY |
±---------±------------±-------±-----------------------------------±--------+
| data2dir | | dir | /data2/virtual/lxd2 | 4 |
±---------±------------±-------±-----------------------------------±--------+
| default | | dir | /var/lib/lxd/storage-pools/default | 1 |
±---------±------------±-------±-----------------------------------±--------+

Then I created a container on data2dir:

lxc launch images:ubuntu/xenial nextcloud -s data2dir

And here are the containers that are supposed to be on data2dir:

lxc storage show data2dir

config:
source: /data2/virtual/lxd2
volatile.initial_source: /data2/virtual/lxd2
description: ""
name: data2dir
driver: dir
used_by:

  • /1.0/containers/church
  • /1.0/containers/cops
  • /1.0/containers/nextcloud
  • /1.0/containers/web

cd /data2/virtual/lxd2/containers/

ls

church nextcloud web

However, I later found out the /var/lib/ lists BOTH storage pools:

ls /var/lib/lxd/storage-pools/

data2dir default

And when I look at the /var/lib/ version of the data2dir pool, I find my data directory (nextclouddata)!

ls /var/lib/lxd/storage-pools/data2dir/containers/nextcloud/rootfs/

bin boot dev etc home lib lib64 media mnt nextclouddata opt proc root run sbin srv sys tmp usr var

But it is NOT where it is supposed to be!!!

ls /data2/virtual/lxd2/containers/nextcloud/rootfs

bin boot dev etc home lib lib64 media mnt opt proc root run sbin snap srv sys tmp usr var

This is a running system!
Why didn’t the container get created where it was supposed to be?
How do I get the data where it belongs and keep it there?

If you need anything else from me, please let me know what that is.

Thanks,

Harlan…


(David Negreira) #2

What does mount /data2/virtual/lxd2 show ?


(Stéphane Graber) #3

I’d strongly recommend running LXD 2.21, I do remember some issues around dir mount got fixed a while back and the fact that you’re on 2.18 may be the source of the problem.