-
Notifications
You must be signed in to change notification settings - Fork 933
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
lxd/storage/drivers/zfs: Fix content type detection for custom block volumes #11991
lxd/storage/drivers/zfs: Fix content type detection for custom block volumes #11991
Conversation
// Detect if a volume is block content type using both the defined suffix and the dataset type. | ||
isBlock := strings.HasSuffix(volName, zfsBlockVolSuffix) && zfsContentType == "volume" | ||
// Detect if a volume is block content type using only the dataset type. | ||
isBlock := zfsContentType == "volume" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monstermunchkin did custom block volumes not use the .block suffix ever? or did that change recently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this function support detecting filesystem volumes with zfs.block_mode=true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They never have. That's only for VMs as they have two datasets/volumes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this function support detecting filesystem volumes with zfs.block_mode=true?
No, this function only takes the output of zfs list
. zfs.block_mode
is a LXD config key and is therefore unknown by this function. There's also no need for this config key as it wouldn't change anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What this function does not support is listing custom ISO volumes. That is because they follow the same naming schema as custom block volumes. We might want to change this in the future, by suffixing ISOs with .iso
or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this function only takes the output of
zfs list
.zfs.block_mode
is a LXD config key and is therefore unknown by this function. There's also no need for this config key as it wouldn't change anything.
But those filesystem block volumes would be unusable after recovery though right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What this function does not support is listing custom ISO volumes. That is because they follow the same naming schema as custom block volumes. We might want to change this in the future, by suffixing ISOs with
.iso
or something.
hrm yeah can you open an issue and assign that to you to sort out please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But those filesystem block volumes would be unusable after recovery though right?
Oh, I see what you mean, and you're right. As a workaround, we could do lxc storage volume set zfs vol1 zfs.block_mode=true
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think you can do that on a volume once it created - if you can thats a bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to have a content type suffix for those volumes too
@monstermunchkin would it be possible to update the lxd recover tests to check for block volume support? |
Yes, that should be possible. I just came across User Properties which might be interesting in the way we name our datasets and volumes. We could add the |
Sounds very interesting indeed! Just need to check it works with the versions of ZFS we support. |
Is this awaiting review or should it be in draft? ZFS tests seem to have failed. |
This is ready for review. ZFS tests are failing in migration. Don't know why though. @tomponline Could you restart the tests? |
Please can you rebase and that will trigger it too |
…volumes This fixes an issue where custom block volumes would be listed as datasets instead of volumes. Fixes canonical#11984 Signed-off-by: Thomas Hipp <[email protected]>
Signed-off-by: Thomas Hipp <[email protected]>
ee58796
to
c4f1d67
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This fixes an issue where custom block volumes would be listed as
datasets instead of volumes.
Fixes #11984
Signed-off-by: Thomas Hipp [email protected]