Storage volume info

storage pools, I can get total size and usage in one run:
/1.0/storage-pools/{name}/resources

{
  "metadata": {
    "inodes": {
      "total": 30709993797,
      "used": 23937695
    },
    "space": {
      "total": 420100937728,
      "used": 343537419776
    }
  },

storage volumes, to get similar results, need to run:
/1.0/storage-pools/{name}/volumes/{type}/{volume}

{
  "metadata": {
    "config": {
      "size": "50GiB",
      "zfs.remove_snapshots": "true"
    },

and
/1.0/storage-pools/{name}/volumes/{type}/{volume}/state

{
  "metadata": {
    "usage": {
      "used": 1693552640
    }
  },

Would be nice getting total and used in one query for storage volumes as well.
perhaps:
/1.0/storage-pools/{name}/volumes/{type}/{volume} recursion=1
or
/1.0/storage-pools/{name}/volumes/{type}/{volume}/state
would show total or size as well.

I recall a similar thread, where fetching size or used were considered expensive for some filesystems, yet zfs could deliver above with no efforts.

Thanks for the idea, please can you log it at:

Where it can be considered and discussed.

Thanks

Thanks,
Will do.
There is another suggestion, related, but not sure, can go in same Issue.
Storage pool size/used is in bytes.
Storage volume size shown Gibibyte, used bytes.
When i query a storage volume info/state, need to apply different tools to unify the comparison.

Yeah open a separate issue for that, thanks.

1 Like