-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install SLES 16.0 Minimal VM as guest on SLES 16.0 system
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
- Loading branch information
1 parent
109a404
commit 590d221
Showing
11 changed files
with
362 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
...rt_autotest/guest_params_xml_files/sles_16_64_kvm_hvm_x86_64_qcow_ignition+combustion.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?xml version="1.0"?> | ||
<guest> | ||
<guest_os_name>sles</guest_os_name> | ||
<guest_version>16.0</guest_version> | ||
<guest_version_major>16</guest_version_major> | ||
<guest_version_minor>0</guest_version_minor> | ||
<guest_os_word_length>64</guest_os_word_length> | ||
<guest_build/> | ||
<host_hypervisor_uri/> | ||
<host_virt_type>kvm</host_virt_type> | ||
<guest_virt_type>hvm</guest_virt_type> | ||
<guest_machine_type>q35</guest_machine_type> | ||
<guest_arch>x86_64</guest_arch> | ||
<guest_name/> | ||
<guest_domain_name/> | ||
<guest_memory>2048,maxmemory=4096</guest_memory> | ||
<guest_vcpus>2,maxvcpus=4</guest_vcpus> | ||
<guest_cpumodel>host-model</guest_cpumodel> | ||
<guest_metadata/> | ||
<guest_boot_settings>loader=/usr/share/qemu/ovmf-x86_64-suse-4m-code.bin,loader.readonly=yes,loader.type=pflash,nvram.template=/usr/share/qemu/ovmf-x86_64-suse-4m-vars.bin,hd,bootmenu.enable=yes,menu=on</guest_boot_settings> | ||
<guest_xpath/> | ||
<guest_installation_automation_method>ignition+combustion</guest_installation_automation_method> | ||
<guest_installation_automation_platform>metal</guest_installation_automation_platform> | ||
<guest_installation_automation_file>ignition_config_non_encrypted_image.ign#combustion_script_all_round</guest_installation_automation_file> | ||
<guest_installation_method>import</guest_installation_method> | ||
<guest_installation_extra_args/> | ||
<guest_installation_wait/> | ||
<guest_installation_method_others/> | ||
<guest_installation_media>http://openqa.suse.de/assets/hdd/SLES16-Minimal-VM.x86_64-kvm-and-xen-Build12345.qcow2</guest_installation_media> | ||
<guest_installation_fine_grained/> | ||
<guest_os_variant>sle15sp7</guest_os_variant> | ||
<guest_storage_path/> | ||
<guest_storage_type>disk</guest_storage_type> | ||
<guest_storage_format>qcow2</guest_storage_format> | ||
<guest_storage_label>gpt</guest_storage_label> | ||
<guest_storage_size>40</guest_storage_size> | ||
<guest_storage_backing_path/> | ||
<guest_storage_backing_format/> | ||
<guest_storage_others>driver.name=qemu,target.dev=vda,target.bus=virtio,bus=virtio,cache=none</guest_storage_others> | ||
<guest_network_type>bridge</guest_network_type> | ||
<guest_network_mode>bridge</guest_network_mode> | ||
<guest_network_device/> | ||
<guest_network_others/> | ||
<guest_netaddr/> | ||
<guest_ipaddr/> | ||
<guest_ipaddr_static>false</guest_ipaddr_static> | ||
<guest_macaddr/> | ||
<guest_graphics>vnc</guest_graphics> | ||
<guest_controller/> | ||
<guest_input/> | ||
<guest_serial>pty</guest_serial> | ||
<guest_parallel/> | ||
<guest_channel/> | ||
<guest_console/> | ||
<guest_hostdev/> | ||
<guest_filesystem/> | ||
<guest_sound/> | ||
<guest_watchdog/> | ||
<guest_video/> | ||
<guest_smartcard/> | ||
<guest_redirdev/> | ||
<guest_memballoon/> | ||
<guest_tpm/> | ||
<guest_rng/> | ||
<guest_panic/> | ||
<guest_memdev/> | ||
<guest_vsock/> | ||
<guest_iommu/> | ||
<guest_iothreads/> | ||
<guest_seclabel/> | ||
<guest_keywrap/> | ||
<guest_cputune/> | ||
<guest_memtune/> | ||
<guest_blkiotune/> | ||
<guest_memorybacking/> | ||
<guest_features/> | ||
<guest_clock/> | ||
<guest_power_management>suspend_to_mem.enabled=yes,suspend_to_disk.enabled=yes</guest_power_management> | ||
<guest_events/> | ||
<guest_resource/> | ||
<guest_sysinfo/> | ||
<guest_qemu_command/> | ||
<guest_launchSecurity/> | ||
<guest_autostart/> | ||
<guest_transient/> | ||
<guest_destroy_on_exit/> | ||
<guest_autoconsole>text</guest_autoconsole> | ||
<guest_noautoconsole>false</guest_noautoconsole> | ||
<guest_noreboot/> | ||
<guest_default_target>graphical</guest_default_target> | ||
<guest_do_registration>false</guest_do_registration> | ||
<guest_registration_server/> | ||
<guest_registration_username/> | ||
<guest_registration_password/> | ||
<guest_registration_extensions/> | ||
</guest> |
79 changes: 79 additions & 0 deletions
79
data/virt_autotest/guest_unattended_installation_files/combustion_script_all_round
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/bin/bash | ||
# combustion: network | ||
# | ||
# To be provisioned: | ||
# 01) set localization and timezone | ||
# 02) set root password | ||
# 03) add new user qevirt | ||
# 04) add ssh public keys for root and qevirt | ||
# 05) set hostname | ||
# 06) add customized sshd config | ||
# 07) enable and restart sshd | ||
# 08) test networking | ||
# 09) do registration | ||
# 10) refresh repositories | ||
# 11) leave a marker | ||
|
||
### set pipefail and enable debug | ||
set -euo pipefail | ||
set -x | ||
set -v | ||
|
||
# redirect output to the console | ||
exec > >(exec tee -a /dev/console) 2>&1 | ||
|
||
### set locale, keyboard and timezone | ||
rm -f /etc/localtime | ||
systemd-firstboot --force --timezone=UTC --locale=en_US.UTF-8 --keymap=us | ||
echo "FONT=eurlatgr.psfu" >> /etc/vconsole.conf | ||
|
||
### set password for root | ||
echo 'root:$6$LZQfIH8bS4JYwAQq$VIdGS2fnED6CSySnb5jJm8O6FUXWgjG3keN2I0c6Td4nLrwxUxratkJq0cKMuo1OMTwUYpQ7EyP2GnZ2pL.ut.' | chpasswd -e | ||
|
||
### add new user qevirt | ||
useradd --create-home --uid 1001 --comment "QE Virtualization Functional Test" --no-user-group --gid users qevirt | ||
echo 'qevirt:$6$0Tcx/pXefxOSvZEi$ukUmR.j7/sTbv10LwbesHD8CurSkr/2pkstXeWuErA7TBxeB2nLQwOKFKQJnlqJuVzNWg1E6ovKl6ajAZRtKt.' | chpasswd -e | ||
|
||
### add ssh public keys | ||
mkdir -p /root/.ssh | ||
echo "##Authorized-Keys##" >> /root/.ssh/authorized_keys | ||
chmod 600 /root/.ssh/authorized_keys | ||
mkdir -p /home/qevirt/.ssh | ||
echo "##Authorized-Keys##" >> /home/qevirt/.ssh/authorized_keys | ||
chmod 600 /home/qevirt/.ssh/authorized_keys | ||
|
||
### set hostname | ||
echo "##FQDN##" > /etc/hostname | ||
|
||
### add customized sshd config | ||
cat << EOF > /etc/ssh/sshd_config.d/01-qe-virtualization-functional.conf | ||
PermitRootLogin yes | ||
PubkeyAuthentication yes | ||
PasswordAuthentication yes | ||
PermitEmptyPasswords no | ||
EOF | ||
|
||
### enable and restart sshd service | ||
systemctl enable sshd.service | ||
systemctl stop sshd.service | ||
systemctl start sshd.service | ||
|
||
### test networking | ||
curl conncheck.opensuse.org | ||
|
||
### do registration | ||
if command -v SUSEConnect 2>&1 >/dev/null; then | ||
SUSEConnect -r ##Registration-Code## --url ##Registration-Server## | ||
fi | ||
|
||
### refresh and list respositories | ||
if zypper repos 2>&1 >/dev/null; then | ||
zypper --non-interactive --gpg-auto-import-keys refresh | ||
zypper repos --details | ||
fi | ||
|
||
### leave a marker | ||
echo "Configured with combustion" > /etc/issue.d/combustion | ||
|
||
### close outputs and wait for tee to finish | ||
exec 1>&- 2>&-; wait; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.