zabbly / incus

Incus package repository
176 stars 14 forks source link

incus storage volume info POOL VOLUME requires "type/" but help documents state "type/" is optional. #46

Closed AJRepo closed 1 month ago

AJRepo commented 1 month ago

Using incus 6.0.0 on a remote server

incus --version
6.0.0
$ incus remote list
+------------------+------------------------------------+---------------+-------------+--------+--------+--------+
|       NAME       |                URL                 |   PROTOCOL    |  AUTH TYPE  | PUBLIC | STATIC | GLOBAL |
+------------------+------------------------------------+---------------+-------------+--------+--------+--------+
| images           | https://images.linuxcontainers.org | simplestreams | none        | YES    | NO     | NO     |
+------------------+------------------------------------+---------------+-------------+--------+--------+--------+
| local            | unix://                            | incus         | file access | NO     | YES    | NO     |
+------------------+------------------------------------+---------------+-------------+--------+--------+--------+
| XXXXXX (current) | https://XXXXXXXXXXXXXXXXXXXXX      | incus         | tls         | NO     | NO     | NO     |
+------------------+------------------------------------+---------------+-------------+--------+--------+--------+

The help for the incus storage command is as follows

incus storage volume info incusp1 
Description:
  Show storage volume state information

Usage:
  incus storage volume info [<remote>:]<pool> [<type>/]<volume> [flags]

which indicates the "type" is not a required field.

Setup:

incus storage volume list incusp1
+-----------------+-----------+-------------+--------------+---------+
|      TYPE       |   NAME    | DESCRIPTION | CONTENT-TYPE | USED BY |
+-----------------+-----------+-------------+--------------+---------+
| container       | cont1     |             | filesystem   | 1       |
+-----------------+-----------+-------------+--------------+---------+
| virtual-machine | VM1       |             | block        | 1       |
+-----------------+-----------+-------------+--------------+---------+
| virtual-machine | VM2       |             | block        | 1       |
+-----------------+-----------+-------------+--------------+---------+

Command with error

incus storage volume info incusp1 VM2
Error: Storage pool volume not found

However adding the "type" does find the storage pool

incus storage volume info incusp1 virtual-machine/VM2
Name: VM2
Type: virtual-machine
Content type: block
Usage: 50.72GiB
Created: 2024/06/14 14:22 CDT

Not sure if help documents should be updated or if this is a bug.

Additionally, would be good in the help documents to describe what the valid "type" fields are (e.g. "virtual-machine" or "container" ) for those new to incus. I think I can easily make the updates and create a PR if this is an issue with the help docs.

stgraber commented 1 month ago

The type is indeed optional as it defaults to custom which is what the incus storage volume command usually interacts with.

So you can do:

You only need to specify the type when you're not dealing with a custom volume.

Note that the Examples part of the help for both info and show is pretty clear about that:

  Provide the type of the storage volume if it is not custom.
  Supported types are custom, container and virtual-machine.