Fat fingered disk override, container can no longer start

LXD: Snap/4.3

I accidentally missed the B for GB adding a disk:

lxc config device add c1 root disk pool=default path=/ size=30G

Tried to start the container, it failed noting the invalid 30G value:

lxc start c1  
Error: Common start logic: Failed to start device "root": Invalid value: 30G
Try `lxc info --show-log c1` for more info

Remove and correct the size:

lxc config device remove c1 root
lxc config device add c1 root disk pool=default path=/ size=30GB

Try to start the container, the 30G value is still cached somewhere and the container will not start.

lxc start c1  
Error: Common start logic: Failed to start device "root": Invalid value: 30G
Try `lxc info --show-log c1` for more info

lxc config show c1 shows the valid value:

devices:
  eth0:
    ipv4.address: xx
    nictype: routed
    parent: ens3
    type: nic
  root:
    path: /
    pool: default
    size: 30GB
    type: disk

Any ideas?

Please can you show output of lxc config show c1 with and without the --expanded flag.

1 Like

@tomp Aha. While editing the lxc configs for public consumption, I found the culprit:

volatile.root.apply_quota: 30G

lxc config show c1

    architecture: x86_64
    config:
      image.architecture: amd64
      image.description: ubuntu 18.04 LTS amd64 (release) (20200519.1)
      image.label: release
      image.os: ubuntu
      image.release: bionic
      image.serial: "20200519.1"
      image.type: squashfs
      image.version: "18.04"
      volatile.base_image: 70d3dcaabcffb1aa1644d0ce866efcb141742179e94ad72aefb8d3502338a71f
      volatile.eth0.hwaddr: 00:16:3e:d7:de:f0
      volatile.eth0.name: eth0
      volatile.idmap.base: "0"
      volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
      volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
      volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
      volatile.last_state.power: STOPPED
      volatile.root.apply_quota: 30G
    devices:
      eth0:
        ipv4.address: xx
        nictype: routed
        parent: ens3
        type: nic
      root:
        path: /
        pool: default
        size: 30GB
        type: disk

Excellent. Seems like we have a validation issue there to fix.

Indeed LXD should have failed much earlier on this one. For now, the easy fix is to edit that apply_quota to 30GB.

1 Like

Have fixed the validation here:

1 Like

Yes, resolved using:

lxc config edit c1

and changing

      volatile.root.apply_quota: 30G

to

      volatile.root.apply_quota: 30GB

Thanks for your help @tomp and @stgraber.

My VM reads volatile.root.apply_quota: "true", and the manual states it is of type string not boolean.

I changed it to false and the VM booted up.

LXD Version 4.0.8 on Ubuntu Focal, vm is from ubuntu:focal.