rosi-shapeblue commented on PR #11740:
URL: https://github.com/apache/cloudstack/pull/11740#issuecomment-3438021385

   ### Step 1 - Deploy Pre-Upgrade BIOS VM (Control)
   
   **1.1 Deploy BIOS VM on Host1**
   
   <details><summary><code>(localcloud) 🐱 > deploy virtualmachine 
name=preupgrade-bios-vm displayname=preupgrade-bios-vm 
zoneid=ed28691c-cf37-456f-95c6-469903cff4e7 
serviceofferingid=e29a0a7a-999c-4d5d-bd31-59cd4fdf5507 
networkids=89223ead-f632-4cb3-95b5-a9cf25085a15 
hostid=809cab41-5034-434f-851b-522f651a4732 
templateid=3d85fb88-aff6-11f0-8ff1-1e00110002e0 </code></summary>
   
   ```json
   {
     "virtualmachine": {
       "account": "admin",
       "affinitygroup": [],
       "arch": "x86_64",
       "cpunumber": 1,
       "cpuspeed": 500,
       "created": "2025-10-23T14:38:07+0000",
       "deleteprotection": false,
       "details": {
         "cpuOvercommitRatio": "2.0"
       },
       "displayname": "preupgrade-bios-vm",
       "displayvm": true,
       "domain": "ROOT",
       "domainid": "3d76a8c0-aff6-11f0-8ff1-1e00110002e0",
       "domainpath": "/",
       "guestosid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "haenable": false,
       "hasannotations": false,
       "hostcontrolstate": "Enabled",
       "hostid": "809cab41-5034-434f-851b-522f651a4732",
       "hostname": "ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1",
       "hypervisor": "KVM",
       "id": "75a3c3e0-059b-4df3-b02c-55fe090a9068",
       "instancename": "i-2-3-VM",
       "ipaddress": "10.1.1.201",
       "isdynamicallyscalable": false,
       "jobid": "fdf8b82d-79d9-4852-b5ca-8d54157432b9",
       "jobstatus": 0,
       "lastupdated": "2025-10-23T14:39:52+0000",
       "memory": 512,
       "name": "preupgrade-bios-vm",
       "nic": [
         {
           "broadcasturi": "vlan://2587",
           "deviceid": "0",
           "extradhcpoption": [],
           "gateway": "10.1.1.1",
           "id": "ca4ca57b-7619-4c03-b2c2-130f988842b2",
           "ipaddress": "10.1.1.201",
           "isdefault": true,
           "isolationuri": "vlan://2587",
           "macaddress": "02:01:00:cc:00:01",
           "netmask": "255.255.255.0",
           "networkid": "89223ead-f632-4cb3-95b5-a9cf25085a15",
           "networkname": "test",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "Isolated"
         }
       ],
       "osdisplayname": "CentOS 5.5 (64-bit)",
       "ostypeid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "passwordenabled": false,
       "pooltype": "NetworkFilesystem",
       "receivedbytes": 0,
       "rootdeviceid": 0,
       "rootdevicetype": "ROOT",
       "securitygroup": [],
       "sentbytes": 0,
       "serviceofferingid": "e29a0a7a-999c-4d5d-bd31-59cd4fdf5507",
       "serviceofferingname": "Small Instance",
       "state": "Running",
       "tags": [],
       "templatedisplaytext": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templateformat": "QCOW2",
       "templateid": "3d85fb88-aff6-11f0-8ff1-1e00110002e0",
       "templatename": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templatetype": "BUILTIN",
       "userid": "d8425aac-aff6-11f0-8ff1-1e00110002e0",
       "username": "admin",
       "zoneid": "ed28691c-cf37-456f-95c6-469903cff4e7",
       "zonename": "ref-trl-9845-k-Mol8-rositsa-kyuchukova"
     }
   }
   ````
   </details> 
   
   
   **Expected Result:** VM deploys successfully and is in Running state
   
   **Actual Result:** VM deploys successfully and is in Running state
   
   **1.2 Verified It's Using BIOS**
   
   ```
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1 ~]# virsh dumpxml i-2-3-VM 
| sed -n '/<os>/,/<\/os>/p'
     <os>
       <type arch='x86_64' machine='pc-i440fx-rhel7.6.0'>hvm</type>
       <boot dev='cdrom'/>
       <boot dev='hd'/>
       <smbios mode='sysinfo'/>
     </os>
   
   ```
   
   **Expected Results:**
   
   - No output from grep loader (no loader element)
   - Machine type shows pc-i440fx or similar (not q35)
   - No <loader> or <nvram> tags in OS section
   - No NVRAM file in /var/lib/libvirt/qemu/nvram/
   
   **Actual Results:**
   ALL CHECKS PASSED - VM is using BIOS boot mode
   
   - No loader element found (grep returned nothing)
   - Machine type: pc-i440fx-rhel7.6.0 (traditional BIOS)
   - No nvram element
   - Traditional boot device order
   
   **1.3 Stop/Start VM Lifecycle Test**
   
   - Stop the VM
   
   <details><summary><code>(localcloud) 🐱 > stop virtualmachine 
id=75a3c3e0-059b-4df3-b02c-55fe090a9068 </code></summary>
   
   ```json
   {
     "virtualmachine": {
       "account": "admin",
       "affinitygroup": [],
       "arch": "x86_64",
       "cpunumber": 1,
       "cpuspeed": 500,
       "cpuused": "0%",
       "created": "2025-10-23T14:38:07+0000",
       "deleteprotection": false,
       "details": {
         "Message.ReservedCapacityFreed.Flag": "false",
         "cpuOvercommitRatio": "2.0"
       },
       "diskioread": 0,
       "diskiowrite": 0,
       "diskkbsread": 0,
       "diskkbswrite": 0,
       "displayname": "preupgrade-bios-vm",
       "displayvm": true,
       "domain": "ROOT",
       "domainid": "3d76a8c0-aff6-11f0-8ff1-1e00110002e0",
       "domainpath": "/",
       "guestosid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "haenable": false,
       "hasannotations": false,
       "hypervisor": "KVM",
       "id": "75a3c3e0-059b-4df3-b02c-55fe090a9068",
       "instancename": "i-2-3-VM",
       "ipaddress": "10.1.1.201",
       "isdynamicallyscalable": false,
       "jobid": "0ee0bdd7-b7a9-4248-acdc-6a84dfbeccf1",
       "jobstatus": 0,
       "lastupdated": "2025-10-23T14:51:29+0000",
       "memory": 512,
       "memoryintfreekbs": -1,
       "memorykbs": 524288,
       "memorytargetkbs": 524288,
       "name": "preupgrade-bios-vm",
       "networkkbsread": 0,
       "networkkbswrite": 0,
       "nic": [
         {
           "deviceid": "0",
           "extradhcpoption": [],
           "gateway": "10.1.1.1",
           "id": "ca4ca57b-7619-4c03-b2c2-130f988842b2",
           "ipaddress": "10.1.1.201",
           "isdefault": true,
           "macaddress": "02:01:00:cc:00:01",
           "netmask": "255.255.255.0",
           "networkid": "89223ead-f632-4cb3-95b5-a9cf25085a15",
           "networkname": "test",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "Isolated"
         }
       ],
       "osdisplayname": "CentOS 5.5 (64-bit)",
       "ostypeid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "passwordenabled": false,
       "pooltype": "NetworkFilesystem",
       "receivedbytes": 0,
       "rootdeviceid": 0,
       "rootdevicetype": "ROOT",
       "securitygroup": [],
       "sentbytes": 0,
       "serviceofferingid": "e29a0a7a-999c-4d5d-bd31-59cd4fdf5507",
       "serviceofferingname": "Small Instance",
       "state": "Stopped",
       "tags": [],
       "templatedisplaytext": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templateformat": "QCOW2",
       "templateid": "3d85fb88-aff6-11f0-8ff1-1e00110002e0",
       "templatename": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templatetype": "BUILTIN",
       "userid": "d8425aac-aff6-11f0-8ff1-1e00110002e0",
       "username": "admin",
       "zoneid": "ed28691c-cf37-456f-95c6-469903cff4e7",
       "zonename": "ref-trl-9845-k-Mol8-rositsa-kyuchukova"
     }
   }
   ````
   </details> 
   
   - Start the VM 
   
   <details><summary><code>(localcloud) 🐱 > start virtualmachine 
id=75a3c3e0-059b-4df3-b02c-55fe090a9068 </code></summary>
   
   ```json
   {
     "virtualmachine": {
       "account": "admin",
       "affinitygroup": [],
       "arch": "x86_64",
       "cpunumber": 1,
       "cpuspeed": 500,
       "cpuused": "0%",
       "created": "2025-10-23T14:38:07+0000",
       "deleteprotection": false,
       "details": {
         "Message.ReservedCapacityFreed.Flag": "false",
         "cpuOvercommitRatio": "2.0"
       },
       "diskioread": 0,
       "diskiowrite": 0,
       "diskkbsread": 0,
       "diskkbswrite": 0,
       "displayname": "preupgrade-bios-vm",
       "displayvm": true,
       "domain": "ROOT",
       "domainid": "3d76a8c0-aff6-11f0-8ff1-1e00110002e0",
       "domainpath": "/",
       "guestosid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "haenable": false,
       "hasannotations": false,
       "hostcontrolstate": "Enabled",
       "hostid": "809cab41-5034-434f-851b-522f651a4732",
       "hostname": "ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1",
       "hypervisor": "KVM",
       "id": "75a3c3e0-059b-4df3-b02c-55fe090a9068",
       "instancename": "i-2-3-VM",
       "ipaddress": "10.1.1.201",
       "isdynamicallyscalable": false,
       "jobid": "b78eb910-102b-445f-8458-ffbc58f0bd6b",
       "jobstatus": 0,
       "lastupdated": "2025-10-23T14:52:09+0000",
       "memory": 512,
       "memoryintfreekbs": -1,
       "memorykbs": 524288,
       "memorytargetkbs": 524288,
       "name": "preupgrade-bios-vm",
       "networkkbsread": 0,
       "networkkbswrite": 0,
       "nic": [
         {
           "broadcasturi": "vlan://2587",
           "deviceid": "0",
           "extradhcpoption": [],
           "gateway": "10.1.1.1",
           "id": "ca4ca57b-7619-4c03-b2c2-130f988842b2",
           "ipaddress": "10.1.1.201",
           "isdefault": true,
           "isolationuri": "vlan://2587",
           "macaddress": "02:01:00:cc:00:01",
           "netmask": "255.255.255.0",
           "networkid": "89223ead-f632-4cb3-95b5-a9cf25085a15",
           "networkname": "test",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "Isolated"
         }
       ],
       "osdisplayname": "CentOS 5.5 (64-bit)",
       "ostypeid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "passwordenabled": false,
       "pooltype": "NetworkFilesystem",
       "receivedbytes": 0,
       "rootdeviceid": 0,
       "rootdevicetype": "ROOT",
       "securitygroup": [],
       "sentbytes": 0,
       "serviceofferingid": "e29a0a7a-999c-4d5d-bd31-59cd4fdf5507",
       "serviceofferingname": "Small Instance",
       "state": "Running",
       "tags": [],
       "templatedisplaytext": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templateformat": "QCOW2",
       "templateid": "3d85fb88-aff6-11f0-8ff1-1e00110002e0",
       "templatename": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templatetype": "BUILTIN",
       "userid": "d8425aac-aff6-11f0-8ff1-1e00110002e0",
       "username": "admin",
       "zoneid": "ed28691c-cf37-456f-95c6-469903cff4e7",
       "zonename": "ref-trl-9845-k-Mol8-rositsa-kyuchukova"
     }
   }
   ````
   </details> 
   
   - Verify it's running
   
   ```
   (localcloud) 🐱 > list virtualmachines 
id=75a3c3e0-059b-4df3-b02c-55fe090a9068 filter=name,id,state
   {
     "count": 1,
     "virtualmachine": [
       {
         "id": "75a3c3e0-059b-4df3-b02c-55fe090a9068",
         "name": "preupgrade-bios-vm",
         "state": "Running"
       }
     ]
   }
   ```
   
   **Expected Result:** VM stops and starts successfully
   
   **Actual Result:** VM stops and starts successfully 
   
   **1.4 Migrate VM to Host2 (Pre-Upgrade)**
   
   <details><summary><code>(localcloud) 🐱 > migrate virtualmachine 
virtualmachineid=75a3c3e0-059b-4df3-b02c-55fe090a9068 
hostid=f32bba83-2167-42fd-b44d-956748133215  </code></summary>
   
   ```json
   {
     "virtualmachine": {
       "account": "admin",
       "affinitygroup": [],
       "arch": "x86_64",
       "cpunumber": 1,
       "cpuspeed": 500,
       "cpuused": "68.34%",
       "created": "2025-10-23T14:38:07+0000",
       "deleteprotection": false,
       "details": {
         "Message.ReservedCapacityFreed.Flag": "false",
         "cpuOvercommitRatio": "2.0"
       },
       "diskioread": 3115,
       "diskiowrite": 667,
       "diskkbsread": 128041,
       "diskkbswrite": 6598,
       "displayname": "preupgrade-bios-vm",
       "displayvm": true,
       "domain": "ROOT",
       "domainid": "3d76a8c0-aff6-11f0-8ff1-1e00110002e0",
       "domainpath": "/",
       "guestosid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "haenable": false,
       "hasannotations": false,
       "hostcontrolstate": "Enabled",
       "hostid": "f32bba83-2167-42fd-b44d-956748133215",
       "hostname": "ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2",
       "hypervisor": "KVM",
       "id": "75a3c3e0-059b-4df3-b02c-55fe090a9068",
       "instancename": "i-2-3-VM",
       "ipaddress": "10.1.1.201",
       "isdynamicallyscalable": false,
       "jobid": "c5d93d07-3472-4545-b187-4d1baebbc950",
       "jobstatus": 0,
       "lastupdated": "2025-10-23T14:53:48+0000",
       "memory": 512,
       "memoryintfreekbs": -1,
       "memorykbs": 524288,
       "memorytargetkbs": 524288,
       "name": "preupgrade-bios-vm",
       "networkkbsread": 1,
       "networkkbswrite": 0,
       "nic": [
         {
           "broadcasturi": "vlan://2587",
           "deviceid": "0",
           "extradhcpoption": [],
           "gateway": "10.1.1.1",
           "id": "ca4ca57b-7619-4c03-b2c2-130f988842b2",
           "ipaddress": "10.1.1.201",
           "isdefault": true,
           "isolationuri": "vlan://2587",
           "macaddress": "02:01:00:cc:00:01",
           "netmask": "255.255.255.0",
           "networkid": "89223ead-f632-4cb3-95b5-a9cf25085a15",
           "networkname": "test",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "Isolated"
         }
       ],
       "osdisplayname": "CentOS 5.5 (64-bit)",
       "ostypeid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "passwordenabled": false,
       "pooltype": "NetworkFilesystem",
       "receivedbytes": 0,
       "rootdeviceid": 0,
       "rootdevicetype": "ROOT",
       "securitygroup": [],
       "sentbytes": 0,
       "serviceofferingid": "e29a0a7a-999c-4d5d-bd31-59cd4fdf5507",
       "serviceofferingname": "Small Instance",
       "state": "Running",
       "tags": [],
       "templatedisplaytext": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templateformat": "QCOW2",
       "templateid": "3d85fb88-aff6-11f0-8ff1-1e00110002e0",
       "templatename": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templatetype": "BUILTIN",
       "userid": "d8425aac-aff6-11f0-8ff1-1e00110002e0",
       "username": "admin",
       "zoneid": "ed28691c-cf37-456f-95c6-469903cff4e7",
       "zonename": "ref-trl-9845-k-Mol8-rositsa-kyuchukova"
     }
   }
   ````
   </details> 
   
   - Verify on Host2:
   
   ```
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2 ~]# virsh dumpxml i-2-3-VM 
| grep -A 5 "<os>"
     <os>
       <type arch='x86_64' machine='pc-i440fx-rhel7.6.0'>hvm</type>
       <boot dev='cdrom'/>
       <boot dev='hd'/>
       <smbios mode='sysinfo'/>
     </os>
   ```
   
   **Expected Result:** Migration succeeds, VM remains running on Host2
   
   **Actual Result:** 
   
   - Migration completed successfully
   - VM still using BIOS boot mode after migration
   - No loader or nvram elements added
   
   ### Step 2 – Upgrade to PR Version
   
   **2.1 Upgrade MS / Agents on Both KVM Hosts**
   
   - Host1
   ```
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1 ~]# rpm -qa | grep 
cloudstack-agent
   
   cloudstack-agent-4.22.0.0-shapeblue17703.noarch
   ```
   
   - Host2
   
   ```
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2 ~]# rpm -qa | grep 
cloudstack-agent
   
   cloudstack-agent-4.22.0.0-shapeblue17703.noarch
   ```
   
   - Management Server
   
   ```
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-mgmt1 ~]# rpm -qa | grep 
cloudstack-management
   cloudstack-management-4.22.0.0-shapeblue17703.noarch
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-mgmt1 ~]# 
   
   ```
   
   **Expected Result: Management Server / Agents upgraded successfully
   **Actual Results:** Successfully upgraded MS + Hosts
   
   **2.2 Verify UEFI Config Files Created** 
   
   - Check if uefi.properties exists on Host1 / Host2
   
   ```
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1 ~]# ls -l 
/etc/cloudstack/agent/uefi.properties
   -rw-r--r--. 1 root root 297 Oct 23 10:17 
/etc/cloudstack/agent/uefi.properties
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1 ~]# cat 
/etc/cloudstack/agent/uefi.properties
   guest.nvram.template.secure=/usr/share/edk2/ovmf/OVMF_VARS.secboot.fd
   guest.nvram.template.legacy=/usr/share/edk2/ovmf/OVMF_VARS.fd
   guest.nvram.path=/var/lib/libvirt/qemu/nvram/
   guest.loader.secure=/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd
   guest.loader.legacy=/usr/share/edk2/ovmf/OVMF_CODE.cc.fd
   
   ```
   
   and
   
   ```
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2 ~]# cat 
/etc/cloudstack/agent/uefi.properties
   guest.nvram.template.secure=/usr/share/edk2/ovmf/OVMF_VARS.secboot.fd
   guest.nvram.template.legacy=/usr/share/edk2/ovmf/OVMF_VARS.fd
   guest.nvram.path=/var/lib/libvirt/qemu/nvram/
   guest.loader.secure=/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd
   guest.loader.legacy=/usr/share/edk2/ovmf/OVMF_CODE.cc.fd
   ```
   
   - Verify OVMF packages are installed
   
   ```
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1 ~]# rpm -qa | grep -i ovmf
   
   edk2-ovmf-20220126gitbb1bba3d77-13.el8_10.8.noarch
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1 ~]# 
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1 ~]# rpm -qa | grep -i swtpm
   
   swtpm-0.7.0-4.20211109gitb79fd91.module+el8.9.0+90052+d3bf71d8.x86_64
   swtpm-tools-0.7.0-4.20211109gitb79fd91.module+el8.9.0+90052+d3bf71d8.x86_64
   swtpm-libs-0.7.0-4.20211109gitb79fd91.module+el8.9.0+90052+d3bf71d8.x86_64
   ```
   
   and
   
   ```
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2 ~]# rpm -qa | grep -i ovmf
   
   edk2-ovmf-20220126gitbb1bba3d77-13.el8_10.8.noarch
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2 ~]# 
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2 ~]# rpm -qa | grep -i swtpm
   
   swtpm-0.7.0-4.20211109gitb79fd91.module+el8.9.0+90052+d3bf71d8.x86_64
   swtpm-tools-0.7.0-4.20211109gitb79fd91.module+el8.9.0+90052+d3bf71d8.x86_64
   swtpm-libs-0.7.0-4.20211109gitb79fd91.module+el8.9.0+90052+d3bf71d8.x86_64
   ```
   
   **Actual Results:**
   
   - /etc/cloudstack/agent/uefi.properties exists
   - File contains OVMF paths for legacy and secure boot
   - edk2-ovmf package is installed
   - swtpm package is installed
   
   **2.3 Restart Agents and Management Server**
   
   Expected Result: Agent restarts successfully with no errors
   Actual Results: Agents restart successfully with no errors
   
   
   **2.5 Check Host UEFI Capabilities on Management Server**
   
   ```
   (localcloud) 🐱 > list hosts id=809cab41-5034-434f-851b-522f651a4732 | grep 
-i uefi
           "host.uefi.enable": "true",
         "ueficapability": true,
   
   (localcloud) 🐱 > list hosts id=f32bba83-2167-42fd-b44d-956748133215 | grep 
-i uefi
           "host.uefi.enable": "true",
         "ueficapability": true,
   (localcloud) 🐱 >  
   ```
   
   **Actual Result**: UEFI is successfully enabled by default on both KVM hosts 
after the upgrade!
   
   - "host.uefi.enable": "true" for both Hosts
   - "ueficapability": true for both Hosts
   
   **Step 3 – Validate Old BIOS VM After Upgrade**
   
   - 3.1 Check State of Old Pre-Upgrade VM
   
   ```
   (localcloud) 🐱 > list virtualmachines filter=id,name,state
   {
     "count": 1,
     "virtualmachine": [
       {
         "id": "75a3c3e0-059b-4df3-b02c-55fe090a9068",
         "name": "preupgrade-bios-vm",
         "state": "Running"
       }
     ]
   }
   ````
   
   - 3.2. Stop/Start the VM
   
   <details><summary><code>(localcloud) 🐱 > stop virtualmachine 
id=75a3c3e0-059b-4df3-b02c-55fe090a9068 </code></summary>
   
   ```json
   {
     "virtualmachine": {
       "account": "admin",
       "affinitygroup": [],
       "arch": "x86_64",
       "cpunumber": 1,
       "cpuspeed": 500,
       "cpuused": "19.96%",
       "created": "2025-10-23T14:38:07+0000",
       "deleteprotection": false,
       "details": {
         "Message.ReservedCapacityFreed.Flag": "false",
         "cpuOvercommitRatio": "2.0"
       },
       "diskioread": 0,
       "diskiowrite": 4,
       "diskkbsread": 0,
       "diskkbswrite": 24,
       "displayname": "preupgrade-bios-vm",
       "displayvm": true,
       "domain": "ROOT",
       "domainid": "3d76a8c0-aff6-11f0-8ff1-1e00110002e0",
       "domainpath": "ROOT",
       "guestosid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "haenable": false,
       "hasannotations": false,
       "hypervisor": "KVM",
       "id": "75a3c3e0-059b-4df3-b02c-55fe090a9068",
       "instancename": "i-2-3-VM",
       "ipaddress": "10.1.1.201",
       "isdynamicallyscalable": false,
       "jobid": "25168220-665c-41d8-a2ef-2863d5ec1e1e",
       "jobstatus": 0,
       "lastupdated": "2025-10-23T15:53:55+0000",
       "memory": 512,
       "memoryintfreekbs": -1,
       "memorykbs": 524288,
       "memorytargetkbs": 524288,
       "name": "preupgrade-bios-vm",
       "networkkbsread": 0,
       "networkkbswrite": 0,
       "nic": [
         {
           "deviceid": "0",
           "extradhcpoption": [],
           "gateway": "10.1.1.1",
           "id": "ca4ca57b-7619-4c03-b2c2-130f988842b2",
           "ipaddress": "10.1.1.201",
           "isdefault": true,
           "macaddress": "02:01:00:cc:00:01",
           "netmask": "255.255.255.0",
           "networkid": "89223ead-f632-4cb3-95b5-a9cf25085a15",
           "networkname": "test",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "Isolated"
         }
       ],
       "osdisplayname": "CentOS 5.5 (64-bit)",
       "ostypeid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "passwordenabled": false,
       "pooltype": "NetworkFilesystem",
       "receivedbytes": 0,
       "rootdeviceid": 0,
       "rootdevicetype": "ROOT",
       "securitygroup": [],
       "sentbytes": 0,
       "serviceofferingid": "e29a0a7a-999c-4d5d-bd31-59cd4fdf5507",
       "serviceofferingname": "Small Instance",
       "state": "Stopped",
       "tags": [],
       "templatedisplaytext": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templateformat": "QCOW2",
       "templateid": "3d85fb88-aff6-11f0-8ff1-1e00110002e0",
       "templatename": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templatetype": "BUILTIN",
       "userid": "d8425aac-aff6-11f0-8ff1-1e00110002e0",
       "username": "admin",
       "zoneid": "ed28691c-cf37-456f-95c6-469903cff4e7",
       "zonename": "ref-trl-9845-k-Mol8-rositsa-kyuchukova"
     }
   }
   
   ````
   </details> 
   
   - Start VM
   
   <details><summary><code>(localcloud) 🐱 > start virtualmachine 
id=75a3c3e0-059b-4df3-b02c-55fe090a9068 </code></summary>
   
   ```json
   {
     "virtualmachine": {
       "account": "admin",
       "affinitygroup": [],
       "arch": "x86_64",
       "cpunumber": 1,
       "cpuspeed": 500,
       "cpuused": "19.96%",
       "created": "2025-10-23T14:38:07+0000",
       "deleteprotection": false,
       "details": {
         "Message.ReservedCapacityFreed.Flag": "false",
         "cpuOvercommitRatio": "2.0"
       },
       "diskioread": 0,
       "diskiowrite": 4,
       "diskkbsread": 0,
       "diskkbswrite": 24,
       "displayname": "preupgrade-bios-vm",
       "displayvm": true,
       "domain": "ROOT",
       "domainid": "3d76a8c0-aff6-11f0-8ff1-1e00110002e0",
       "domainpath": "ROOT",
       "guestosid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "haenable": false,
       "hasannotations": false,
       "hostcontrolstate": "Enabled",
       "hostid": "f32bba83-2167-42fd-b44d-956748133215",
       "hostname": "ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2",
       "hypervisor": "KVM",
       "id": "75a3c3e0-059b-4df3-b02c-55fe090a9068",
       "instancename": "i-2-3-VM",
       "ipaddress": "10.1.1.201",
       "isdynamicallyscalable": false,
       "jobid": "2ae44cc1-4d28-46b2-ada7-cabd403d047e",
       "jobstatus": 0,
       "lastupdated": "2025-10-23T15:54:30+0000",
       "memory": 512,
       "memoryintfreekbs": -1,
       "memorykbs": 524288,
       "memorytargetkbs": 524288,
       "name": "preupgrade-bios-vm",
       "networkkbsread": 0,
       "networkkbswrite": 0,
       "nic": [
         {
           "broadcasturi": "vlan://2587",
           "deviceid": "0",
           "extradhcpoption": [],
           "gateway": "10.1.1.1",
           "id": "ca4ca57b-7619-4c03-b2c2-130f988842b2",
           "ipaddress": "10.1.1.201",
           "isdefault": true,
           "isolationuri": "vlan://2587",
           "macaddress": "02:01:00:cc:00:01",
           "netmask": "255.255.255.0",
           "networkid": "89223ead-f632-4cb3-95b5-a9cf25085a15",
           "networkname": "test",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "Isolated"
         }
       ],
       "osdisplayname": "CentOS 5.5 (64-bit)",
       "ostypeid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "passwordenabled": false,
       "pooltype": "NetworkFilesystem",
       "receivedbytes": 0,
       "rootdeviceid": 0,
       "rootdevicetype": "ROOT",
       "securitygroup": [],
       "sentbytes": 0,
       "serviceofferingid": "e29a0a7a-999c-4d5d-bd31-59cd4fdf5507",
       "serviceofferingname": "Small Instance",
       "state": "Running",
       "tags": [],
       "templatedisplaytext": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templateformat": "QCOW2",
       "templateid": "3d85fb88-aff6-11f0-8ff1-1e00110002e0",
       "templatename": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templatetype": "BUILTIN",
       "userid": "d8425aac-aff6-11f0-8ff1-1e00110002e0",
       "username": "admin",
       "zoneid": "ed28691c-cf37-456f-95c6-469903cff4e7",
       "zonename": "ref-trl-9845-k-Mol8-rositsa-kyuchukova"
     }
   }
   ````
   </details> 
   
   **Actual Result**  VM boots normally (still as BIOS)
   
   **3.2 Verify XML Still Shows BIOS (Not Converted)**
   
   ```
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2 ~]# virsh list --all
    Id   Name       State
   --------------------------
    1    s-1-VM     running
    3    i-2-3-VM   running
   
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2 ~]# virsh dumpxmle 
i-2-3-VM | grep -A 10 "<os>"
   error: unknown command: 'dumpxmle'
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2 ~]# 
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2 ~]# virsh dumpxml i-2-3-VM 
| grep -A 10 "<os>"
     <os>
       <type arch='x86_64' machine='pc-i440fx-rhel7.6.0'>hvm</type>
       <boot dev='cdrom'/>
       <boot dev='hd'/>
       <smbios mode='sysinfo'/>
     </os>
     <features>
       <acpi/>
       <apic/>
       <pae/>
     </features>
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2 ~]# virsh dumpxml i-2-3-VM 
| grep loader
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2 ~]# 
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2 ~]# ls -l 
/var/lib/libvirt/qemu/nvram/ | grep i-2-3-VM
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm2 ~]# 
   
   ```
   
   **3.3 Migrate Old BIOS VM Between Hosts**
   
   <details><summary><code>(localcloud) 🐱 > migrate virtualmachine 
virtualmachineid=75a3c3e0-059b-4df3-b02c-55fe090a9068 
hostid=809cab41-5034-434f-851b-522f651a4732 </code></summary>
   
   ```json
   {
     "virtualmachine": {
       "account": "admin",
       "affinitygroup": [],
       "arch": "x86_64",
       "cpunumber": 1,
       "cpuspeed": 500,
       "cpuused": "30.16%",
       "created": "2025-10-23T14:38:07+0000",
       "deleteprotection": false,
       "details": {
         "Message.ReservedCapacityFreed.Flag": "false",
         "cpuOvercommitRatio": "2.0"
       },
       "diskioread": 681,
       "diskiowrite": 300,
       "diskkbsread": 13360,
       "diskkbswrite": 4252,
       "displayname": "preupgrade-bios-vm",
       "displayvm": true,
       "domain": "ROOT",
       "domainid": "3d76a8c0-aff6-11f0-8ff1-1e00110002e0",
       "domainpath": "ROOT",
       "guestosid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "haenable": false,
       "hasannotations": false,
       "hostcontrolstate": "Enabled",
       "hostid": "809cab41-5034-434f-851b-522f651a4732",
       "hostname": "ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1",
       "hypervisor": "KVM",
       "id": "75a3c3e0-059b-4df3-b02c-55fe090a9068",
       "instancename": "i-2-3-VM",
       "ipaddress": "10.1.1.201",
       "isdynamicallyscalable": false,
       "jobid": "1c27cccd-c670-48db-99f1-6863692754da",
       "jobstatus": 0,
       "lastupdated": "2025-10-23T15:57:16+0000",
       "memory": 512,
       "memoryintfreekbs": -1,
       "memorykbs": 524288,
       "memorytargetkbs": 524288,
       "name": "preupgrade-bios-vm",
       "networkkbsread": 1,
       "networkkbswrite": 6,
       "nic": [
         {
           "broadcasturi": "vlan://2587",
           "deviceid": "0",
           "extradhcpoption": [],
           "gateway": "10.1.1.1",
           "id": "ca4ca57b-7619-4c03-b2c2-130f988842b2",
           "ipaddress": "10.1.1.201",
           "isdefault": true,
           "isolationuri": "vlan://2587",
           "macaddress": "02:01:00:cc:00:01",
           "netmask": "255.255.255.0",
           "networkid": "89223ead-f632-4cb3-95b5-a9cf25085a15",
           "networkname": "test",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "Isolated"
         }
       ],
       "osdisplayname": "CentOS 5.5 (64-bit)",
       "ostypeid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "passwordenabled": false,
       "pooltype": "NetworkFilesystem",
       "receivedbytes": 0,
       "rootdeviceid": 0,
       "rootdevicetype": "ROOT",
       "securitygroup": [],
       "sentbytes": 0,
       "serviceofferingid": "e29a0a7a-999c-4d5d-bd31-59cd4fdf5507",
       "serviceofferingname": "Small Instance",
       "state": "Running",
       "tags": [],
       "templatedisplaytext": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templateformat": "QCOW2",
       "templateid": "3d85fb88-aff6-11f0-8ff1-1e00110002e0",
       "templatename": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templatetype": "BUILTIN",
       "userid": "d8425aac-aff6-11f0-8ff1-1e00110002e0",
       "username": "admin",
       "zoneid": "ed28691c-cf37-456f-95c6-469903cff4e7",
       "zonename": "ref-trl-9845-k-Mol8-rositsa-kyuchukova"
     }
   }
   ````
   </details> 
   
   **Expected Result: BIOS VM migrates successfully between upgraded hosts**
   
   **Actual Result:** BIOS VM migrated successfully from Host2 to Host1
   
   ```
   (localcloud) 🐱 > list virtualmachines filter=id,name,hostname,state
   {
     "count": 1,
     "virtualmachine": [
       {
         "hostname": "ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1",
         "id": "75a3c3e0-059b-4df3-b02c-55fe090a9068",
         "name": "preupgrade-bios-vm",
         "state": "Running"
       }
     ]
   }
   ```
   
   **Actual Result:** VM migrated successfully and in a Running state
   
   ### Step 3 – Deploy New VM Post-Upgrade (Should Be UEFI)
   
   **3.1.  Deploy New VM on Host1 After Upgrade**
   
   **Expected Result:** VM deploys successfully in Running state
   
   **Actual Result** VM deploys successsfully in Running state:
   
   ```
   (localcloud) 🐱 > deploy virtualmachine name=uefi-test-bootmode 
displayname=uefi-test-bootmode zoneid=ed28691c-cf37-456f-95c6-469903cff4e7 
serviceofferingid=e29a0a7a-999c-4d5d-bd31-59cd4fdf5507 
templateid=3d85fb88-aff6-11f0-8ff1-1e00110002e0 
networkids=89223ead-f632-4cb3-95b5-a9cf25085a15 
hostid=809cab41-5034-434f-851b-522f651a4732 bootmode=uefi
   {
     "virtualmachine": {
       "account": "admin",
       "affinitygroup": [],
       "arch": "x86_64",
       "cpunumber": 1,
       "cpuspeed": 500,
       "created": "2025-10-23T16:30:32+0000",
       "deleteprotection": false,
       "details": {
         "cpuOvercommitRatio": "2.0"
       },
       "displayname": "uefi-test-bootmode",
       "displayvm": true,
       "domain": "ROOT",
       "domainid": "3d76a8c0-aff6-11f0-8ff1-1e00110002e0",
       "domainpath": "ROOT",
       "guestosid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "haenable": false,
       "hasannotations": false,
       "hostcontrolstate": "Enabled",
       "hostid": "809cab41-5034-434f-851b-522f651a4732",
       "hostname": "ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1",
       "hypervisor": "KVM",
       "id": "60874661-e415-4894-acbd-ba98370c71be",
       "instancename": "i-2-7-VM",
       "ipaddress": "10.1.1.254",
       "isdynamicallyscalable": false,
       "jobid": "331acf24-8234-44d0-b2c8-bdc24a81baba",
       "jobstatus": 0,
       "lastupdated": "2025-10-23T16:30:40+0000",
       "memory": 512,
       "name": "uefi-test-bootmode",
       "nic": [
         {
           "broadcasturi": "vlan://2587",
           "deviceid": "0",
           "extradhcpoption": [],
           "gateway": "10.1.1.1",
           "id": "aaf2d634-b52d-49ea-9662-fd5e3020f5ea",
           "ipaddress": "10.1.1.254",
           "isdefault": true,
           "isolationuri": "vlan://2587",
           "macaddress": "02:01:00:cc:00:05",
           "netmask": "255.255.255.0",
           "networkid": "89223ead-f632-4cb3-95b5-a9cf25085a15",
           "networkname": "test",
           "secondaryip": [],
           "traffictype": "Guest",
           "type": "Isolated"
         }
       ],
       "osdisplayname": "CentOS 5.5 (64-bit)",
       "ostypeid": "3def23fa-aff6-11f0-8ff1-1e00110002e0",
       "passwordenabled": false,
       "pooltype": "NetworkFilesystem",
       "receivedbytes": 0,
       "rootdeviceid": 0,
       "rootdevicetype": "ROOT",
       "securitygroup": [],
       "sentbytes": 0,
       "serviceofferingid": "e29a0a7a-999c-4d5d-bd31-59cd4fdf5507",
       "serviceofferingname": "Small Instance",
       "state": "Running",
       "tags": [],
       "templatedisplaytext": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templateformat": "QCOW2",
       "templateid": "3d85fb88-aff6-11f0-8ff1-1e00110002e0",
       "templatename": "CentOS 5.5(64-bit) no GUI (KVM)",
       "templatetype": "BUILTIN",
       "userid": "d8425aac-aff6-11f0-8ff1-1e00110002e0",
       "username": "admin",
       "zoneid": "ed28691c-cf37-456f-95c6-469903cff4e7",
       "zonename": "ref-trl-9845-k-Mol8-rositsa-kyuchukova"
     }
   }
   
   ```
   
   **3.2 Verify New VM is Using UEFI**
   
   ```
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1 ~]# virsh dumpxml i-2-7-VM 
| grep -i loader
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1 ~]# virsh dumpxml i-2-7-VM 
| grep -i nvram
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1 ~]# 
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1 ~]# virsh dumpxml i-2-7-VM 
| sed -n '/<os>/,/<\/os>/p'
     <os>
       <type arch='x86_64' machine='pc-i440fx-rhel7.6.0'>hvm</type>
       <boot dev='cdrom'/>
       <boot dev='hd'/>
       <smbios mode='sysinfo'/>
     </os>
   [root@ref-trl-9845-k-Mol8-rositsa-kyuchukova-kvm1 ~]# 
   
   ```
   
   VM deploys as BIOS, despite explicitly specifying it should be UEFI during 
deployment.
   
   
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to