Error getting LXD VM storage volume details

Summary

I’m not able to use the lxc command line utility to get information about a storage volume for an LXD virtual machine.

Repro Steps

  1. Initialize LXD with default configuration (ZFS storage pool). lxd init
  2. Next, create an LXD VM lxc launch --vm images:ubuntu/23.04 u01
  3. Get the list of storage volumes from the default (zfs) storage pool:
  4. Attempt to get details for a specific volume
# lxc storage volume list default --columns etndcuL
+-----------------+------------------------------------------------------------------+-------------+--------------+---------+
|      TYPE       |                               NAME                               | DESCRIPTION | CONTENT-TYPE | USED BY |
+-----------------+------------------------------------------------------------------+-------------+--------------+---------+
| image           | bba7d5687f728e476f38ffe611cf4de3aadfafde651eccffbb186af7d04457ab |             | block        | 1       |
+-----------------+------------------------------------------------------------------+-------------+--------------+---------+
| virtual-machine | u01                                                              |             | block        | 1       |
+-----------------+------------------------------------------------------------------+-------------+--------------+---------+
# lxc storage volume show default u01
Error: Storage pool volume not found
# lxc storage volume show default bba7d5687f728e476f38ffe611cf4de3aadfafde651eccffbb186af7d04457ab
Error: Storage pool volume not found

This is confusing, because the volumes are listed by the lxc storage volume list command, but then I am unable to get details about them using volume show or volume info commands.

How can I get details about the rootfs volume for an LXD VM?

stgraber@dakara:~$ lxc storage volume show --help
Description:
  Show storage volume configurations

Usage:
  lxc storage volume show [<remote>:]<pool> <volume>[/<snapshot>] [flags]

Examples:
  lxc storage volume show default data
      Will show the properties of a custom volume called "data" in the "default" pool.

  lxc storage volume show default container/data
      Will show the properties of the filesystem for a container called "data" in the "default" pool.

So try:

  • lxc storage volume show default virtual-machine/u01
  • lxc storage volume show default image/ bba7d5687f728e476f38ffe611cf4de3aadfafde651eccffbb186af7d04457ab

Hmmm, the help doesn’t indicate that the volume type is required as part of the <volume> parameter. It does work for the virtual-machine type, but still fails for the image type:

# lxc storage volume info default image/bba7d5687f728e476f38ffe611cf4de3aadfafde651eccffbb186af7d04457ab
Error: Only instance or custom volumes are supported

The image type does work with show, but not the info command.

# lxc storage volume show default image/bba7d5687f728e476f38ffe611cf4de3aadfafde651eccffbb186af7d04457ab
config:
  block.filesystem: ext4
  block.mount_options: discard
  volatile.rootfs.size: "4294967296"
description: ""
name: bba7d5687f728e476f38ffe611cf4de3aadfafde651eccffbb186af7d04457ab
type: image
used_by:
- /1.0/images/bba7d5687f728e476f38ffe611cf4de3aadfafde651eccffbb186af7d04457ab
location: none
content_type: block
project: default
created_at: 2023-06-19T17:48:38.119816553Z

Please can you open an issue about that https://github.com/lxc/lxd/issues

Thanks

Of course, the issue has been logged here: https://github.com/lxc/lxd/issues/11857

1 Like