libvirt error when adding the os_command_line on non ami images

Bug #1300861 reported by Vladan Popovic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Vladan Popovic

Bug Description

qemu fails when booting an instance with the os_command_line on non ami images

----------------------------------------------------------------------------

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 1066, in _build_instance
    set_access_ip=set_access_ip)
  File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 360, in decorated_function
    return function(self, context, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 1476, in _spawn
    LOG.exception(_('Instance failed to spawn'), instance=instance)
  File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 68, in __exit__
    six.reraise(self.type_, self.value, self.tb)
  File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 1473, in _spawn
    block_device_info)
  File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 2237, in spawn
    block_device_info)
  File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 3572, in _create_domain_and_network
    domain = self._create_domain(xml, instance=instance, power_on=power_on)
  File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 3513, in _create_domain
    domain.XMLDesc(0))
  File "/usr/lib/python2.6/site-packages/nova/openstack/common/excutils.py", line 68, in __exit__
    six.reraise(self.type_, self.value, self.tb)
  File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 3508, in _create_domain
    domain.createWithFlags(launch_flags)
  File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 187, in doit
    result = proxy_call(self._autowrap, f, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 147, in proxy_call
    rv = execute(f,*args,**kwargs)
  File "/usr/lib/python2.6/site-packages/eventlet/tpool.py", line 76, in tworker
    rv = meth(*args,**kwargs)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 708, in createWithFlags
    if ret == -1: raise libvirtError ('virDomainCreateWithFlags() failed', dom=self)
libvirtError: internal error Process exited while reading console log output: char device redirected to /dev/pts/5
-append only allowed with -kernel option

----------------------------------------------------------------------------

Is this the correct behaviour or should the instance be booted with a log warning that the os_command_line isn't considered since it only applies to ami images in qemu?

The easiest and least painful solution I could think of is to move the code in the kernel_id check, but I don't know how that would affect other hypervisors. Any comments by people with greater experience with the other hypervisors are more than welcome.

Tags: libvirt
Revision history for this message
Stephen Gordon (sgordon) wrote :

It's worth noting that neither the original blueprint [1] or the commit message for the patch [2] that added this functionality mention any restrictions around image type, though the behaviour is understandable it should have been noted for documentation etc.

[1] https://blueprints.launchpad.net/nova/+spec/enable-libvirt-driver-to-read-kernel-command-line-from-glance-image
[2] https://review.openstack.org/#/c/65028/

Allison Randal (allison)
tags: added: libvirt
Solly Ross (sross-7)
Changed in nova:
importance: Undecided → Medium
status: New → Incomplete
status: Incomplete → Confirmed
Changed in nova:
assignee: nobody → Vladan Popovic (vpopovic)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/87329

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/87329
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=c6a6003a99c27c920ead194d5df6051800e8a9b4
Submitter: Jenkins
Branch: master

commit c6a6003a99c27c920ead194d5df6051800e8a9b4
Author: Vladan Popovic <email address hidden>
Date: Mon Apr 14 13:04:13 2014 -0400

    libvirt: Use os_command_line when kernel_id is set

    Patch Iad53c687053bdb5469baad4331ea55f428c170b0 breaks libvirt with
    "-append only allowed with -kernel option" when using images without an
    explicit boot kernel set because the -kernel option (kernel_id in nova)
    isn't supplied for those image types.

    This patch reads the os_command_line property from the image metadata
    only when using images with an explicit boot kernel set and ignores it
    otherwise.

    Closes-bug: 1300861

    Change-Id: I06c2d9930e0f36a0d7057b6a0f5c9c591caac43f

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → juno-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-2 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.