Comment 30 for bug 1960758

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

Verification done for focal-proposed and
(via upgrade to) focal-victoria/proposed,
later upgraded to focal-wallaby/proposed
(to confirm no changes are needed there).

focal-proposed:
--------------

First, (juju) deployed openstack on focal, and verified with steps in comment #15.

With focal-updates, an uefi server does NOT boot:

 $ juju ssh nova-compute/0 'dpkg -s nova-compute | grep ^Version:' 2>/dev/null
 Version: 2:21.2.4-0ubuntu2.5

 $ openstack image set jammy --property hw_firmware_type=uefi
 $ openstack server create --image jammy --flavor m1.small --network private test

 $ juju ssh nova-compute/0 sudo virsh dumpxml instance-00000002 2>&1 | sed -n '/<os>/,/<\/os>/p'
 ...
     <loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.secboot.fd</loader>
 ...

 $ openstack console log show test
 $

With focal-proposed, the server does boot successfully:

$ juju ssh nova-compute/0 'sudo add-apt-repository --yes "deb http://archive.ubuntu.com/ubuntu focal-proposed main"'

I didn't find an option to "upgrade" to focal-proposed
(just to later openstack releases/cloud archive), thus
I manually run the `apt install` command as the charm.

The config change isn't an issue with the nova-compute
charm due to dpkg options `--force-conf{new,def}`:

 @ charm-nova-compute/hooks/nova_compute_utils.py

  769 dpkg_opts = [
  770 '--option', 'Dpkg::Options::=--force-confnew',
  771 '--option', 'Dpkg::Options::=--force-confdef',
  772 ]

@ dpkg(1):

 confnew: If a conffile has been modified and the version in the package did change,
 always install the new version without prompting, unless the --force-confdef is also specified,
 in which case the default action is preferred.

And the charm does rewrite the configs anyway (`configs.write_all()`),
so I installed and triggered the config change/rewrite w/ our option.

 $ juju ssh nova-compute/0 'sudo apt install --yes --option=Dpkg::Options::=--force-confnew --option=Dpkg::Options::=--force-confdef nova-compute'
 ...
 Configuration file '/etc/nova/nova.conf'
  ==> Modified (by you or by a script) since installation.
  ==> Package distributor has shipped an updated version.
  ==> Keeping old config file as default.
 ...

 $ juju ssh nova-compute/0 'dpkg -s nova-compute | grep ^Version:' 2>/dev/null
 Version: 2:21.2.4-0ubuntu2.6

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

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

And the server boot correctly:

 $ openstack server stop test
 $ 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 |

 $ juju ssh nova-compute/0 sudo virsh dumpxml instance-00000002 2>&1 | sed -n '/<os>/,/<\/os>/p'
 ...
     <loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
 ...

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

focal-victoria/proposed:
-----------------------

Then, upgraded to (cloud-archive) focal-victoria, as in comment #17.
Except for the last step, which used -proposed, of course:

 $ juju config nova-compute openstack-origin=cloud:focal-victoria/proposed

 $ juju ssh nova-compute/0 'dpkg -s nova-compute | grep ^Version:' 2>/dev/null
 Version: 2:22.4.0-0ubuntu1~cloud5

 $ cmadison nova | grep victoria
  nova | 2:22.4.0-0ubuntu1~cloud4 | victoria | focal-updates | source
  nova | 2:22.4.0-0ubuntu1~cloud5 | victoria-proposed | focal-proposed | source

The fix continues to work in victoria-proposed:

 $ openstack server stop test
 $ openstack server start test

 $ juju ssh nova-compute/0 sudo virsh dumpxml instance-00000002 2>&1 | sed -n '/<os>/,/<\/os>/p'
 ...
     <loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
 ...

focal-wallaby:
-------------

Finally, upgraded to focal-wallaby (which does not need the fix at all),
as in comment #17, using 'cloud:focal-wallaby'. Versions (#17 plus one):

 $ for app in rabbitmq-server keystone cinder glance neutron-api neutron-gateway placement nova-cloud-controller nova-compute; do juju status | awk '/'$app' / { print $1, $2; quit }'; done
 rabbitmq-server 3.8.2
 keystone 19.0.1
 cinder 18.2.1
 glance 22.1.1
 neutron-api 18.6.0
 neutron-gateway 18.6.0
 placement 5.0.1
 nova-cloud-controller 23.2.2
 nova-compute 23.2.2

Verified the patched code is not there anymore:

 $ juju ssh nova-compute/0 'grep -r ubuntu_libvirt_uefi_loader_path /usr/lib/python3/dist-packages/nova/'
 $

And the VM still boots successfully after stop/start:

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

The new guest XML is refactored/different from Ussuri/Victoria,
as expected, due to qemu firmware metadata files 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' secure='no' type='pflash'>/usr/share/OVMF/OVMF_CODE_4M.fd</loader>
     <nvram template='/usr/share/OVMF/OVMF_VARS_4M.fd'>/var/lib/libvirt/qemu/nvram/instance-00000002_VARS.fd</nvram>
     <boot dev='hd'/>
     <smbios mode='sysinfo'/>
   </os>