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

Set FS type from LINSTOR properties during mounts #320

Merged
merged 1 commit into from
Feb 19, 2025
Merged

Conversation

WanzenBug
Copy link
Member

If a user restores a volume from a snapshot, the file system type of the restored volume may not match the requested FS type of the storage class. This may happen if for example the snapshot was taken from an xfs volume, but the new StorageClass is configured to provision ext4 volumes. We then would try to call "mount -t ext4" on a xfs-formatted block device, leading to a failure mode where the volume is created fine, but you cannot make use of it.

To fix this, instead of taking the FS type directly from Kubernetes, we use the existing LINSTOR FsType property to determine what fs type is actually on the volume. Only if this information is not provided (possible with very old snapshots or some other funky setups), we fall back to the information provided by Kubernetes.

One alternative would be to disallow such mixing of filesystem types completely, ensuring when a volume is restored from a snapshot that old and new volume have matching FS type in Kubernetes. This would permanently lock in some users to their initial choice of FS, so we instead chose the option that allows for gradual migration to a new StorageClass/FS.

If a user restores a volume from a snapshot, the file system type of the
restored volume may not match the requested FS type of the storage class. This
may happen if for example the snapshot was taken from an xfs volume, but the
new StorageClass is configured to provision ext4 volumes. We then would try
to call "mount -t ext4" on a xfs-formatted block device, leading to a failure
mode where the volume is created fine, but you cannot make use of it.

To fix this, instead of taking the FS type directly from Kubernetes, we use
the existing LINSTOR FsType property to determine what fs type is actually
on the volume. Only if this information is not provided (possible with very
old snapshots or some other funky setups), we fall back to the information
provided by Kubernetes.

One alternative would be to disallow such mixing of filesystem types
completely, ensuring when a volume is restored from a snapshot that old and new
volume have matching FS type in Kubernetes. This would permanently lock in some
users to their initial choice of FS, so we instead chose the option that allows
for gradual migration to a new StorageClass/FS.

Signed-off-by: Moritz Wanzenböck <[email protected]>
Copy link
Member

@rck rck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like a sound decision, code also LGTM

@rck rck merged commit 56e8a72 into master Feb 19, 2025
5 checks passed
@rck rck deleted the force-fs-type branch February 19, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants