aboutsummaryrefslogtreecommitdiffstats
path: root/patches/fuel-library/multiarch-fuel
diff options
context:
space:
mode:
Diffstat (limited to 'patches/fuel-library/multiarch-fuel')
-rw-r--r--patches/fuel-library/multiarch-fuel/0001-Make-qemu-kvm-architecture-aware.patch37
-rw-r--r--patches/fuel-library/multiarch-fuel/0002-Make-TestVM-creation-architecture-aware.patch139
-rw-r--r--patches/fuel-library/multiarch-fuel/0003-build_image.pp-Extract-cluster_arch-from-URI.patch61
3 files changed, 0 insertions, 237 deletions
diff --git a/patches/fuel-library/multiarch-fuel/0001-Make-qemu-kvm-architecture-aware.patch b/patches/fuel-library/multiarch-fuel/0001-Make-qemu-kvm-architecture-aware.patch
deleted file mode 100644
index c5d3479a..00000000
--- a/patches/fuel-library/multiarch-fuel/0001-Make-qemu-kvm-architecture-aware.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-: Copyright (c) 2017 Enea AB, Cavium 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: Stanislaw Kardach <stanislaw.kardach@cavium.com>
-Date: Wed, 24 Feb 2016 20:07:06 +0100
-Subject: [PATCH] Make qemu-kvm architecture aware
-
----
- deployment/puppet/openstack_tasks/manifests/roles/compute.pp | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/deployment/puppet/openstack_tasks/manifests/roles/compute.pp b/deployment/puppet/openstack_tasks/manifests/roles/compute.pp
-index 3fcfb51..c53409c 100644
---- a/deployment/puppet/openstack_tasks/manifests/roles/compute.pp
-+++ b/deployment/puppet/openstack_tasks/manifests/roles/compute.pp
-@@ -167,9 +167,14 @@ class openstack_tasks::roles::compute {
- case $::osfamily {
- 'RedHat': {
- # From legacy libvirt.pp
-+ # Guard against some exotic distros with their `uname -m`
-+ $arch = $::architecture ? {
-+ /(arm64|aarch64)/ => 'aarch64',
-+ default => 'x86_64',
-+ }
- exec { 'symlink-qemu-kvm':
-- command => '/bin/ln -sf /usr/libexec/qemu-kvm /usr/bin/qemu-system-x86_64',
-- creates => '/usr/bin/qemu-system-x86_64',
-+ command => "/bin/ln -sf /usr/libexec/qemu-kvm /usr/bin/qemu-system-${arch}",
-+ creates => "/usr/bin/qemu-system-${arch}",
- }
-
- package { 'avahi':
diff --git a/patches/fuel-library/multiarch-fuel/0002-Make-TestVM-creation-architecture-aware.patch b/patches/fuel-library/multiarch-fuel/0002-Make-TestVM-creation-architecture-aware.patch
deleted file mode 100644
index 1f4c05f2..00000000
--- a/patches/fuel-library/multiarch-fuel/0002-Make-TestVM-creation-architecture-aware.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-: Copyright (c) 2017 Enea AB, Cavium 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: Stanislaw Kardach <stanislaw.kardach@cavium.com>
-Date: Wed, 24 Feb 2016 20:08:24 +0100
-Subject: [PATCH] Make TestVM creation architecture aware
-
-This depends on cirros-testvm package to contain both amd64 and arm64
-images.
----
- deployment/puppet/openstack/manifests/img/cirros.pp | 8 ++++++--
- .../osnailyfacter/manifests/generate_vms/vm_config.pp | 11 +++++++++++
- deployment/puppet/osnailyfacter/templates/vm_libvirt.erb | 15 ++++++++++++++-
- files/fuel-migrate/fuel-migrate | 5 ++++-
- 4 files changed, 35 insertions(+), 4 deletions(-)
-
-diff --git a/deployment/puppet/openstack/manifests/img/cirros.pp b/deployment/puppet/openstack/manifests/img/cirros.pp
-index 84e202e..cff06e0 100644
---- a/deployment/puppet/openstack/manifests/img/cirros.pp
-+++ b/deployment/puppet/openstack/manifests/img/cirros.pp
-@@ -9,6 +9,10 @@ class openstack::img::cirros (
- $img_name = 'cirros',
- $os_name = 'cirros',
- ) {
-+ $arch = $::architecture ? {
-+ /(arm64|aarch64)/ => 'aarch64',
-+ default => 'x86_64',
-+ }
-
- package { 'cirros-testvm':
- ensure => "present"
-@@ -17,14 +21,14 @@ class openstack::img::cirros (
- case $::osfamily {
- 'RedHat': {
- exec { 'upload-img':
-- command => "/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} add name=${img_name} is_public=${public} container_format=${container_format} disk_format=${disk_format} distro=${os_name} < /opt/vm/cirros-x86_64-disk.img",
-+ command => "/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} add name=${img_name} is_public=${public} container_format=${container_format} disk_format=${disk_format} distro=${os_name} < /opt/vm/cirros-${arch}-disk.img",
- unless => "/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} index && (/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} index | grep ${img_name})",
-
- }
- }
- 'Debian': {
- exec { 'upload-img':
-- command => "/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} add name=${img_name} is_public=${public} container_format=${container_format} disk_format=${disk_format} distro=${os_name} < /usr/share/cirros-testvm/cirros-x86_64-disk.img",
-+ command => "/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} add name=${img_name} is_public=${public} container_format=${container_format} disk_format=${disk_format} distro=${os_name} < /usr/share/cirros-testvm/cirros-${arch}-disk.img",
- unless => "/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} index && (/usr/bin/glance -N ${os_auth_url} -T ${os_tenant_name} -I ${os_username} -K ${os_password} index | grep ${img_name})",
-
- }
-diff --git a/deployment/puppet/osnailyfacter/manifests/generate_vms/vm_config.pp b/deployment/puppet/osnailyfacter/manifests/generate_vms/vm_config.pp
-index 70fef32..dfefcbe 100644
---- a/deployment/puppet/osnailyfacter/manifests/generate_vms/vm_config.pp
-+++ b/deployment/puppet/osnailyfacter/manifests/generate_vms/vm_config.pp
-@@ -4,6 +4,17 @@ define osnailyfacter::generate_vms::vm_config(
- $details,
- $template_dir = '/var/lib/nova',
- ) {
-+ case $::architecture {
-+ 'arm64', 'aarch64': {
-+ $machine_arch = 'aarch64'
-+ $machine_type = 'virt-2.6'
-+ }
-+ default: {
-+ $machine_arch = 'x86_64'
-+ $machine_type = 'pc'
-+ }
-+ }
-+
- file { "${template_dir}/template_${name}_vm.xml":
- owner => 'root',
- group => 'root',
-diff --git a/deployment/puppet/osnailyfacter/templates/vm_libvirt.erb b/deployment/puppet/osnailyfacter/templates/vm_libvirt.erb
-index ae2ba5b..64e716d 100644
---- a/deployment/puppet/osnailyfacter/templates/vm_libvirt.erb
-+++ b/deployment/puppet/osnailyfacter/templates/vm_libvirt.erb
-@@ -3,14 +3,17 @@
- <memory unit='GiB'><%= @details['mem'] %></memory>
- <vcpu placement='static'><%= @details['cpu'] %></vcpu>
- <os>
-- <type arch='x86_64' machine='pc'>hvm</type>
-+ <type arch='<%= @machine_arch %>' machine='<%= @machine_type %>'>hvm</type>
- <boot dev='network'/>
- <boot dev='hd'/>
- </os>
- <features>
- <acpi/>
- <apic/>
- <pae/>
-+ <% if $machine_arch == 'aarch64' %>
-+ <gic version='host' />
-+ <% end %>
- </features>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
-@@ -57,7 +66,11 @@
- <input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
- <video>
-+<% if $machine_arch == 'aarch64' %>
-+ <model type='vga' vram='9216' heads='1'/>
-+<% else %>
- <model type='cirrus' vram='9216' heads='1'/>
-+<% end %>
- </video>
- <memballoon model='virtio'>
- </memballoon>
-diff --git a/files/fuel-migrate/fuel-migrate b/files/fuel-migrate/fuel-migrate
-index a215e0a..7d5b6cd 100755
---- a/files/fuel-migrate/fuel-migrate
-+++ b/files/fuel-migrate/fuel-migrate
-@@ -176,6 +176,8 @@ create_vm(){
- exit 1
- fi
- fi
-+ # figure out atchitecture of the destination
-+ arch="$(virsh -c "${dkvm_uri}" nodeinfo | awk '/CPU model:/ { print $3}')"
- # create disk
- ssh "${dkvm_ip}" qemu-img create -f raw "${dkvm_folder}/${fvm_name}.img" "${fvm_disk_size}"
- # make template for virsh
-@@ -185,13 +187,14 @@ create_vm(){
- <memory unit='MiB'>${fvm_ram}</memory>
- <vcpu >${fvm_cpu}</vcpu>
- <os>
-- <type arch='x86_64' >hvm</type>
-+ <type arch='${arch}' >hvm</type>
- <boot dev='hd'/>
- <boot dev='network'/>
- </os>
- <features>
- <acpi/>
- <apic/>
-+ ${arch/aarch64/<gic version='3'\/>}
- </features>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
diff --git a/patches/fuel-library/multiarch-fuel/0003-build_image.pp-Extract-cluster_arch-from-URI.patch b/patches/fuel-library/multiarch-fuel/0003-build_image.pp-Extract-cluster_arch-from-URI.patch
deleted file mode 100644
index 2311442b..00000000
--- a/patches/fuel-library/multiarch-fuel/0003-build_image.pp-Extract-cluster_arch-from-URI.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-: 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: Wed, 15 Mar 2017 23:44:32 +0100
-Subject: [PATCH] build_image.pp: Extract cluster_arch from "/" URI
-
-Since target image building was moved from nailgun to puppet, we
-need to determine the "target_arch" value differently.
-
-One way to go is to extract it from the root disk image URI, which
-is constructed based on static fixture data in nailgun.
-
-This change relies on the following:
-- image_data contains "/", with a properly arch-qualified URI;
-- image_data "/" URI arch uses the same format as "target_arch"
- (in this case "arm64" instead of "aarch64" or other variations);
-
-While at it, increase task timeout from 1800s to 3600s.
-
-NOTE: Unlike the previous approach, this method does not rely on any
-other nailgun changes (i.e. adding the "arch" field to the database
-model), but only on `fa_build_image --target_arch=...` support.
-
-JIRA: https://jira.opnfv.org/browse/ARMBAND-240
-
-Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
----
- deployment/puppet/osnailyfacter/manifests/provision/build_image.pp | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
-
-diff --git a/deployment/puppet/osnailyfacter/manifests/provision/build_image.pp b/deployment/puppet/osnailyfacter/manifests/provision/build_image.pp
-index dbfc785..8525e33 100644
---- a/deployment/puppet/osnailyfacter/manifests/provision/build_image.pp
-+++ b/deployment/puppet/osnailyfacter/manifests/provision/build_image.pp
-@@ -8,6 +8,9 @@ class osnailyfacter::provision::build_image(
- $data = loadyaml($data_file)
- }
- $cluster_id = $data['cluster']['id']
-+ $root_img_uri_split = split($data['image_data']['/']['uri'], '_')
-+ $root_img_suffix_split = split($root_img_uri_split[-1], '[.]')
-+ $cluster_arch = $root_img_suffix_split[0]
-
- if $data['ironic']['enabled'] == true {
- # TODO(vsaienko): Use the same system packages for fuel image and ironic bootstrap, but exclude
-@@ -52,8 +55,8 @@ class osnailyfacter::provision::build_image(
- $extra_params = '--data_driver nailgun_build_image'
-
- exec { 'generate_image_with_fuel':
-- command => "fa_build_image ${build_dir} ${log_params} ${extra_params} --input_data_file ${data_file}",
-+ command => "fa_build_image ${build_dir} ${log_params} ${extra_params} --target_arch=${cluster_arch} --input_data_file ${data_file}",
- path => ['/bin', '/usr/bin'],
-- timeout => 1800,
-+ timeout => 3600,
- }
- }