Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update storage pool cache if LXD is clustered #14046

Open
roosterfish opened this issue Sep 4, 2024 · 3 comments
Open

Update storage pool cache if LXD is clustered #14046

roosterfish opened this issue Sep 4, 2024 · 3 comments
Assignees
Labels
Bug Confirmed to be a bug
Milestone

Comments

@roosterfish
Copy link
Contributor

roosterfish commented Sep 4, 2024

When MicroCloud bootstraps a new LXD cluster and you invoke any lxc * command on any of the cluster members for the first time you get the following message:

If this is your first time running LXD on this machine, you should also run: lxd init

This might be misleading as MicroCloud has already setup storage, networking and the cluster between the nodes.

When querying the /1.0 endpoint the storage_version value doesn't show any storage pool even though MicroCloud has already active storage pools.

It's because when you create a storage pool on a single node LXD, the storagePoolCreateGlobal func is calling dbStoragePoolCreateAndUpdateCache down the line which runs storagePoolDriversCacheUpdate and updates the global var storagePoolUsedDriversCacheVal.

But the same isn't happening when creating a storage pool within a LXD cluster using storagePoolsPostCluster. This causes the cache not being updated.

@roosterfish roosterfish added the Feature New feature, not a bug label Sep 4, 2024
@roosterfish roosterfish changed the title Disable LXD If this is your first time welcome message Update storage pool cache if LXD is clustered Sep 5, 2024
@roosterfish
Copy link
Contributor Author

Maybe the cache update can be moved a few levels up in the API handler storagePoolsPost.

@roosterfish roosterfish added Bug Confirmed to be a bug and removed Feature New feature, not a bug labels Sep 5, 2024
@roosterfish roosterfish transferred this issue from canonical/microcloud Sep 5, 2024
@tomponline tomponline added this to the lxd-6.2 milestone Sep 5, 2024
@tomponline
Copy link
Member

Maybe the cache update can be moved a few levels up in the API handler storagePoolsPost.

Maybe, but this is only going to update the local member's cache.

We may need to do this, and incorporate a cluster notification to update the cache.

@hamistao want to look at this one as its non-trivial?

@hamistao
Copy link
Contributor

hamistao commented Sep 5, 2024

Sure, I will assign to myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed to be a bug
Projects
None yet
Development

No branches or pull requests

4 participants