cobbler icon indicating copy to clipboard operation
cobbler copied to clipboard

modules/managers/import: Fix windows import

Open SchoolGuy opened this issue 2 years ago • 8 comments

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 avatar May 01 '23 19:05 SchoolGuy

@SchoolGuy Unfortunately, I don't have time to look everything right now, so I'll do it over the weekend.

tpw56j avatar May 02 '23 16:05 tpw56j

@tpw56j A day during the next two weeks is enough. Many thanks for taking the time!

SchoolGuy avatar May 02 '23 16:05 SchoolGuy

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'

tpw56j avatar May 07 '23 07:05 tpw56j

@SchoolGuy After the above fixes, I was able to successfully import the Windows distro.

tpw56j avatar May 07 '23 07:05 tpw56j

@tpw56j I think I caught all your requested changes. I would be very thankful if you could confirm that I did so correctly.

SchoolGuy avatar May 08 '23 07:05 SchoolGuy

@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 avatar May 08 '23 08:05 tpw56j

@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 avatar May 08 '23 08:05 SchoolGuy

@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.

tpw56j avatar May 09 '23 06:05 tpw56j

Where are we with this? Do we really need this for a v3.2.3 release or could we let it slip? Thanks.

opoplawski avatar Mar 08 '24 02:03 opoplawski

@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.

SchoolGuy avatar Mar 08 '24 15:03 SchoolGuy

@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 avatar Apr 09 '24 08:04 SchoolGuy

@SchoolGuy Yes, I will try to complete this PR.

tpw56j avatar Apr 09 '24 09:04 tpw56j

Thank you for lifting this burden of my shoulder.

SchoolGuy avatar Apr 09 '24 09:04 SchoolGuy

@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 avatar Apr 14 '24 12:04 tpw56j

@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 avatar Apr 15 '24 08:04 SchoolGuy

@SchoolGuy Maybe it will be easier if I prepare my own PR?

tpw56j avatar Apr 15 '24 09:04 tpw56j

@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.

SchoolGuy avatar Apr 15 '24 09:04 SchoolGuy