WS-based serial port proxy prevents access to console log file

Bug #1776481 reported by Georg Hoesch
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Georg Hoesch

Bug Description

This bug occurs with interactive WS-based serial ports in nova. The serial
console on the Websocket works fine, but configuring these consoles
prevents access to the console logfile via 'openstack console log show'.
This bug was discovered in pike with KVM-based virtualization but seems to
be in current master as well.

Access to the console logfile is very important because my websocket
client is usually not permanently connected.

Detailed analysis:
The console logfile is still generated by KVM/libvirt. The only difference
is that the path of the logfile node changed in the XML information for
the instance. The relevant function get_console_output() in
nova/virt/libvirt/driver.py fails to find the logfile (it just looks for
@type='file', it should also look for @type='tcp').

I'll try to provide a fix for this myself, it shouldn't be complicated.

Any comments?

Georg Hoesch (hoesch)
description: updated
Changed in nova:
assignee: nobody → Georg Hoesch (hoesch)
Georg Hoesch (hoesch)
description: updated
tags: added: console
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/575735

Changed in nova:
status: New → In Progress
melanie witt (melwitt)
tags: added: libvirt
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/575735
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=600ba8b8686d2c9ff48927f3af63ecbf53ef1847
Submitter: Zuul
Branch: master

commit 600ba8b8686d2c9ff48927f3af63ecbf53ef1847
Author: Georg Hoesch <email address hidden>
Date: Fri Jun 15 14:52:35 2018 +0200

    refactor get_console_output() for console logfiles

    Refactor/simplify libvirt get_console_output() to allow integration
    of other console types from the hosts XML description

    completely restructure get_console_output():
    - make common code flow visible,
      including output and exceptions
    - simplify selection of console sources with one extensible struct
    - common checks for each error type (console not found/file not found)
    - extract pty-specific code

    functional changes:
    - none

    side effects:
    - Existence of pty-type consoles is now explicitly checked by the code and
      returns the same 'console logfile for instance does not exist' message
      as the filebased console. Before, this case most likely triggered some
      obscure logmessage from readpty(). API-functionality is unchanged by
      this, both old and new code return an empty string.

    Closes-Bug: #1776481
    Change-Id: I3eac592f938a8d4ba813df535070e99b3130e863

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
Georg Hoesch (hoesch) wrote :

Groundwork done, bug still open, actual fix is in progress.

Changed in nova:
status: Fix Released → 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/624974

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

Reviewed: https://review.openstack.org/624974
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=5aaa7da32559d2fea8e0d901779d0d736bc810e2
Submitter: Zuul
Branch: master

commit 5aaa7da32559d2fea8e0d901779d0d736bc810e2
Author: Georg Hoesch <email address hidden>
Date: Thu Dec 13 12:27:51 2018 +0000

    allow tcp-based consoles in get_console_output

    Tcp based consoles already offer a logfile but the information
    resides in a different path in the hosts XML. This change adds
    an additional xpath for tcp-based consoles.

    Closes-Bug: #1776481
    Change-Id: I9bfd14c72b1e891cb67562f6a07ceea916c3ed65

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 19.0.0.0rc1

This issue was fixed in the openstack/nova 19.0.0.0rc1 release candidate.

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.