console logging does not work for OL instances on xen compute

Bug #1728924 reported by James McCarthy
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Undecided
Unassigned

Bug Description

Testing with pike on an OVM 3.4.4 xen compute node, Oracle Linux instances do not have working console logging in horizon. (on kvm compute, they are fine)

Note: The OL 7.3 image used to create these instances is marked with --property vm_mode=hvm

On kvm the relevant configuration is similar to this:
    <serial type='file'>
      <source path='/var/lib/nova/instances/210817e9-9579-425d-a1f6-366c64826bc8/console.log'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <serial type='pty'>
      <source path='/dev/pts/11'/>
      <target port='1'/>
      <alias name='serial1'/>
    </serial>
    <console type='file'>
      <source path='/var/lib/nova/instances/210817e9-9579-425d-a1f6-366c64826bc8/console.log'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>

By making experimental changes (adding in "xen") to the create_console method in https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L4569

    def _create_consoles(self, virt_type, guest_cfg, instance, flavor,
                         image_meta):
        # NOTE(markus_z): Beware! Below are so many conditionals that it is
        # easy to lose track. Use this chart to figure out your case:
        #
        # case | is serial | has | is qemu | resulting
        # | enabled? | virtlogd? | or kvm? | devices
        # --------------------------------------------------
        # 1 | no | no | no | pty*
        # 2 | no | no | yes | file + pty
        # 3 | no | yes | no | see case 1
        # 4 | no | yes | yes | pty with logd
        # 5 | yes | no | no | see case 1
        # 6 | yes | no | yes | tcp + pty
        # 7 | yes | yes | no | see case 1
        # 8 | yes | yes | yes | tcp with logd
        # * exception: virt_type "parallels" doesn't create a device
        if virt_type == 'parallels':
            pass
        elif virt_type not in ("qemu", "kvm", "xen"):
            log_path = self._get_console_log_path(instance)
            self._create_pty_device(guest_cfg,
                                    vconfig.LibvirtConfigGuestConsole,
                                    log_path=log_path)
        elif (virt_type in ("qemu", "kvm") and
                  self._is_s390x_guest(image_meta)):
            self._create_consoles_s390x(guest_cfg, instance,
                                        flavor, image_meta)
        elif virt_type in ("qemu", "kvm", "xen"):
            self._create_consoles_qemu_kvm(guest_cfg, instance,
                                        flavor, image_meta)

This allows for the creation of similar configuration on xen, which then looks to allow the console logging to work correctly.

The instance also had a modified /etc/default/grub, like so:
...
GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"

I do not know if this works correctly in all cases, a more complete test matrix may be needed here.

Matt Riedemann (mriedem)
tags: added: console libvirt xen
Changed in nova:
status: New → Confirmed
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.