Hi,
Not sure if this has been asking already, did not find anything.
On LXD 3.0 , I created a storage and the name of if became "local"
I would like to change the name only , the reference in LXD
lxc storage list
+-------+-------------+--------+---------+---------+
| NAME | DESCRIPTION | DRIVER | STATE | USED BY |
+-------+-------------+--------+---------+---------+
| local | | zfs | CREATED | 4 |
+-------+-------------+--------+---------+---------+
My zpool have a name like lxd300G01, but I can’t find any reference to it either.
lxc storage show local
config: {}
description: ""
name: local
driver: zfs
used_by:
Containers and images are correctly using the zfs pool lxd300G01 used as “local” name in LXD
Is that possible to rename “local” to “lxd300G01” ?
We don’t appear to have an API endpoint to rename storage pools.
I can’t remember if there was a good reason for it (difficulty in renaming some storage pools) or if it’s just an omission.
Thanks .
I thought the “local” was only a label that I could change.
Because I did not wanted “local” as storage pool name in LXD if my pool name in ZFS is actually "lxd300G01"
And now in fact, my profiles have “local” as a reference for pool storage witch does not help
My question is not about changing the name of the storage name in ZFS, but just in LXD
I will see, worse case I can delete it, it’s fresh new
If lxc storage show local show a zfs.pool_name and source property both pointing at your zpool AND you’re not using a loop-based pool, then you should be able to perform the rename in the database with:
lxd sql global "UPDATE storage_pools SET name='lxd300G01' WHERE name='local';
lxd sql global "UPDATE profiles_devices_config SET value='lxd300G01' WHERE value='local' AND key='pool';
That assumes LXD 3.1 or the LXD snap, the should just be lxd sql instead of lxd sql global if running on the deb version of LXD 3.0.
Odd that you don’t have zfs.pool_name or the source property set on this pool, I’d have expected both of them to be set to lxd300G01, I actually wonder how this can work at all since there’s no clear relationship between local and lxd300G01 here…
What does lxd sql "SELECT * FROM storage_pools_config;" show you?
(or lxd sql global "SELECT * FROM storage_pools_config;" if using the snap)
Not sure why they’re not showing up then… anyway, as they’re clearly properly set, the rename instructions followed by a restart of the LXD daemon should be fine.
We explicitly decided to not support renaming storage pools as this is a pretty costly and insecure task. I mean even for renaming storage volumes we have to do a lot of work and it’s not super safe either.
Yes I totally understand that .
Maybe the title of this thread is not the best
I don’t want LXD to rename any storage or volume from a storage point of view but only from an LXD view.
Because on a fresh install, with LXD 3.0 or LXD 3.1 , when using lxd init , the storage end up naming LOCAL
And that’s not the best for me as I want to be able to know what ZPOOL i’m using when doinglxc storage list
So when i configure LXD , I don’t add volumes, I skip it and I add it later with :
That won’t work though since it requires that all kinds of symlinks and mountpoints on-disk are updated. It also would involve updating all storage volumes that are currently attached to containers etc.