Merge "[Devstack]Add ability to enable ironic node pty console"

This commit is contained in:
Jenkins 2016-03-01 06:56:54 +00:00 committed by Gerrit Code Review
commit a51a7c2ea0
3 changed files with 17 additions and 12 deletions

View File

@ -372,13 +372,10 @@ 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"
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
fi
# When booting with less than 1GB, we need to switch from default tmpfs
# to ramfs for ramdisks to decompress successfully.

View File

@ -41,6 +41,16 @@ CONSOLE_LOG = """
"""
CONSOLE_PTY = """
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
"""
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'] = "<bios useserial='yes'/>"
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")

View File

@ -6,7 +6,7 @@
<type arch='%(arch)s' machine='pc-1.0'>hvm</type>
<boot dev='%(bootdev)s'/>
<bootmenu enable='no'/>
%(bios_serial)s
<bios useserial='yes'/>
</os>
<features>
<acpi/>
@ -40,7 +40,7 @@
<model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
%(console_log)s
%(console)s
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</memballoon>