Comment 15 for bug 1960758

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Test steps/results (Ussuri)
---------------------------

Ussuri:

 $ juju status | grep nova-compute | grep stable
 nova-compute 21.2.4 active 1 nova-compute ussuri/stable 682 no Unit is ready

Create server with BIOS firmware (it boots):

 $ openstack server create --image jammy --flavor m1.small --network private test

 $ openstack console log show test | grep -o 'test login:'
 test login:

 $ openstack server show test | grep -e instance_name -e task_state -e vm_state -e status
 | OS-EXT-SRV-ATTR:instance_name | instance-00000001 |
 | OS-EXT-STS:task_state | None |
 | OS-EXT-STS:vm_state | active |
 | status | ACTIVE |

 $ juju ssh nova-compute/0 sudo virsh dumpxml instance-00000001 2>&1 | sed -n '/<os>/,/<\/os>/p'
   <os>
     <type arch='x86_64' machine='pc-i440fx-4.2'>hvm</type>
     <boot dev='hd'/>
     <smbios mode='sysinfo'/>
   </os>

 $ openstack server stop test
 $ openstack server delete test

Create server with UEFI firmware (it does NOT boot):

 $ openstack image set jammy --property hw_firmware_type=uefi

 $ openstack server create --image jammy --flavor m1.small --network private test

 $ openstack console log show test | grep -o 'test login:'
 $

 $ openstack server show test | grep -e instance_name -e task_state -e vm_state -e status
 | OS-EXT-SRV-ATTR:instance_name | instance-00000002 |
 | OS-EXT-STS:task_state | None |
 | OS-EXT-STS:vm_state | active |
 | status | ACTIVE |

(*) Note it uses the secure-boot loader (secboot), for which
    support has not been introduced in Ussuri, but in Wallaby.

 $ juju ssh nova-compute/0 sudo virsh dumpxml instance-00000002 2>&1 | sed -n '/<os>/,/<\/os>/p'
   <os>
     <type arch='x86_64' machine='pc-i440fx-4.2'>hvm</type>
     <loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.secboot.fd</loader>
     <nvram>/var/lib/libvirt/qemu/nvram/instance-00000002_VARS.fd</nvram>
     <boot dev='hd'/>
     <smbios mode='sysinfo'/>
   </os>

The QEMU process keeps spinning at ~100% CPU utilization.

 $ juju ssh nova-compute/0 'for i in {1..5}; do ps -ho pcpu,cmd $(pidof qemu-system-x86_64) | cut -d, -f-1; sleep 1; done'
 99.4 /usr/bin/qemu-system-x86_64 -name guest=instance-00000002
 99.4 /usr/bin/qemu-system-x86_64 -name guest=instance-00000002
 99.4 /usr/bin/qemu-system-x86_64 -name guest=instance-00000002
 99.4 /usr/bin/qemu-system-x86_64 -name guest=instance-00000002
 99.4 /usr/bin/qemu-system-x86_64 -name guest=instance-00000002

 $ openstack server stop test

 $ openstack server show test | grep -e instance_name -e task_state -e vm_state -e status
 | OS-EXT-SRV-ATTR:instance_name | instance-00000002 |
 | OS-EXT-STS:task_state | None |
 | OS-EXT-STS:vm_state | stopped |
 | status | SHUTOFF |

Apply the patch, and enable the option (not enabled by default).

 $ juju config nova-compute config-flags='ubuntu_libvirt_uefi_loader_path=True'

 $ juju status | grep nova-compute/
 nova-compute/0* active idle 9 10.5.2.24 Unit is ready

 $ juju ssh nova-compute/0 systemctl status nova-compute.service | grep Active:
      Active: active (running) since Wed 2023-08-02 21:43:54 UTC; 42s ago

 $ juju ssh nova-compute/0 sudo grep ubuntu_libvirt_uefi_loader_path /etc/nova/nova.conf
 ubuntu_libvirt_uefi_loader_path = True

Start server with UEFI firmware (it now _does_ boot!):

 $ openstack server start test

 $ openstack server show test | grep -e instance_name -e task_state -e vm_state -e status
 | OS-EXT-SRV-ATTR:instance_name | instance-00000002 |
 | OS-EXT-STS:task_state | None |
 | OS-EXT-STS:vm_state | active |
 | status | ACTIVE |

 $ openstack console log show test | grep -o 'test login:'
 test login:

(*) Note it now uses the regular loader (not secboot.fd).

 $ juju ssh nova-compute/0 sudo virsh dumpxml instance-00000002 2>&1 | sed -n '/<os>/,/<\/os>/p'
   <os>
     <type arch='x86_64' machine='pc-i440fx-4.2'>hvm</type>
     <loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
     <nvram>/var/lib/libvirt/qemu/nvram/instance-00000002_VARS.fd</nvram>
     <boot dev='hd'/>
     <smbios mode='sysinfo'/>
   </os>