aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/salt-formulas/salt-formula-armband
diff options
context:
space:
mode:
Diffstat (limited to 'mcp/salt-formulas/salt-formula-armband')
-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
6 files changed, 93 insertions, 0 deletions
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 %}