Skip to content

scripts: fix kvm host undefined version#7179

Merged
yadvr merged 1 commit into
apache:mainfrom
shapeblue:fix-kvm-version
Feb 13, 2023
Merged

scripts: fix kvm host undefined version#7179
yadvr merged 1 commit into
apache:mainfrom
shapeblue:fix-kvm-version

Conversation

@shwstppr

@shwstppr shwstppr commented Feb 8, 2023

Copy link
Copy Markdown
Contributor

Description

On Oracle Linux 9.0, version shows as undefined and even Host.OS shows as "Red". This change fixes the script to use /etc/os-release ins such cases.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

Before change
image

After changer, after re-adding the host
Screenshot from 2023-02-08 17-01-21

How Has This Been Tested?

Before changes,

[root@ref-trl-4390-k-Mol9-abhishek-kumar-kvm1 ~]# /usr/share/cloudstack-common/scripts/vm/hypervisor/versions.sh
Host.OS=Red
Host.OS.Version=
Host.OS.Kernel.Version=5.15.0-1.43.4.1.el9uek.x86_64

After change,

[root@ref-trl-4390-k-Mol9-abhishek-kumar-kvm1 ~]# /usr/share/cloudstack-common/scripts/vm/hypervisor/versions.sh
Host.OS=Oracle Linux Server
Host.OS.Version=9.0
Host.OS.Kernel.Version=5.15.0-1.43.4.1.el9uek.x86_64

On Oracle Linux 9.0, version shows as undefined and even Host.OS shows as "Red".
This change fixes the script to use '/etc/os-release' ins such cases.

Signed-off-by: Abhishek Kumar <abhishek.kumar@shapeblue.com>
@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@borisstoyanov a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@shwstppr

shwstppr commented Feb 8, 2023

Copy link
Copy Markdown
Contributor Author

Checked script changes on different hosts (to check for any regression):

Ubuntu 22.04

root@ref-trl-3836-k-Mu22-wei-zhou-kvm1:~# hostnamectl
 Static hostname: ref-trl-3836-k-Mu22-wei-zhou-kvm1
       Icon name: computer-vm
         Chassis: vm
      Machine ID: c98af5c900e5412b8a0b8620dfe3bc9c
         Boot ID: 835074d79cd84646ad97388865dcd781
  Virtualization: vmware
Operating System: Ubuntu 22.04 LTS                 
          Kernel: Linux 5.15.0-35-generic
    Architecture: x86-64
 Hardware Vendor: VMware, Inc.
  Hardware Model: VMware Virtual Platform
root@ref-trl-3836-k-Mu22-wei-zhou-kvm1:~# ./versions.sh
Host.OS=Ubuntu
Host.OS.Version=22.04
Host.OS.Kernel.Version=5.15.0-35-generic
root@ref-trl-3836-k-Mu22-wei-zhou-kvm1:~#

AlmaLinux 9

[root@ref-trl-4389-k-Ma9-abhishek-kumar-kvm1 ~]# hostnamectl
   Static hostname: n/a                                   
Transient hostname: ref-trl-4389-k-Ma9-abhishek-kumar-kvm1
         Icon name: computer-vm
           Chassis: vm 🖴
        Machine ID: 016efeabc83848738c6b008ba9002e98
           Boot ID: 41f69a2241504e6a908cd32c36413e8e
    Virtualization: vmware
  Operating System: AlmaLinux 9.0 (Emerald Puma)          
       CPE OS Name: cpe:/o:almalinux:almalinux:9::baseos
            Kernel: Linux 5.14.0-70.13.1.el9_0.x86_64
      Architecture: x86-64
   Hardware Vendor: VMware, Inc.
    Hardware Model: VMware Virtual Platform
[root@ref-trl-4389-k-Ma9-abhishek-kumar-kvm1 ~]# ./version.sh 
Host.OS=AlmaLinux
Host.OS.Version=9.0
Host.OS.Kernel.Version=5.14.0-70.13.1.el9_0.x86_64

CentOS7:

[root@ref-trl-4314-v-M7-abhishek-kumar-marvin marvin]# hostnamectl
   Static hostname: n/a
Transient hostname: ref-trl-4314-v-M7-abhishek-kumar-marvin
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 76b17df4966743ce9a20fe9a7098e2b6
           Boot ID: 6d6e3cf6b06449388bb02d5793536b82
    Virtualization: vmware
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-1160.15.2.el7.x86_64
      Architecture: x86-64
[root@ref-trl-4314-v-M7-abhishek-kumar-marvin marvin]# vi versions.sh
[root@ref-trl-4314-v-M7-abhishek-kumar-marvin marvin]# chmod +x versions.sh 
[root@ref-trl-4314-v-M7-abhishek-kumar-marvin marvin]# ./versions.sh 
Host.OS=CentOS
Host.OS.Version=7.9.2009
Host.OS.Kernel.Version=3.10.0-1160.15.2.el7.x86_64

Rocky 8

[root@pr7114-t5937-kvm-rocky8-kvm1 ~]# hostnamectl
   Static hostname: n/a
Transient hostname: pr7114-t5937-kvm-rocky8-kvm1
         Icon name: computer-vm
           Chassis: vm
        Machine ID: ec2f5af8e2a348e686bd75385747ee42
           Boot ID: 36814bbda5e846f2a2833cc5b18650b8
    Virtualization: vmware
  Operating System: Rocky Linux 8.4 (Green Obsidian)
       CPE OS Name: cpe:/o:rocky:rocky:8.4:GA
            Kernel: Linux 6.1.7-1.el8.elrepo.x86_64
      Architecture: x86-64
[root@pr7114-t5937-kvm-rocky8-kvm1 ~]# ./versions.sh 
Host.OS=Rocky
Host.OS.Version=8.4
Host.OS.Kernel.Version=6.1.7-1.el8.elrepo.x86_64

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland DaanHoogland added this to the 4.18.0.0 milestone Feb 8, 2023
@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 5530

@sonarqubecloud

sonarqubecloud Bot commented Feb 8, 2023

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@weizhouapache weizhouapache left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@codecov

codecov Bot commented Feb 8, 2023

Copy link
Copy Markdown

Codecov Report

Merging #7179 (99561e2) into main (b93608e) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main    #7179   +/-   ##
=========================================
  Coverage     12.63%   12.63%           
  Complexity     8609     8609           
=========================================
  Files          2711     2711           
  Lines        255748   255748           
  Branches      39871    39871           
=========================================
  Hits          32303    32303           
  Misses       219347   219347           
  Partials       4098     4098           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan help aljeblieft

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland I understand these words: "help", "hello", "thanks", "package", "test"
Test command usage: test [mgmt os] [hypervisor] [keepEnv] [qemuEv]
Mgmt OS options: ['centos7', 'centos6', 'suse15', 'alma8', 'ubuntu18', 'ubuntu22', 'ubuntu20', 'rocky8', 'alma9']
Hypervisor options: ['kvm-centos6', 'kvm-centos7', 'kvm-rocky8', 'kvm-alma8', 'kvm-alma9', 'kvm-ubuntu18', 'kvm-ubuntu20', 'kvm-ubuntu22', 'kvm-suse15', 'vmware-55u3', 'vmware-60u2', 'vmware-65u2', 'vmware-67u3', 'vmware-70u1', 'vmware-70u2', 'vmware-70u3', 'xenserver-65sp1', 'xenserver-71', 'xenserver-74', 'xcpng74', 'xcpng76', 'xcpng80', 'xcpng81', 'xcpng82']
Note: when keepEnv is passed, you need to specify mgmt server os and hypervisor or use the matrix command.
when qemuEv is passed, it will deploy KVM hyperviosr hosts with qemu-kvm-ev, else it will default to stock qemu.
Package command usage: package [all(default value),kvm,xen,vmware,hyperv,ovm] - a comma separated list can be passed with package command to bundle the required hypervisor's systemVM templates. Not passing any argument will bundle all - kvm,xen and vmware templates.

Blessed contributors for kicking Trillian test jobs: ['rohityadavcloud', 'nvazquez', 'borisstoyanov', 'DaanHoogland', 'shwstppr', 'andrijapanicsb', 'rahulbcn27', 'davidjumani', 'harikrishna-patnala', 'vladimirpetrov', 'weizhouapache', 'NuxRo', 'mlsorensen']

@shwstppr

Copy link
Copy Markdown
Contributor Author

@blueorangutan test alma9 kvm-alma9

@blueorangutan

Copy link
Copy Markdown

@shwstppr a Trillian-Jenkins test job (alma9 mgmt + kvm-alma9) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-6157)
Environment: kvm-alma9 (x2), Advanced Networking with Mgmt server a9
Total time taken: 47326 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7179-t6157-kvm-alma9.zip
Smoke tests completed. 106 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_ping_in_vr_success Failure 14.49 test_diagnostics.py
test_03_ping_in_ssvm_success Failure 14.43 test_diagnostics.py

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test alma9 kvm-alma9

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a Trillian-Jenkins test job (alma9 mgmt + kvm-alma9) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-6164)
Environment: kvm-alma9 (x2), Advanced Networking with Mgmt server a9
Total time taken: 44232 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7179-t6164-kvm-alma9.zip
Smoke tests completed. 107 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@DaanHoogland

Copy link
Copy Markdown
Contributor

@shwstppr is this ready for merge?

@shwstppr

Copy link
Copy Markdown
Contributor Author

@DaanHoogland this may need a LGTM from @borisstoyanov

@borisstoyanov borisstoyanov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@shwstppr shwstppr marked this pull request as ready for review February 12, 2023 19:59
@yadvr yadvr merged commit e61ab3d into apache:main Feb 13, 2023
@yadvr yadvr deleted the fix-kvm-version branch February 13, 2023 01:22
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.

6 participants