Public bug reported:

Instance terminates after boot.
Attached file is qemu's instance logs.

Libvirt needs UEFI os boot loader.
Following link will show how to configurate os boot loader in libvirt.
https://libvirt.org/formatdomain.html#elementsOSBIOS
Nova will try to access UEFI boot loader with readonly permission.
This action will cause libvirt have two different operation according to 
content of nvram element.

When nvram element didn't specify template attribute, libvirt will read nvram 
option in qemu config, which is saved in libvirt configuration folder. 
Nvram option will store key-value pair data, key is os boot loader path and 
value is boor loader variable path.

When nvram element had specify template attribute which is path to boot loader 
variable, libvirt will copy the file into libvirt's nvram folder.
Then qemu will boot with boot loader and boot loader variable.

Let me check the xml element for os boot loader.
<os>
    <type arch='x86_64' machine='pc-i440fx-utopic'>hvm</type>
    <loader readonly='yes' type='pflash'>/opt/ovmf/OVMF_CODE.fd</loader>
    <nvram 
template='/opt/ovmf/OVMF_CODE.fd'>/var/lib/libvirt/qemu/nvram/instance-0000002c_VARS.fd</nvram>
    <boot dev='hd'/>
    <smbios mode='sysinfo'/>
  </os>
We can find libvirt will try to copy /opt/ovmf/OVMF_CODE.fd to 
/var/lib/libvirt/qemu/nvram/instance-0000002c_VARS.fd.
Nova had specify wrong value in template attribute, it should be 
/opt/ovmf/OVMF_VARS.fd instead of /opt/ovmf/OVMF_CODE.fd

We can add one uefi_nvram_override, which key is boot loader path and value is 
boot loader variable path.
If boot loader is not exist in this option, just not specify template attribute.
If boot loader is exist in this option, just specify template attribute with 
value.

** Affects: nova
     Importance: Undecided
     Assignee: Chung Chih, Hung (lyanchih)
         Status: New

** Attachment added: "qemu.log"
   https://bugs.launchpad.net/bugs/1574558/+attachment/4646307/+files/qemu.log

** Changed in: nova
     Assignee: (unassigned) => Chung Chih, Hung (lyanchih)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1574558

Title:
  UEFI - instance terminates after boot

Status in OpenStack Compute (nova):
  New

Bug description:
  Instance terminates after boot.
  Attached file is qemu's instance logs.

  Libvirt needs UEFI os boot loader.
  Following link will show how to configurate os boot loader in libvirt.
  https://libvirt.org/formatdomain.html#elementsOSBIOS
  Nova will try to access UEFI boot loader with readonly permission.
  This action will cause libvirt have two different operation according to 
content of nvram element.

  When nvram element didn't specify template attribute, libvirt will read nvram 
option in qemu config, which is saved in libvirt configuration folder. 
  Nvram option will store key-value pair data, key is os boot loader path and 
value is boor loader variable path.

  When nvram element had specify template attribute which is path to boot 
loader variable, libvirt will copy the file into libvirt's nvram folder.
  Then qemu will boot with boot loader and boot loader variable.

  Let me check the xml element for os boot loader.
  <os>
      <type arch='x86_64' machine='pc-i440fx-utopic'>hvm</type>
      <loader readonly='yes' type='pflash'>/opt/ovmf/OVMF_CODE.fd</loader>
      <nvram 
template='/opt/ovmf/OVMF_CODE.fd'>/var/lib/libvirt/qemu/nvram/instance-0000002c_VARS.fd</nvram>
      <boot dev='hd'/>
      <smbios mode='sysinfo'/>
    </os>
  We can find libvirt will try to copy /opt/ovmf/OVMF_CODE.fd to 
/var/lib/libvirt/qemu/nvram/instance-0000002c_VARS.fd.
  Nova had specify wrong value in template attribute, it should be 
/opt/ovmf/OVMF_VARS.fd instead of /opt/ovmf/OVMF_CODE.fd

  We can add one uefi_nvram_override, which key is boot loader path and value 
is boot loader variable path.
  If boot loader is not exist in this option, just not specify template 
attribute.
  If boot loader is exist in this option, just specify template attribute with 
value.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1574558/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to