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

Prevent custom storage volumes to be used more than once #12254

Closed
edlerd opened this issue Sep 14, 2023 · 3 comments · Fixed by #13183
Closed

Prevent custom storage volumes to be used more than once #12254

edlerd opened this issue Sep 14, 2023 · 3 comments · Fixed by #13183
Assignees
Labels
Bug Confirmed to be a bug
Milestone

Comments

@edlerd
Copy link
Contributor

edlerd commented Sep 14, 2023

Issue description

In most cases, a custom storage volume with content-type block is assigned to only one instance. When assigning it to more than one instances, the result will be data loss.

The proposal is to ensure the storage volume is unused when it has content-type block and assigned to a new instance directly or via profile. If the volume is already attached to another instance (or would be attached to more than one) an error should be returned instead.

A config setting on the storage volume can be set to override this check, allowing for the rare use case that block storage should be accessible from multiple instances.

When the content-type filesystem is used on the storage volume, it can be freely assigned to many instances.

@tomponline tomponline added the Bug Confirmed to be a bug label Sep 15, 2023
@monstermunchkin monstermunchkin removed their assignment Dec 13, 2023
@edlerd edlerd changed the title Prevent custom storage volumes of type block to be used more than once Prevent custom storage volumes to be used more than once Jan 11, 2024
@mas-who
Copy link

mas-who commented Jan 11, 2024

Issue description

In most cases, a custom storage volume with content-type block is assigned to only one instance. When assigning it to more than one instances, the result will be data loss.

The proposal is to ensure the storage volume is unused when it has content-type block and assigned to a new instance directly or via profile. If the volume is already attached to another instance (or would be attached to more than one) an error should be returned instead.

A config setting on the storage volume can be set to override this check, allowing for the rare use case that block storage should be accessible from multiple instances.

When the content-type filesystem is used on the storage volume, it can be freely assigned to many instances.

For custom storage volumes with content-type filesystem created within a storage pool using the ceph driver, the same problem should be considered. The root of the issue is that if you activate the same ceph RBD on two systems concurrently then you can get corruption, unless the file system running on top of ceph RBD is cluster aware.

@tomponline tomponline added this to the lxd-2404 milestone Jan 17, 2024
@tomponline tomponline modified the milestones: lxd-5.21, lxd-6.1 Feb 21, 2024
@tomponline
Copy link
Member

We may be able to cherry-pick from lxc/incus#467

@tomponline
Copy link
Member

Also note lxc/incus#529

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
5 participants