From 24955b21255f1e94fb022ddff61a7971514ac4d5 Mon Sep 17 00:00:00 2001 From: Zhenguo Niu Date: Fri, 11 Dec 2015 15:50:26 +0800 Subject: [PATCH] [Devstack]Add ability to enable ironic node pty console Make it possible to enable pty console, so that we can test shellinabox console with the vm, but in order to not affect the gate logs, we need to keep the log console by default. Related-bug: #1526305 Change-Id: I9cb13c85fe1b5d596582dbe15bbd9adf98b03140 --- devstack/lib/ironic | 9 +++------ devstack/tools/ironic/scripts/configure-vm.py | 16 ++++++++++++---- devstack/tools/ironic/templates/vm.xml | 4 ++-- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/devstack/lib/ironic b/devstack/lib/ironic index 172048b860..f66aa8b094 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -359,12 +359,9 @@ function configure_ironic_conductor { iniset $IRONIC_CONF_FILE pxe tftp_root $IRONIC_TFTPBOOT_DIR iniset $IRONIC_CONF_FILE pxe tftp_master_path $IRONIC_TFTPBOOT_DIR/master_images - local pxe_params="" - if [[ "$IRONIC_VM_LOG_CONSOLE" == "True" ]] ; then - pxe_params+="nofb nomodeset vga=normal console=ttyS0" - if is_deployed_with_ipa_ramdisk; then - pxe_params+=" systemd.journald.forward_to_console=yes" - fi + local pxe_params="nofb nomodeset vga=normal console=ttyS0" + if is_deployed_with_ipa_ramdisk; then + pxe_params+=" systemd.journald.forward_to_console=yes" fi # When booting with less than 1GB, we need to switch from default tmpfs # to ramfs for ramdisks to decompress successfully. diff --git a/devstack/tools/ironic/scripts/configure-vm.py b/devstack/tools/ironic/scripts/configure-vm.py index 2d5a9adf17..3bf8ebeb74 100755 --- a/devstack/tools/ironic/scripts/configure-vm.py +++ b/devstack/tools/ironic/scripts/configure-vm.py @@ -41,6 +41,16 @@ CONSOLE_LOG = """ """ +CONSOLE_PTY = """ + + + + + + +""" + + def main(): parser = argparse.ArgumentParser( description="Configure a kvm virtual machine for the seed image.") @@ -91,11 +101,9 @@ def main(): params['emulator'] = "/usr/bin/qemu-kvm" if args.console_log: - params['bios_serial'] = "" - params['console_log'] = CONSOLE_LOG % {'console_log': args.console_log} + params['console'] = CONSOLE_LOG % {'console_log': args.console_log} else: - params['bios_serial'] = '' - params['console_log'] = '' + params['console'] = CONSOLE_PTY libvirt_template = source_template % params conn = libvirt.open("qemu:///system") diff --git a/devstack/tools/ironic/templates/vm.xml b/devstack/tools/ironic/templates/vm.xml index ae7d685256..0131e15929 100644 --- a/devstack/tools/ironic/templates/vm.xml +++ b/devstack/tools/ironic/templates/vm.xml @@ -6,7 +6,7 @@ hvm - %(bios_serial)s + @@ -40,7 +40,7 @@
- %(console_log)s + %(console)s