summaryrefslogtreecommitdiffstats
path: root/mcp
diff options
context:
space:
mode:
authorGuillermo Herrero <Guillermo.Herrero@enea.com>2017-07-25 00:58:32 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-08-29 01:27:28 +0200
commitb0a8b088bcf73302b5fa4d30c8fad6a1612938d5 (patch)
tree78d97c42ca33efa5cc66598f3a747a4716a6e19e /mcp
parentb56d5f4885d5440f826bdb29da8837447fc22116 (diff)
[salt-formulas] Add & enable armband formula
AArch64 specific formula, mostly tweaking nova conf / installing virtualization layer prerequisites: - install qemu-efi; - install vgabios; - fix missing link for vgabios binary blob; - nova conf: cpu_model=cortex-a57 (only for virtual deploys); - nova conf: virt_type=qemu (only for virtual deploys); - nova compute conf: virt_type=qemu (only for virtual deploys); - nova conf: pointer_model=ps2mouse since AArch64 has no USB tablet; [1] https://github.com/openstack/nova/commit/f0f0953 Change-Id: I40515bdbd941850b103a86d51b347cc8610f5741 Signed-off-by: Guillermo Herrero <Guillermo.Herrero@enea.com> Signed-off-by: Charalampos Kominos <Charalampos.Kominos@enea.com> Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'mcp')
-rwxr-xr-xmcp/config/states/openstack_ha6
-rwxr-xr-xmcp/config/states/openstack_noha4
-rwxr-xr-xmcp/config/states/virtual_control_plane4
-rw-r--r--mcp/salt-formulas/salt-formula-armband/armband/files/nova-libvirt-aarch64-rollup.diff27
-rw-r--r--mcp/salt-formulas/salt-formula-armband/armband/init.sls7
-rw-r--r--mcp/salt-formulas/salt-formula-armband/armband/nova_config.sls37
-rw-r--r--mcp/salt-formulas/salt-formula-armband/armband/nova_libvirt.sls9
-rw-r--r--mcp/salt-formulas/salt-formula-armband/armband/qemu_efi.sls4
-rw-r--r--mcp/salt-formulas/salt-formula-armband/armband/vgabios.sls9
-rwxr-xr-xmcp/scripts/docker-compose/files/entrypoint.sh2
10 files changed, 107 insertions, 2 deletions
diff --git a/mcp/config/states/openstack_ha b/mcp/config/states/openstack_ha
index d7d8cbd45..0f6858f1e 100755
--- a/mcp/config/states/openstack_ha
+++ b/mcp/config/states/openstack_ha
@@ -51,11 +51,15 @@ wait_for 3.0 "salt -I 'cinder:volume' state.sls cinder"
salt -I 'neutron:server' state.sls neutron -b 1
salt -I 'neutron:gateway' state.sls neutron.gateway
if salt 'cmp*' match.pillar 'neutron:compute:backend:engine:ovn' \
- --out yaml --static | grep -q -e "true" ; then
+ --out yaml --static | grep -q -e 'true' ; then
salt -I 'neutron:compute' state.sls neutron.compute
fi
salt -I 'nova:compute' state.sls nova
+if salt -I 'nova:compute' match.grain 'cpuarch:aarch64' \
+ --out yaml --static | grep -q -e 'true' ; then
+ salt -C 'G@cpuarch:aarch64 and I@nova:compute' state.sls armband
+fi
salt -I 'barbican:server' state.sls barbican -b 1
salt -I 'barbican:client' state.sls barbican
diff --git a/mcp/config/states/openstack_noha b/mcp/config/states/openstack_noha
index 9a42d4813..44360e5e9 100755
--- a/mcp/config/states/openstack_noha
+++ b/mcp/config/states/openstack_noha
@@ -45,6 +45,10 @@ salt -I 'neutron:server' state.sls neutron
salt -I 'neutron:compute' state.sls neutron
salt -I 'nova:compute' state.sls nova
+if salt -I 'nova:compute' match.grain 'cpuarch:aarch64' \
+ --out yaml --static | grep -q -e 'true' ; then
+ salt -C 'G@cpuarch:aarch64 and I@nova:compute' state.sls armband
+fi
salt -I 'barbican:server' state.sls barbican
salt -I 'barbican:client' state.sls barbican
diff --git a/mcp/config/states/virtual_control_plane b/mcp/config/states/virtual_control_plane
index 8ea5047ae..4e8d5e573 100755
--- a/mcp/config/states/virtual_control_plane
+++ b/mcp/config/states/virtual_control_plane
@@ -27,6 +27,10 @@ if [ "${ERASE_ENV}" -eq 1 ]; then
fi
# KVM libvirt first, VCP deployment
+if salt -C 'kvm*' match.grain 'cpuarch:aarch64' \
+ --out yaml --static | grep -q -e 'true' ; then
+ wait_for 5.0 "salt -C 'G@cpuarch:aarch64 and kvm*' state.sls armband"
+fi
wait_for 5.0 "salt -C 'kvm*' state.sls libvirt"
salt -C 'kvm* or cmp*' state.apply salt
diff --git a/mcp/salt-formulas/salt-formula-armband/armband/files/nova-libvirt-aarch64-rollup.diff b/mcp/salt-formulas/salt-formula-armband/armband/files/nova-libvirt-aarch64-rollup.diff
new file mode 100644
index 000000000..1ecbf2973
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-armband/armband/files/nova-libvirt-aarch64-rollup.diff
@@ -0,0 +1,27 @@
+From: Charalampos Kominos <Charalampos.Kominos@enea.com>
+Date: Wed, 2 May 2018 14:20:47 +0200
+Subject: [PATCH] Allow libvirt to honor root device naming
+
+Current behaviour in upstream nova is for rootfs to be in /dev/vda
+which is the default behaviour when using virtio driver. However when
+other devices are requested either by glance or by CLI, nova ignores
+that naming and still tries to attach to vda which fails.
+
+Manually applied in https://review.openstack.org/#/c/214314/
+
+JIRA: ARMBAND-376
+
+Signed-off-by: Charalampos Kominos <charalampos.kominos@enea.com>
+---
+
+--- a/nova/virt/libvirt/driver.py
++++ b/nova/virt/libvirt/driver.py
+@@ -8257,6 +8257,8 @@
+ "Ignoring supplied device name: %(device_name)s. "
+ "Libvirt can't honour user-supplied dev names",
+ {'device_name': bdm.device_name}, instance=instance)
++ if instance.root_device_name == bdm.device_name:
++ instance.root_device_name = None
+ bdm.device_name = None
+ block_device_info = driver.get_block_device_info(instance,
+ block_device_mapping)
diff --git a/mcp/salt-formulas/salt-formula-armband/armband/init.sls b/mcp/salt-formulas/salt-formula-armband/armband/init.sls
new file mode 100644
index 000000000..8a8cf2ab1
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-armband/armband/init.sls
@@ -0,0 +1,7 @@
+include:
+ - armband.qemu_efi
+ - armband.vgabios
+ {%- if salt['pkg.version']('python-nova') %}
+ - armband.nova_libvirt
+ - armband.nova_config
+ {%- endif %}
diff --git a/mcp/salt-formulas/salt-formula-armband/armband/nova_config.sls b/mcp/salt-formulas/salt-formula-armband/armband/nova_config.sls
new file mode 100644
index 000000000..b0e17b718
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-armband/armband/nova_config.sls
@@ -0,0 +1,37 @@
+{% if grains['cpuarch'] == 'aarch64' %}
+{% if grains['virtual'] == 'kvm' %}
+nova_virt_type:
+ file.replace:
+ - name: "/etc/nova/nova.conf"
+ - pattern: '^virt_type\s*=.*$'
+ - repl: "virt_type = qemu"
+nova_compute_virt_type:
+ file.replace:
+ - name: "/etc/nova/nova-compute.conf"
+ - pattern: '^virt_type\s*=.*$'
+ - repl: "virt_type = qemu"
+{% endif %}
+nova_pointer_model:
+ file.replace:
+ - name: "/etc/nova/nova.conf"
+ - pattern: '^#pointer_model\s*=.*$'
+ - repl: "pointer_model = ps2mouse"
+nova_cpu_mode:
+ file.replace:
+ - name: "/etc/nova/nova.conf"
+ - pattern: '^cpu_mode\s*=\s*host-passthrough'
+ - repl: "cpu_mode = custom"
+nova_cpu_model:
+ file.replace:
+ - name: "/etc/nova/nova.conf"
+ - pattern: '^#cpu_model\s*=.*$'
+ {% if grains['virtual'] == 'kvm' %}
+ - repl: "cpu_model = cortex-a57"
+ {% else %}
+ - repl: "cpu_model = host"
+ {% endif %}
+restart_nova-compute:
+ cmd:
+ - run
+ - name: "service nova-compute restart"
+{% endif %}
diff --git a/mcp/salt-formulas/salt-formula-armband/armband/nova_libvirt.sls b/mcp/salt-formulas/salt-formula-armband/armband/nova_libvirt.sls
new file mode 100644
index 000000000..9d26e86a4
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-armband/armband/nova_libvirt.sls
@@ -0,0 +1,9 @@
+{% if grains['cpuarch'] == 'aarch64' %}
+nova-libvirt-aarch64-rollup:
+ file.patch:
+ - name: /usr/lib/python2.7/dist-packages
+ - source: salt://armband/files/nova-libvirt-aarch64-rollup.diff
+ - hash: False
+ - options: '-p1'
+ - unless: 'test -f /var/cache/salt/minion/files/base/armband/files/nova-libvirt-aarch64-rollup.diff && cd /usr/lib/python2.7/dist-packages && patch -p1 -R --dry-run -r - < /var/cache/salt/minion/files/base/armband/files/nova-libvirt-aarch64-rollup.diff'
+{% endif %}
diff --git a/mcp/salt-formulas/salt-formula-armband/armband/qemu_efi.sls b/mcp/salt-formulas/salt-formula-armband/armband/qemu_efi.sls
new file mode 100644
index 000000000..aef17f9a8
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-armband/armband/qemu_efi.sls
@@ -0,0 +1,4 @@
+{% if grains['cpuarch'] == 'aarch64' %}
+qemu-efi:
+ pkg.installed
+{% endif %}
diff --git a/mcp/salt-formulas/salt-formula-armband/armband/vgabios.sls b/mcp/salt-formulas/salt-formula-armband/armband/vgabios.sls
new file mode 100644
index 000000000..7f004971c
--- /dev/null
+++ b/mcp/salt-formulas/salt-formula-armband/armband/vgabios.sls
@@ -0,0 +1,9 @@
+{% if grains['cpuarch'] == 'aarch64' %}
+vgabios:
+ pkg.installed
+/usr/share/qemu:
+ file.directory
+/usr/share/qemu/vgabios-stdvga.bin:
+ file.symlink:
+ - target: "/usr/share/vgabios/vgabios.bin"
+{% endif %}
diff --git a/mcp/scripts/docker-compose/files/entrypoint.sh b/mcp/scripts/docker-compose/files/entrypoint.sh
index 53f5c6a23..08c17a2e6 100755
--- a/mcp/scripts/docker-compose/files/entrypoint.sh
+++ b/mcp/scripts/docker-compose/files/entrypoint.sh
@@ -33,7 +33,7 @@ cp -a /root/pod_config.yml \
prefix=/srv/salt/formula/salt-formulas
rm -f /root/fuel/mcp/salt-formulas/*/.git
cp -ar /root/fuel/mcp/salt-formulas/* ${prefix}/
-for formula in 'opendaylight' 'tacker'; do
+for formula in 'armband' 'opendaylight' 'tacker'; do
ln -sf /root/fuel/mcp/salt-formulas/salt-formula-${formula}/* \
/srv/salt/env/prd/
done