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

change kpartx separator to '-part' #17

Merged
merged 1 commit into from Jun 19, 2022
Merged

Conversation

jcharaoui
Copy link
Contributor

This is a fix for #13 and supersedes the #14 PR.

Copy link
Contributor

@anarcat anarcat left a 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
Copy link

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.

Copy link
Contributor

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?

Copy link

Choose a reason for hiding this comment

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

@anarcat
Copy link
Contributor

anarcat commented May 12, 2022 via email

@SuperQ
Copy link

SuperQ commented May 12, 2022

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.

@saschalucas
Copy link
Member

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 blockdev disk template in combination with iSCSI. It is common to use iSCSI with multipath. From multipath.conf(5) skip_kpartx defaults to no. So there's a chance that two different kpartx fight against each other?

Does @SuperQ also use something around possible multipath, or is it just plain/drbd etc. disk template?

@jcharaoui
Copy link
Contributor Author

@anarcat states in #13 that he is using blockdev disk template in combination with iSCSI. It is common to use iSCSI with multipath. From multipath.conf(5) skip_kpartx defaults to no. So there's a chance that two different kpartx fight against each other?

It's possible that it could work with skip_kpartx=no, I haven't tested this. However this is somewhat besides the point, because some of our machines need those partitions to be exposed by multipath, otherwise our setup will break and these machines will fail to find their blockdev on the next reboot of the nodes.

Creating a new instance should work regardless of skip_kpartx, and it can be done rather easily.

create Outdated
@@ -61,6 +61,17 @@ else
fi

mke2fs -Fjqt $OSP_FILESYSTEM $filesystem_dev

Copy link
Contributor

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.

@anarcat
Copy link
Contributor

anarcat commented May 26, 2022

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 blockdev disk template in combination with iSCSI. It is common to use iSCSI with multipath. From multipath.conf(5) skip_kpartx defaults to no. So there's a chance that two different kpartx fight against each other?

Does @SuperQ also use something around possible multipath, or is it just plain/drbd etc. disk template?

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 adopt blocks.

It's not ideal, but it works, and I suspect it would work even without this patch. (but that remains to be tested.)

@saschalucas
Copy link
Member

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?

@jcharaoui
Copy link
Contributor Author

@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 partition_delimiter in multipath.conf but did not find that it improved or even changed anything.

@saschalucas
Copy link
Member

If that looks like a proper fix to you, you may close this PR and I'll submit a new one with that fix.

Yes, I'm fine with changing the partition prefix in instance-debootstrap to be aligned with multipath.

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.
@jcharaoui jcharaoui changed the title remap the partitions after creating the filesystem change kpartx separator to -part Jun 16, 2022
@jcharaoui jcharaoui changed the title change kpartx separator to -part change kpartx separator to '-part' Jun 16, 2022
@jcharaoui
Copy link
Contributor Author

Alright @saschalucas, I've changed this PR according to what we discussed.

Copy link
Member

@saschalucas saschalucas left a comment

Choose a reason for hiding this comment

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

Thanks @jcharaoui. LGTM.

@saschalucas saschalucas linked an issue Jun 19, 2022 that may be closed by this pull request
@saschalucas saschalucas merged commit e0df6b1 into ganeti:master Jun 19, 2022
@saschalucas
Copy link
Member

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.

create fails mysteriously after mkfs
4 participants