modules/managers/import: Fix windows import
Linked Items
Fixes #3285
Description
This PR fixes an issue that was introduced with adding Windows support. It prevented all "cobbler import"s from running successfully.
@tpw56j could you please have a look and review this PR? I am uncertain if I did it right.
Behaviour changes
Old: "cobbler import" fails
New: "cobbler import" succeedes
Category
This is related to a:
- [x] Bugfix
- [ ] Feature
- [ ] Packaging
- [ ] Docs
- [ ] Code Quality
- [ ] Refactoring
- [ ] Miscellaneous
Tests
- [ ] Unit-Tests were created
- [ ] System-Tests were created
- [x] Code is already covered by Unit-Tests
- [ ] Code is already covered by System-Tests
- [ ] No tests required
@SchoolGuy Unfortunately, I don't have time to look everything right now, so I'll do it over the weekend.
@tpw56j A day during the next two weeks is enough. Many thanks for taking the time!
The win.ks template was not backported, so:
Exception occurred: <class 'cobbler.cexceptions.CX'>
Exception value: 'Invalid automatic installation template file location /var/lib/cobbler/templates/win.ks, file not found'
@SchoolGuy After the above fixes, I was able to successfully import the Windows distro.
@tpw56j I think I caught all your requested changes. I would be very thankful if you could confirm that I did so correctly.
@SchoolGuy The import ended successfully for me, the windows distro and profile were correctly created.
The purpose of the PR was met, but the result was unusable. To fix this we need to backport sync_post_wingen.py, windows code from tftpgen.py, templates/windows/*.template, settings.
@tpw56j Okay got it. I think I need to dive deeper into the Windows feature to backport it completely. For now I need to let this PR rest.
@SchoolGuy To get deeper into Windows feature, you can start with:
- briefly about the classic Microsoft boot process: https://ipxe.org/appnote/chainload_wds
- alternative to WDS that can be used in conjunction with Cobbler: https://ipxe.org/wimboot
It is not necessary to use wimboot for legacy BIOS booting, because sync_post_wingen.py can patch the required Microsoft binaries by itself.
But when it became necessary to implement UEFI booting, I found that wimboot does the necessary modifications to .efi files on the fly at boot time and there is no need to include such code in sync_post_wingen.py.
That is, in today's realities, the simplest option (if you do not know how to patch efi binaries) for deploying Windows using Cobbler relies on wimboot.
Where are we with this? Do we really need this for a v3.2.3 release or could we let it slip? Thanks.
@opoplawski I need to time to sit down and do the backport. This is rather important to get Windows working. I find doing this backport rather hard and as such feel free to take it over if you have the resouces.
@tpw56j Is it possible for you to take over this PR? I don't really seem to find the time to finish it and my lack of context for the Windows feature is really not helping.
@SchoolGuy Yes, I will try to complete this PR.
Thank you for lifting this burden of my shoulder.
@SchoolGuy I prepared commit https://github.com/cobbler/cobbler/commit/768ebeca522f3faf2257aa11ed560d3f07061164 for this PR. Could you please move it here. I haven't found how to do this.
@tpw56j As you are not part of the Cobbler Org you have no way to do so sadly (my offer for you still stands). I cherry-picked your commit and added it to this branch.
@SchoolGuy Maybe it will be easier if I prepare my own PR?
@tpw56j That would be easier yes. Sadly now we have a merge conflict. I believe you are best suited to solve this. I'll close this one then now.