Get lxd to forget storage pool without deleting data

Originally I setup lxd on a storage pool called “default”. Then I decided I’d like to use the storage pool for some other things besides lxd. So I created a dataset to use as an lxd storage pool called “default/lxd” using lxc storage create lxd zfs source=default/lxd

I’ve spent the time to move all my containers over to the new location and am now wanting to cleanup after myself. I tried doing lxc storage delete default but found out I can’t since default/lxd is a subset of default. Which I suppose makes sense.

Is there any way of getting lxd to forget storage pools without deleting the data contained inside them?

Can you show lxc storage show default to confirm there’s nothing depending on it at all? If so, then a bit of database surgery will help do what you want.

root@host:~# lxc storage show default
config:
  source: default
  volatile.initial_source: default
  zfs.pool_name: default
description: ""
name: default
driver: zfs
used_by: []
status: Created
locations:
- none

It’s definitely empty

lxd sql global "DELETE FROM storage_pools WHERE name='default'" should do the trick then

beauty, that worked perfectly!