deploy storage with constraints on lxd error

Bug #1951754 reported by Erik Lönroth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
High
Unassigned

Bug Description

When I deploy a charm on my lxd requesting a root disk constraint, it fails with not much helpful messages.

Here is my charm code: https://github.com/erik78se/ops-scp/blob/master/scp/README.md

Juju version: 2.9.18-ubuntu-amd64 (snap)
Controller version: 2.9.16 and 2.9.18
lxd cloud: 4.0.8 21835 4.0/stable (snap)

===========
juju deploy ./scp_ubuntu-20.04-amd64.charm --constraints "cores=2 mem=1G root-disk=5G"
Located local charm "scp", revision 25
Deploying "scp" from local charm "scp", revision 25
========

Model Controller Cloud/Region Version SLA Timestamp
rafaelbackpssh iceberg-default iceberg/default 2.9.18 unsupported 00:15:37+01:00

App Version Status Scale Charm Store Channel Rev OS Message
scp waiting 0/1 scp local 25 ubuntu waiting for machine

Unit Workload Agent Machine Public address Ports Message
scp/13 waiting allocating 18 waiting for machine

Machine State DNS Inst id Series AZ Message
18 down pending focal Failed creating instance record: Failed initialising instance: Failed loading storage pool: No such object

If I deploy without the "root-disk" constraint - it works just fine. Its only when I use the "root-disk" constraint. Do I have something mis-configured in my storage-pools?

$ juju list-storage-pools
Name Provider Attributes
loop loop
lxd lxd
lxd-btrfs lxd driver=btrfs lxd-pool=juju-btrfs
lxd-zfs lxd driver=zfs lxd-pool=juju-zfs zfs.pool_name=juju-lxd
rootfs rootfs
tmpfs tmpfs

==== On the lxd-remote =======

$ lxc storage list iceberg:
+------------+--------+-----------------------------------------------+-------------+---------+
| NAME | DRIVER | SOURCE | DESCRIPTION | USED BY |
+------------+--------+-----------------------------------------------+-------------+---------+
| juju | dir | /var/snap/lxd/common/lxd/storage-pools/juju | | 0 |
+------------+--------+-----------------------------------------------+-------------+---------+
| juju-btrfs | btrfs | /var/snap/lxd/common/lxd/disks/juju-btrfs.img | | 0 |
+------------+--------+-----------------------------------------------+-------------+---------+
| juju-zfs | zfs | /var/snap/lxd/common/lxd/disks/juju-zfs.img | | 0 |
+------------+--------+-----------------------------------------------+-------------+---------+
| lxdhosts | zfs | lxdhosts | | 18 |
+------------+--------+-----------------------------------------------+-------------+---------+

==== On the lxd-remote =======
$ zpool list
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
juju-zfs 80M 136K 79.9M - - 5% 0% 1.00x ONLINE -
lxdhosts 556G 229G 327G - - 38% 41% 1.00x ONLINE -

Revision history for this message
Erik Lönroth (erik-lonroth) wrote :

Here is a juju status

Revision history for this message
Harry Pidcock (hpidcock) wrote :

Hi Erik,

It looks like because you don't have a storage pool named "default".

Try:
juju deploy ./scp_ubuntu-20.04-amd64.charm --constraints "cores=2 mem=1G root-disk=5G root-disk-source=lxdhosts"

I think this is still a valid error since juju should have made an attempt to either use the juju-zfs/juju-btrfs pool or correctly query lxd for the default pool set in the profile.

Changed in juju:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.9-next
Revision history for this message
Erik Lönroth (erik-lonroth) wrote :

I've tried to deploy as:

juju deploy ./scp_ubuntu-20.04-amd64.charm --storage data=lxd,2G,1 --constraints "cores=2 mem=1G root-disk=5G root-disk-source=lxdhosts"

This is how it looks inside the container after deploy. It looks like I can't get a 2G disk from this either.

Filesystem Size Used Avail Use% Mounted on
lxdhosts/containers/juju-a9629a-23 5.9G 1.3G 4.6G 22% /
none 492K 4.0K 488K 1% /dev
udev 189G 0 189G 0% /dev/tty
tmpfs 100K 0 100K 0% /dev/lxd
tmpfs 100K 0 100K 0% /dev/.lxd-mounts
tmpfs 189G 0 189G 0% /dev/shm
tmpfs 38G 212K 38G 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 189G 0 189G 0% /sys/fs/cgroup
/dev/mapper/ubuntu--vg-ubuntu--lv 134G 18G 110G 14% /srv/scponly/data
tmpfs 1.0M 0 1.0M 0% /var/snap/lxd/common/ns
tmpfs 103M 0 103M 0% /run/user/1000

Is it impossible to limit disk quota with lxd/zfs/juju?

Revision history for this message
Harry Pidcock (hpidcock) wrote :

No it should be applying the limit in the backend.

Try this on the host:
$ sudo zfs list lxdhosts/containers/juju-a9629a-23

Otherwise maybe there is a minimum of 5.9gb, which seems strange.

Revision history for this message
Harry Pidcock (hpidcock) wrote :

When I tried with 2G root disk I get

$ sudo zfs list -o name,quota juju-zfs/containers/juju-b49df8-3
NAME QUOTA
juju-zfs/containers/juju-b49df8-3 2G

Ian Booth (wallyworld)
Changed in juju:
milestone: 2.9-next → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.