From 18dbe5996062fd03182a67bfd06141bea233705e Mon Sep 17 00:00:00 2001 From: Dan Radez Date: Thu, 24 Aug 2017 14:47:30 -0400 Subject: Updates to create_vm for aarch64 - serial console was being duplicated in libvirt xml template - force undercloud VM arch to jumphost arch - assign diskbus to scsi for aarch64 Change-Id: I5208883c2001497fc7e958f9ffcdf14f0be5f600 Signed-off-by: Dan Radez --- apex/virtual/configure_vm.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'apex/virtual') diff --git a/apex/virtual/configure_vm.py b/apex/virtual/configure_vm.py index 3af7d1e8..3b2c4462 100755 --- a/apex/virtual/configure_vm.py +++ b/apex/virtual/configure_vm.py @@ -11,6 +11,7 @@ import libvirt import logging import math import os +import platform import random MAX_NUM_MACS = math.trunc(0xff / 2) @@ -92,9 +93,9 @@ def create_vm_storage(domain, vol_path='/var/lib/libvirt/images'): def create_vm(name, image, diskbus='sata', baremetal_interfaces=['admin'], - arch='x86_64', engine='kvm', memory=8192, bootdev='network', - cpus=4, nic_driver='virtio', macs=[], direct_boot=None, - kernel_args=None, default_network=False, + arch=platform.machine(), engine='kvm', memory=8192, + bootdev='network', cpus=4, nic_driver='virtio', macs=[], + direct_boot=None, kernel_args=None, default_network=False, template_dir='/usr/share/opnfv-apex'): # TODO(trozet): fix name here to be image since it is full path of qcow2 create_vm_storage(name) @@ -117,6 +118,9 @@ def create_vm(name, image, diskbus='sata', baremetal_interfaces=['admin'], 'user_interface': '', } + # assign scsi as default for aarch64 + if arch == 'aarch64' and diskbus == 'sata': + diskbus = 'scsi' # Configure the bus type for the target disk device params['diskbus'] = diskbus nicparams = { @@ -149,14 +153,6 @@ def create_vm(name, image, diskbus='sata', baremetal_interfaces=['admin'], """ % bm_interface_params - params['enable_serial_console'] = """ - - - - - - - """ if direct_boot: params['direct_boot'] = """ /var/lib/libvirt/images/%(direct_boot)s.vmlinuz @@ -168,7 +164,6 @@ def create_vm(name, image, diskbus='sata', baremetal_interfaces=['admin'], """ % ' '.join(kernel_args) if arch == 'aarch64': - params['direct_boot'] += """ /usr/share/AAVMF/AAVMF_CODE.fd @@ -190,6 +185,14 @@ def create_vm(name, image, diskbus='sata', baremetal_interfaces=['admin'], """ else: + params['enable_serial_console'] = """ + + + + + + + """ params['user_interface'] = """ -- cgit 1.2.3-korg