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
change kpartx separator to '-part' #17
Conversation
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.
LGTM.
create
Outdated
# in some cases, mkfs will cause the partition tables to remap, for example | ||
# /dev/mapper/foo-1 will turn into /dev/mapper/foo-part1. Rebuild the map | ||
# to ensure the filesystem can be detected onward: | ||
if [ ! -b "$filesystem_dev" ]; then |
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.
Minor bash style nit, it's better to use [[ ]]
tests in bash.
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.
elsewhere the code doesn't use [[ ]]
, so it would look odd. besides: why?
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.
There are some surprising gotchas with single brackets.
https://www.delftstack.com/howto/linux/difference-between-single-and-double-square-brackets-in-bash/
On 2022-05-11 13:55:45, Ben Kochie wrote:
There are some surprising gotchas with single brackets.
https://www.delftstack.com/howto/linux/difference-between-single-and-double-square-brackets-in-bash/
Can you outline a specific problem you can see in that page? i don't see
much apart from && and || not being supported in plain "test" which is
fine by me (you just use the normal shell operators instead).
in general, i think we should strive to avoid bashism, and, in this
specific case, we would add one where there wasn't any before. all other
uses of `test` in that file use single brackets, why focus on this one?
|
I'm just saying, if it's a new bit of code, following bash best practices is a good idea. I also think it's fine as-is. |
Thanks to everyone stressing the point, that there are issues regarding partition mapping. However the reason for seems not clear: @anarcat states in #13 that he is using Does @SuperQ also use something around possible multipath, or is it just |
It's possible that it could work with Creating a new instance should work regardless of |
create
Outdated
@@ -61,6 +61,17 @@ else | |||
fi | |||
|
|||
mke2fs -Fjqt $OSP_FILESYSTEM $filesystem_dev | |||
|
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.
testing showed that this won't work because it's after the mk2fs
call. it should at least be done before.
i think you might have a very good point here. in fact, testing our procedures with this patch showed that it didn't fundamentally solve our problem. furthermore, looking again at #13, i see that I created multiple LUNs per VM, which is not something we do anymore. our new procedure now creates a single LUN, partitions it correctly, then passes those devices individually to the VM, with separate It's not ideal, but it works, and I suspect it would work even without this patch. (but that remains to be tested.) |
Thanks at @jcharaoui and @anarcat. I see now your point, that you somehow rely on multipath and partitions on this LUNs. Is this a nested stack of partition inside an other partition, or just two different mappings of the same partition (one side from multipath, the other from instance-debootstrap)? If the later is the case, I could image to align instance-debootstraps partition prefix with multipath, like in commit 90388ca (ATM overwritten by fore push), if that would solve your problem? |
@saschalucas They are different mappings of the same partitions, yes. The commit that I pushed and removed from this PR, the one that adjusts the partition delimiter, is what we ended up using to successfully. I verified that it also works when create DRBD instances as well. If that looks like a proper fix to you, you may close this PR and I'll submit a new one with that fix. Also FTR I did try to adjust |
Yes, I'm fine with changing the partition prefix in I'm not sure about the right etiquette, but instead of closing this PR and creating a new one, we can change the title of this and force-push a different solution (namely commit 90388ca)? As PR creator @jcharaoui should be able to change title/close etc. If not I'll help out. Please decide for yourself which way you want to go. |
This should fix ganeti#13 by using a kpartx partition path separator of '-part', which aligns with the default seen when multipath devices are probed for partitions.
-part
-part
Alright @saschalucas, I've changed this PR according to what we discussed. |
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 @jcharaoui. LGTM.
Just for reference: This aligns with https://github.com/opensvc/multipath-tools/blob/686797b7d0da4fc24fdfcb0fc6364df78a0b232d/kpartx/kpartx.rules#L42 |
This is a fix for #13 and supersedes the #14 PR.