summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apex/deploy.py4
-rw-r--r--apex/overcloud/overcloud_deploy.py2
-rwxr-xr-xapex/virtual/configure_vm.py27
3 files changed, 21 insertions, 12 deletions
diff --git a/apex/deploy.py b/apex/deploy.py
index 7900170b..6866945b 100644
--- a/apex/deploy.py
+++ b/apex/deploy.py
@@ -125,22 +125,26 @@ def create_deploy_parser():
deploy_parser.add_argument('--virtual-computes',
dest='virt_compute_nodes',
default=1,
+ type=int,
help='Number of Virtual Compute nodes to create'
' and use during deployment (defaults to 1'
' for noha and 2 for ha)')
deploy_parser.add_argument('--virtual-cpus',
dest='virt_cpus',
default=4,
+ type=int,
help='Number of CPUs to use per Overcloud VM in'
' a virtual deployment (defaults to 4)')
deploy_parser.add_argument('--virtual-default-ram',
dest='virt_default_ram',
default=8,
+ type=int,
help='Amount of default RAM to use per '
'Overcloud VM in GB (defaults to 8).')
deploy_parser.add_argument('--virtual-compute-ram',
dest='virt_compute_ram',
default=None,
+ type=int,
help='Amount of RAM to use per Overcloud '
'Compute VM in GB (defaults to 8). '
'Overrides --virtual-default-ram arg for '
diff --git a/apex/overcloud/overcloud_deploy.py b/apex/overcloud/overcloud_deploy.py
index 3c108464..5ee2a33d 100644
--- a/apex/overcloud/overcloud_deploy.py
+++ b/apex/overcloud/overcloud_deploy.py
@@ -137,6 +137,8 @@ def create_deploy_cmd(ds, ns, inv, tmp_dir,
logging.error("Detected 0 control or compute nodes. Control nodes: "
"{}, compute nodes{}".format(num_control, num_compute))
raise ApexDeployException("Invalid number of control or computes")
+ elif num_control > 1 and not ds['global_params']['ha_enabled']:
+ num_control = 1
cmd = "openstack overcloud deploy --templates --timeout {} " \
"--libvirt-type kvm".format(con.DEPLOY_TIMEOUT)
# build cmd env args
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'],
<model type='%(nicdriver)s'/>
</interface>""" % bm_interface_params
- params['enable_serial_console'] = """
- <serial type='pty'>
- <target port='0'/>
- </serial>
- <console type='pty'>
- <target type='serial' port='0'/>
- </console>
- """
if direct_boot:
params['direct_boot'] = """
<kernel>/var/lib/libvirt/images/%(direct_boot)s.vmlinuz</kernel>
@@ -168,7 +164,6 @@ def create_vm(name, image, diskbus='sata', baremetal_interfaces=['admin'],
""" % ' '.join(kernel_args)
if arch == 'aarch64':
-
params['direct_boot'] += """
<loader readonly='yes' \
type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
@@ -190,6 +185,14 @@ def create_vm(name, image, diskbus='sata', baremetal_interfaces=['admin'],
</channel>
"""
else:
+ params['enable_serial_console'] = """
+ <serial type='pty'>
+ <target port='0'/>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ """
params['user_interface'] = """
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>