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

Install SLES 16.0 Minimal VM as guest on SLES 16.0 system #21142

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

waynechen55
Copy link
Contributor

@waynechen55 waynechen55 commented Feb 7, 2025

  • New module tests/virt_autotest/prepare_non_transactional_server.pm to perform all necessary or potential operations on non-transactional system before doing actual work like virtual machine installation. These operations may involve extra packages installation, product and extension registration, grub modification and many others.

  • New subroutine is_reboot_needed in lib/utils.pm to determine whether system reboot is needed after changes being made. It uses setting NEEDS_REBOOTING or returned code of zypper needs-rebooting to judge whether reboot is really needed.

  • New subroutine install_extra_packages in lib/utils.pm to wrap up already existing similar functionality in multiple modules, for example, tests/virt_autotest/prepare_non_transactional_server.pm and tests/virt_autotest/prepare_transactional_server.pm.

  • New guest profile data/virt_autotest/guest_params_xml_files/sles_16_64_kvm_hvm_x86_64_qcow_ignition+combustion.xml to represent SLES 16.0 Minimal VM for x86_64.

  • New combustion script data/virt_autotest/guest_unattended_installation_files/combustion_script_all_round to perform all necessary tasks, including adding user, setting passwords, adding ssh public keys, starting services, doing registration and etc, in order to have a fully up and running system. This is useful especially when ignition does not work very well.

  • Use ##Authorized-Keys## and ##FQDN## in data/virt_autotest/guest_unattended_installation_files/combustion_script_all_round.

  • Introduce new test suite level setting UNIFIED_GUEST_BUILDS for unified guest installation because SLES 16.0 Minimal VM may have different build than agama installer.

  • Update virtualization server patterns for SLES 16.0.

  • Exclude 127.0.0.0/8 subnet from being scanned in data/virt_autotest/virt_logs_collector.sh and data/virt_autotest/fetch_logs_from_guest.sh.

  • Verification Runs:

@waynechen55 waynechen55 marked this pull request as draft February 7, 2025 10:27
Copy link

github-actions bot commented Feb 7, 2025

Great PR! Please pay attention to the following items before merging:

Files matching lib/**.pm:

  • Consider adding or extending unit tests in t/

This is an automatically generated QA checklist based on modified files.

@waynechen55 waynechen55 force-pushed the wayne/install_sles16_iso_as_guest branch 12 times, most recently from 50a2ca3 to 1cc7756 Compare February 8, 2025 07:08
@waynechen55 waynechen55 marked this pull request as ready for review February 8, 2025 11:27
@waynechen55 waynechen55 force-pushed the wayne/install_sles16_iso_as_guest branch from 1cc7756 to 2f44550 Compare February 10, 2025 01:25
@waynechen55
Copy link
Contributor Author

@alice-suse @guoxuguang @Julie-CAO @RoyCai7 @nanzhg @tbaev Please have a look.

@waynechen55 waynechen55 force-pushed the wayne/install_sles16_iso_as_guest branch 3 times, most recently from c654181 to 14e7700 Compare February 10, 2025 05:01
# 08) test networking
# 09) do registration
# 10) refresh repositories
# 11) leave a marker
Copy link
Contributor

@alice-suse alice-suse Feb 11, 2025

Choose a reason for hiding this comment

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

Just to confirm combustion works well for sle16 vm?
This script does quite some work. If it returns non-zero on one of the lines, will it be easily observed in openqa job? And how?
Would you please explain a little bit why the name is chosen and its target vms to use it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works well for all VMs. Script debugging already turned on.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, noticed. I mean if some product bug or infra problem happens, eg suseconnect fails, how do we debug based on current solution? Based on my experience in sle micro combustion, we need to rely on journal log for details, but I do not remember if it will always cause second boot failure if one line returns non-zero in the middle.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Open guest console, login to emergency and cat /run/initramfs/rdsosreport.txt can also help I think.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that's for critical failures at running combustion script, eg script timeout. So it is easy to observe in openqa job for such case, because it will be red.
Maybe let me try to rephrase. My point was that, for those uncritical failures when running combustion script, but is critical for automation, eg the line of registering the system, when such line fails, is it easy to observe in openqa job? Do we need to do special handling for such situations, eg additional check in journal after second boot up(combustion finishes and go here, and I guess openqa job green until now?)? May need to emulate and see how it turns out.

Copy link
Contributor Author

@waynechen55 waynechen55 Feb 11, 2025

Choose a reason for hiding this comment

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

I just use /run/initramfs/rdsosreport.txt to see any failed commands in combustion script. I did this many times already. When guest fails to boot up, it can be easily seen from openQA job.

Copy link
Contributor

@alice-suse alice-suse Feb 12, 2025

Choose a reason for hiding this comment

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

Good! Has this log been uploaded for failure job? BTW, would you please add a failure job for reference? Just to ensure that the automation test can rely on uploaded logs for debug.
Also, maybe I am repeating myself, but I do not see this answered yet... You gave how to handle when guest fails to boot up. What about the case that guest does not fail to boot, but it fails at some combustion script steps, eg registration line by network problem? Can current code detect such combustion failure by specific checking after vm installation? Maybe it seems corner case for now, but I believe it will have chance to happen when frequent daily builds need to be tested for sle16 later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is very easy to debug. Connect to guest console, enter into maintenance and list interested files. Every step can be seen. You can see the failure here. This is just similar to SL Micro 6.x disk image which also uses ignition and combustion.

$self->prepare_bootloader;
$self->prepare_services;
$self->prepare_reboot;
$self->restore_ground;
Copy link
Contributor

Choose a reason for hiding this comment

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

@Julie-CAO would you please give it a review if these steps have any redundancy with host installation setup from the regard of OS preparation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not think there is any duplicate.

@alice-suse
Copy link
Contributor

What's the difference about these two jobs? I do not quite get it...

Copy link
Contributor

@alice-suse alice-suse left a comment

Choose a reason for hiding this comment

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

Thanks for the work! It is quite clear in design. I just have some minor comments left in lines.

@waynechen55 waynechen55 force-pushed the wayne/install_sles16_iso_as_guest branch from 14e7700 to 74d9c78 Compare February 11, 2025 08:31
@waynechen55
Copy link
Contributor Author

What's the difference about these two jobs? I do not quite get it...

It is just about how combustion config is passed in, either a qcow disk or just virt-install parameters. Either is OK.

@waynechen55 waynechen55 force-pushed the wayne/install_sles16_iso_as_guest branch 2 times, most recently from 5cb58f1 to 9ad096c Compare February 11, 2025 09:52
@waynechen55 waynechen55 force-pushed the wayne/install_sles16_iso_as_guest branch 2 times, most recently from f83b9a8 to 77413f5 Compare February 12, 2025 08:28
1.New module prepare_non_transactional_server.pm to perform all
necessary operations on non-transactional system before doing
actual work like virtual machine installation.
2.New subroutine is_reboot_needed in lib/utils.pm to determine
whether system reboot is needed after changes being made. It uses
setting NEEDS_REBOOTING or returned code of zypper needs-rebooting
to judge whether reboot is needed.
3.New guest profile sles_16_64_kvm_hvm_x86_64_qcow_ignition+combustion.xml
to represent SLES 16.0 Minimal VM for x86_64.
4.New combustion script combustion_script_all_round to perform all
necessary tasks, including adding user, setting passwords, adding
ssh public keys, starting services, doing registration and etc, in
order to have a fully up and running system.
5.Introduce new test suite level setting UNIFIED_GUEST_BUILDS for
unified guest installation because SLES 16.0 Minimal VM may have
different build than agama installer.
6.Update virtualization server patterns for SLES 16.0.
7.Use ##Authorized-Keys## and ##FQDN## in combustion_script_all_round.
8.New subroutine install_extra_packages in lib/utils.pm to wrap
up already existing similar functionality in multiple modules.
9.Exclude 127.0.0.0/8 subnet from being scanned in logs collecting
scripts, including:
data/virt_autotest/virt_logs_collector.sh
data/virt_autotest/fetch_logs_from_guest.sh
@waynechen55 waynechen55 force-pushed the wayne/install_sles16_iso_as_guest branch from 77413f5 to 590d221 Compare February 12, 2025 08:42
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.

2 participants