From b0a8b088bcf73302b5fa4d30c8fad6a1612938d5 Mon Sep 17 00:00:00 2001 From: Guillermo Herrero Date: Tue, 25 Jul 2017 00:58:32 +0200 Subject: [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 Signed-off-by: Charalampos Kominos Signed-off-by: Alexandru Avadanii --- .../armband/files/nova-libvirt-aarch64-rollup.diff | 27 ++++++++++++++++ .../salt-formula-armband/armband/init.sls | 7 ++++ .../salt-formula-armband/armband/nova_config.sls | 37 ++++++++++++++++++++++ .../salt-formula-armband/armband/nova_libvirt.sls | 9 ++++++ .../salt-formula-armband/armband/qemu_efi.sls | 4 +++ .../salt-formula-armband/armband/vgabios.sls | 9 ++++++ 6 files changed, 93 insertions(+) create mode 100644 mcp/salt-formulas/salt-formula-armband/armband/files/nova-libvirt-aarch64-rollup.diff create mode 100644 mcp/salt-formulas/salt-formula-armband/armband/init.sls create mode 100644 mcp/salt-formulas/salt-formula-armband/armband/nova_config.sls create mode 100644 mcp/salt-formulas/salt-formula-armband/armband/nova_libvirt.sls create mode 100644 mcp/salt-formulas/salt-formula-armband/armband/qemu_efi.sls create mode 100644 mcp/salt-formulas/salt-formula-armband/armband/vgabios.sls (limited to 'mcp/salt-formulas') 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 +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 +--- + +--- 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 %} -- cgit 1.2.3-korg