cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Guest OS hypervisor mapping improvements

Open sureshanaparti opened this issue 2 years ago • 28 comments

Description

This PR includes the following Guest OS hypervisor mapping improvements.

  • Support for the Guest OS / hypervisor mapping addition from upgrade path (using GuestOsMapper)
  • Support to copy hypervisor mappings from older version from upgrade path (using GuestOsMapper)
  • Provision to validate the OS mapping name in hypervisor when enabled using the new parameter 'osmappingcheckenabled' in addGuestOsMapping API
  • Provision to get/check the hypervisor guest OS names (that can be used to add proper mapping) for VMware and XenServer using new API: getHypervisorGuestOsNames.
  • Display the Guest OS hypervisor mappings in UI.

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)
  • [x] 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

  • [x] Major
  • [ ] Minor

Bug Severity

  • [ ] BLOCKER
  • [ ] Critical
  • [ ] Major
  • [ ] Minor
  • [ ] Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Manually tested add/update guest os mapping with the os name mapping check enabled, and tested the new getHypervisorGuestOsNames API with VMware and XenServer hypervisor.

(testenv-vmware) 🐱 > add guestosmapping hypervisor='VMware' hypervisorversion='5.5' osnameforhypervisor='centos' ostypeid=d6ea0862-0654-11ed-9169-1e00c10002c7 forced=true osmappingcheckenabled=true
🙈 Error: (HTTP 530, error code 4250) No host exists with hypervisor: VMware and version: 5.5, please specify available hypervisor and version
(testenv-vmware) 🐱 > add guestosmapping hypervisor='VMware' hypervisorversion='6.7.3' osnameforhypervisor='centos' ostypeid=d6ea0862-0654-11ed-9169-1e00c10002c7 forced=true osmappingcheckenabled=true
🙈 Error: (HTTP 530, error code 4250) Invalid hypervisor os mapping: centos for guest os: CentOS 7, hypervisor: VMware and version: 6.7.3
(testenv-vmware) 🐱 > get hypervisorguestosnames hypervisor='VMware' hypervisorversion='6.7.3' keyword='cent'
{
  "hypervisorguestosnames": {
    "guestoses": [
      {
        "osdisplayname": "Microsoft Windows Server 2003 Datacenter (64-bit)",
        "osnameforhypervisor": "winNetDatacenter64Guest"
      },
      {
        "osdisplayname": "Microsoft Windows Server 2003 Datacenter (32-bit)",
        "osnameforhypervisor": "winNetDatacenterGuest"
      },
      {
        "osdisplayname": "CentOS 8 (64-bit)",
        "osnameforhypervisor": "centos8_64Guest"
      },
      {
        "osdisplayname": "CentOS 7 (64-bit)",
        "osnameforhypervisor": "centos7_64Guest"
      },
      {
        "osdisplayname": "CentOS 6 (64-bit)",
        "osnameforhypervisor": "centos6_64Guest"
      },
      {
        "osdisplayname": "CentOS 6 (32-bit)",
        "osnameforhypervisor": "centos6Guest"
      },
      {
        "osdisplayname": "CentOS 4/5 or later (64-bit)",
        "osnameforhypervisor": "centos64Guest"
      },
      {
        "osdisplayname": "CentOS 4/5 or later (32-bit)",
        "osnameforhypervisor": "centosGuest"
      }
    ],
    "guestosescount": 8,
    "hypervisor": "VMware",
    "hypervisorversion": "6.7.3"
  }
}
(testenv-vmware) 🐱 > get hypervisorguestosnames hypervisor='VMware' hypervisorversion='6.7.3' keyword='core'
{
  "hypervisorguestosnames": {
    "guestoses": [
      {
        "osdisplayname": "CoreOS Linux (64-bit)",
        "osnameforhypervisor": "coreos64Guest"
      }
    ],
    "guestosescount": 1,
    "hypervisor": "VMware",
    "hypervisorversion": "6.7.3"
  }
}

(testenv-xen) 🐱 >get hypervisorguestosnames hypervisor='XenServer' hypervisorversion='7.1.0' keyword='core'
{
  "hypervisorguestosnames": {
    "guestoses": [
      {
        "osdisplayname": "CoreOS",
        "osnameforhypervisor": "CoreOS"
      }
    ],
    "guestosescount": 1,
    "hypervisor": "XenServer",
    "hypervisorversion": "7.1.0"
  }
}
(testenv-xen) 🐱 > get hypervisorguestosnames hypervisor='XenServer' hypervisorversion='7.1.0' keyword='cent'
{
  "hypervisorguestosnames": {
    "guestoses": [
      {
        "osdisplayname": "CentOS 4.8 (32-bit)",
        "osnameforhypervisor": "CentOS 4.8 (32-bit)"
      },
      {
        "osdisplayname": "CentOS 5 (32-bit)",
        "osnameforhypervisor": "CentOS 5 (32-bit)"
      },
      {
        "osdisplayname": "CentOS 7",
        "osnameforhypervisor": "CentOS 7"
      },
      {
        "osdisplayname": "CentOS 6 (64-bit)",
        "osnameforhypervisor": "CentOS 6 (64-bit)"
      },
      {
        "osdisplayname": "CentOS 4.6 (32-bit)",
        "osnameforhypervisor": "CentOS 4.6 (32-bit)"
      },
      {
        "osdisplayname": "CentOS 5 (64-bit)",
        "osnameforhypervisor": "CentOS 5 (64-bit)"
      },
      {
        "osdisplayname": "CentOS 4.7 (32-bit)",
        "osnameforhypervisor": "CentOS 4.7 (32-bit)"
      },
      {
        "osdisplayname": "CentOS 6 (32-bit)",
        "osnameforhypervisor": "CentOS 6 (32-bit)"
      },
      {
        "osdisplayname": "CentOS 4.5 (32-bit)",
        "osnameforhypervisor": "CentOS 4.5 (32-bit)"
      }
    ],
    "guestosescount": 9,
    "hypervisor": "XenServer",
    "hypervisorversion": "7.1.0"
  }
}
(testenv-xen) 🐱 > get hypervisorguestosnames hypervisor='XenServer' hypervisorversion='6.1.0'
{
  "accountid": "aa2fc411-0654-11ed-8c69-1e00b50002e7",
  "cmd": "org.apache.cloudstack.api.command.admin.guest.GetHypervisorGuestOsNamesCmd",
  "completed": "2022-07-28T09:28:12+0000",
  "created": "2022-07-28T09:28:12+0000",
  "jobid": "e5189994-d441-42d3-bb75-26647210a7c1",
  "jobprocstatus": 0,
  "jobresult": {
    "errorcode": 530,
    "errortext": "No host exists with hypervisor: XenServer and version: 6.1.0, please specify available hypervisor and version"
  },
  "jobresultcode": 530,
  "jobresulttype": "object",
  "jobstatus": 2,
  "userid": "aa310e7a-0654-11ed-8c69-1e00b50002e7"
}

sureshanaparti avatar Jul 21 '22 10:07 sureshanaparti

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Jul 21 '22 10:07 acs-robot

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Jul 21 '22 10:07 blueorangutan

@blueorangutan package

sureshanaparti avatar Jul 21 '22 10:07 sureshanaparti

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

blueorangutan avatar Jul 21 '22 10:07 blueorangutan

UI build: :heavy_check_mark: Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6561 (SL-JID-1990)

blueorangutan avatar Jul 21 '22 10:07 blueorangutan

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 3807

blueorangutan avatar Jul 21 '22 10:07 blueorangutan

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Jul 28 '22 09:07 acs-robot

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Jul 28 '22 09:07 blueorangutan

UI build: :heavy_check_mark: Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6561 (SL-JID-2021)

blueorangutan avatar Jul 28 '22 09:07 blueorangutan

@blueorangutan package

sureshanaparti avatar Jul 28 '22 09:07 sureshanaparti

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

blueorangutan avatar Jul 28 '22 09:07 blueorangutan

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 3843

blueorangutan avatar Jul 28 '22 10:07 blueorangutan

@blueorangutan test matrix

sureshanaparti avatar Jul 28 '22 10:07 sureshanaparti

@sureshanaparti a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

blueorangutan avatar Jul 28 '22 10:07 blueorangutan

@blueorangutan package

sureshanaparti avatar Jul 28 '22 11:07 sureshanaparti

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Jul 28 '22 11:07 acs-robot

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

blueorangutan avatar Jul 28 '22 11:07 blueorangutan

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 3844

blueorangutan avatar Jul 28 '22 12:07 blueorangutan

Trillian test result (tid-4556) Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7 Total time taken: 38918 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6561-t4556-vmware-65u2.zip Smoke tests completed. 100 look OK, 0 have errors Only failed tests results shown below:

Test Result Time (s) Test File

blueorangutan avatar Jul 28 '22 21:07 blueorangutan

Trillian test result (tid-4555) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 45425 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6561-t4555-kvm-centos7.zip Smoke tests completed. 99 look OK, 1 have errors Only failed tests results shown below:

Test Result Time (s) Test File
test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers Failure 470.32 test_vpc_redundant.py

blueorangutan avatar Jul 28 '22 23:07 blueorangutan

@blueorangutan package

sureshanaparti avatar Jul 29 '22 08:07 sureshanaparti

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Jul 29 '22 08:07 acs-robot

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

blueorangutan avatar Jul 29 '22 08:07 blueorangutan

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 3855

blueorangutan avatar Jul 29 '22 09:07 blueorangutan

@blueorangutan test

sureshanaparti avatar Aug 07 '22 17:08 sureshanaparti

@blueorangutan help

sureshanaparti avatar Aug 07 '22 18:08 sureshanaparti

@sureshanaparti 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'] Hypervisor options: ['kvm-centos6', 'kvm-centos7', 'kvm-rocky8', 'kvm-alma8', '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', 'Pearl1594', 'davidjumani', 'harikrishna-patnala', 'vladimirpetrov', 'weizhouapache', 'NuxRo']

blueorangutan avatar Aug 07 '22 18:08 blueorangutan

I see nothing wrong with the code (even though sonar cloud does) . I have a question; how does this work with upgrade updates?

DaanHoogland avatar Aug 17 '22 16:08 DaanHoogland

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Dec 05 '22 18:12 github-actions[bot]