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

Fix incorrect volume group naming when vg_name is not specified #1653

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

presztak
Copy link
Collaborator

In the context of clustering, when vg_name is not specified, the name of the storage pool that the user wants to create is used as the volume group name. This approach is incorrect if the source is a volume group name, as it leads to a mismatch between the source (volume group name) and the storage pool name, causing issues.

To address this, we need to detect such cases. In other scenarios, such as when a physical device is specified as the source, the storage pool name provided by the user should be used as the volume group name.

To solve this issue, a helper method was implemented to determine the source type based on the value of config["source"]. This method works as follows:

If the source is empty, a loop file, or a physical device, the storage pool name is used as the volume group name.
If the source is a volume group name, then that name is used as the volume group name.
This helper method ensures consistent naming logic and is now used in both the init() and Create() methods.

Fixes: #1650

@presztak presztak marked this pull request as ready for review February 13, 2025 15:31
@presztak presztak requested a review from stgraber as a code owner February 13, 2025 15:31
@stgraber stgraber merged commit bd92072 into lxc:main Feb 13, 2025
36 checks passed
@presztak presztak deleted the fix_lvmcluster_storage_creation branch February 15, 2025 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Adding a new LVM cluster pool currently requires lvm.vg_name
2 participants