aboutsummaryrefslogtreecommitdiffstats
path: root/patches/opnfv-fuel/0010-mcp-salt-formulas-armband-Extend-libvirt_domain.patch
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-09-11 20:17:20 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-09-11 21:43:00 +0200
commit9519a11e1fe0eb26cf5b776d8479065f2f710737 (patch)
tree984abae9d48cbc1a53612921d344949bfd40b877 /patches/opnfv-fuel/0010-mcp-salt-formulas-armband-Extend-libvirt_domain.patch
parent6ea6921ad4ad2bea138151da0fea02b30d0c839a (diff)
u/fuel: Bump & rebase for multiarch reclass
Change-Id: I3de41645b7424195b9c8d5884a7c9de1fabf68cb Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'patches/opnfv-fuel/0010-mcp-salt-formulas-armband-Extend-libvirt_domain.patch')
-rw-r--r--patches/opnfv-fuel/0010-mcp-salt-formulas-armband-Extend-libvirt_domain.patch105
1 files changed, 105 insertions, 0 deletions
diff --git a/patches/opnfv-fuel/0010-mcp-salt-formulas-armband-Extend-libvirt_domain.patch b/patches/opnfv-fuel/0010-mcp-salt-formulas-armband-Extend-libvirt_domain.patch
new file mode 100644
index 00000000..e421552c
--- /dev/null
+++ b/patches/opnfv-fuel/0010-mcp-salt-formulas-armband-Extend-libvirt_domain.patch
@@ -0,0 +1,105 @@
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+: Copyright (c) 2017 Enea AB and others.
+:
+: All rights reserved. This program and the accompanying materials
+: are made available under the terms of the Apache License, Version 2.0
+: which accompanies this distribution, and is available at
+: http://www.apache.org/licenses/LICENSE-2.0
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Sun, 20 Aug 2017 22:41:26 +0200
+Subject: [PATCH] mcp: salt-formulas: armband: Extend libvirt_domain
+
+Add new state in armband salt formula that extends salt's virt
+libvirt_domain.jinja template with support for:
+- hw_firmware_type;
+- virt_machine_model;
+- cpu_model;
+
+These will later be leveraged via salt virt formula with AArch64
+specific values.
+
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ mcp/config/states/maas | 2 +-
+ .../armband/files/libvirt_domain.jinja.diff | 46 ++++++++++++++++++++++
+ .../armband/libvirt_domain_template.sls | 4 ++
+ 3 files changed, 51 insertions(+), 1 deletion(-)
+ create mode 100644 mcp/salt-formulas/armband/files/libvirt_domain.jinja.diff
+ create mode 100644 mcp/salt-formulas/armband/libvirt_domain_template.sls
+
+diff --git a/mcp/config/states/maas b/mcp/config/states/maas
+index 603b530..f6de2cb 100755
+--- a/mcp/config/states/maas
++++ b/mcp/config/states/maas
+@@ -86,7 +86,7 @@ wait_for 90 "! salt 'kvm*' test.ping | tee /dev/stderr | fgrep -q 'Not connected
+
+ salt -C '* and not cfg01* and not mas01*' state.apply linux,ntp
+
+-salt -C 'kvm*' state.sls armband
++salt -C 'kvm*' state.sls armband,armband.libvirt_domain_template
+ salt -C 'kvm*' state.sls libvirt
+
+ salt -C '* and not cfg01* and not mas01*' state.apply salt
+diff --git a/mcp/salt-formulas/armband/files/libvirt_domain.jinja.diff b/mcp/salt-formulas/armband/files/libvirt_domain.jinja.diff
+new file mode 100644
+index 0000000..4e7fad5
+--- /dev/null
++++ b/mcp/salt-formulas/armband/files/libvirt_domain.jinja.diff
+@@ -0,0 +1,46 @@
++From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
++Date: Sun Aug 20 18:18:53 2017 +0200
++Subject: [PATCH] libvirt_domain.jinja: Add AArch64 support
++
++Salt virt state relies on a Jinja template to create a libvirt
++XML definition for each new VM.
++This template needs to be extended with a few specific options
++for AArch64:
++- UEFI loader support (pflash);
++- custom machine model (e.g. 'virt-2.9'), since AArch64 defaults to
++ 'integratorcp';
++- custom cpu model;
++
++Allow all these to be parametrized from the salt virt formula,
++which we will also adapt to allow the params to be passed via our
++reclass model.
++
++Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
++---
++
++diff --git a/usr/lib/python2.7/dist-packages/salt/templates/virt/libvirt_domain.jinja b/usr/lib/python2.7/dist-packages/salt/templates/virt/libvirt_domain.jinja
++--- a/usr/lib/python2.7/dist-packages/salt/templates/virt/libvirt_domain.jinja
+++++ b/usr/lib/python2.7/dist-packages/salt/templates/virt/libvirt_domain.jinja
++@@ -3,11 +3,22 @@
++ <vcpu>{{ cpu }}</vcpu>
++ <memory unit='KiB'>{{ mem }}</memory>
++ <os>
+++ {% if custom_virt_machine %}
+++ <type machine='{{ virt_machine_model }}'>hvm</type>
+++ {% else %}
++ <type>hvm</type>
+++ {% endif %}
+++ {% if os_loader_type == 'pflash' %}
+++ <loader readonly='yes' type='{{ os_loader_type }}'>{{ os_loader }}</loader>
+++ <nvram>{{ os_loader_nvram }}</nvram>
+++ {% endif %}
++ {% for dev in boot_dev %}
++ <boot dev='{{ dev }}' />
++ {% endfor %}
++ </os>
+++ {% if cpu_mode == 'custom' %}
+++ <cpu mode='{{ cpu_model }}' check='none'/>
+++ {% endif %}
++ <devices>
++ {% for diskname, disk in disks.items() %}
++ <disk type='file' device='disk'>
+diff --git a/mcp/salt-formulas/armband/libvirt_domain_template.sls b/mcp/salt-formulas/armband/libvirt_domain_template.sls
+new file mode 100644
+index 0000000..7cc8e22
+--- /dev/null
++++ b/mcp/salt-formulas/armband/libvirt_domain_template.sls
+@@ -0,0 +1,4 @@
++/usr/lib/python2.7/dist-packages/salt/templates/virt/libvirt_domain.jinja:
++ file.patch:
++ - source: salt://armband/files/libvirt_domain.jinja.diff
++ - hash: "9d02cd8aa04497c2d75c72840a5c6c41"