-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix ISO location logic in 99_migration #304
Conversation
@doccaz Thanks for looking into this. With regards to #277 we moved the install location of the live ISO from I don't think we should add the complexity of two different search methods in the 99_migration code. Instead I suggest that |
I agree with you that the echo code is weak. However, always using the first entry found might lead to unexpected behavior too. I was thinking under which condition you got the situation that there is more than one image available and differently named ? |
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 for looking into this. Good catch and we need to fix this but I propose a different direction. Thoughts ?
I agree with you on this one. This was actually a problem caused by me during testing, there's no need to address it in this PR. |
I only branched "suse-migration-test-vm" to add an LVM partition layout (see here). The rest of the packages are being pulled from your repository automatically through KIWI. I also added SUSEConnect and a couple missing python dependencies to appliance.kiwi. Here are the included versions in the qcow2 image:
I booted the qcow2 image and manually added the .repo file pointing to your repository. Finally, I installed suse-sle15-activation-2.1.1-1.1. I can see that the generated grub.cfg after the grub2-mkconfig is called has a blank 99_migration section. My image has a VG called "vg_system" with 4 LVM volumes:
If I run the script manually with sh -x, I see this:
The migration_iso variable starts with the correct value (/migration-image/SLES15-Migraiton*.iso), then it gets overwritten inside the for loop, because there IS an active volume for /usr but it DOES NOT contain the iso. In the end the wrong value gets assigned (/SLES15-Migration*.iso). That's why I suggested the extra file check.
That's a valid way of using the correct version, I agree. |
@doccaz Oh now I see it. Thanks much for the trace output. Actually as we have now moved the location of the ISO to "/" instead of "/usr/share" the following code in
completely Thoughts ? |
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.
Here you go.
grub.d/99_migration
Outdated
@@ -14,7 +14,7 @@ else | |||
) ${CLASS}" | |||
fi | |||
|
|||
migration_iso=$(echo /*-Migration.*.iso) | |||
migration_iso=$(echo /migration-image/*-Migration.*.iso) |
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.
Here you go.
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.
@doccaz Great thanks 👍 it looks good to me now, can you squash your commits into one ? then we are ready for merge. Thanks much
Add information how to test the DMS
The current DMS workflow is based on a reboot either through kexec or grub(loopsetup). The reboot is required to meet the documented requirement for an offline upgrade process which is the only supported process to upgrade from SLE12 to SLE15. However this limitation is not a technology limitation, it was based on product management decisions back in time. From todays perspective it is possible to run a seamless online upgrade from SLE12 to SLE15 using container technology. This commit implements support for it in the DMS and provides the required technology stack at: https://build.opensuse.org/project/show/home:marcus.schaefer:dms I'm aware that this container based workflow can only serve as an additional/experimental workflow without guarantees to the user as it would violate a PM decision. However, I also believe that we have to provide good solutions when they solve a number of severe issues that exists with the current DMS reboot workflow. Along with this implementation I also prepared a presentation to show and demo the workflow. Maybe this gains some interest in the future and can help to start a PM conversation about the SLE12 upgrade process. In any way I'd like to add this additional workflow to the DMS such that our users have a chance to upgrade when the reboot way fails. If customers would consider it, it must be clear to them that they are on unsupported territory. This information must be placed to the documentation prior merge
The suse-migration-rpm package contains an OBS hook script which turns the migration live ISO image into a package named according to the name of the image name attribute. In our case: SLES15-Migration. The sources of this package was not maintained in any git repository but are tightly coupled to the live image build which resides here. Thus and to complete the source gap we have for the DMS this commit adds the sources for the meta package here
This change helps to run migrations on systems which stores /usr/share in a special way, e.g. as LVM volume or other type that cannot be read via the loopback grub or kexec method. This Fixes SUSE#277
If the DMS live ISO loopback boot runs on a machine that has root (/) on LVM we need to load lvm in grub to be able to read from the root of the toplevel volume
@doccaz I have merged your and my PR and submitted the changes to: I'm running some tests once everything as built. So far there are no release plans for the DMS to the SUSE namespace. I plan a refresh during the next three months or on demand if there is a prio bug coming up. |
I noticed that you have a Kiwi appliance to test DMS on your OBS home directory. I branched it and made an LVM version with 4 volumes to test DMS. I then noticed that 99_migration is not finding the ISO file on an LVM root volume and not writing the corresponding entry to GRUB.
I added a test to check if the ISO is found, and only search on the user paths if not found, This commit solves the issue.
The KIWI appliance is located here: https://build.opensuse.org/package/show/home:emendonca:branches:home:marcus.schaefer:dms/suse-migration-test-vm-lvm
The line where I substituted an "echo" by an "ls -1 | tail -1" is just for a situation I found when testing multiple versions of the packages and it ended up returning an invalid value when there's more than one ISO in the directory.