From 42f8585ebb8fffad19a89314659ab9129176c3e9 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Sat, 1 Oct 2016 13:18:11 +0200 Subject: build: Rework patch mechanism for Fuel submodules While refactoring the patching mechanism, take care of: - Sync submodule handling with Fuel@OPFNV; - build: Investigate/prepare for moving patches to Fuel@OPNFV; - build: Investigate divergent fuel-mirror; - ISO build: cacheid for Fuel comps should not depend on Armband git commit; CHANGE: Rename/shuffle patches while grouping them in "features", preparing for upstreaming them to Fuel@OPNFV and beyond. CHANGE: Allow linking patches for better representing the dependency between one patch and different features. e.g. 0001-Add-arch-to-nailgun-release-and-target-image.patch: - part of `multiarch-fuel`, because it extends Fuel; - part of `direct-kernel-boot`, as arch is required for that; - part of `cross-bootstrap`, target image is arch-dependent; NOTE: Patch links are not staged to Fuel@OPNFV, they only serve as markers that a specific patch is part of a feature. CHANGE: Kill all Fuel component submodules, now handled in Fuel@OPNFV: - fuel-agent - fuel-astute - fuel-library - fuel-mirror - fuel-nailgun-agent - fuel-web CHANGE: Move armband-fuel-config.mk to armband git root. FIXME: m1.micro-Increase-profile-RAM-size-to-128MB.patch is NOT part of `cross-bootstrap` feature, but patch context says so ... FIXME: 0001-Add-arm64-deb-repositories-setup.patch is broken at `make patches-export` by removing spaces at EOL. v2 -> v3: * Phony patch support (links to show a patch belongs to a feature); * Updated README.md v3 -> v7: * Re-export Fuel submodules & plugins patches (update patch context); * Update Cavium mail addresses (s/caviumnetworks.com/cavium.com/); * Ignore submodule changes; * Add armband git repo info to gitinfo_fuel.txt at build time; Implements: ARMBAND-136 Closes-bug: ARMBAND-95 Closes-bug: ARMBAND-93 Closes-bug: ARMBAND-92 Change-Id: I1a236d9f43b2e6dca22055911f696b43c22b5973 Signed-off-by: Alexandru Avadanii --- .../0001-Make-qemu-kvm-architecture-aware.patch | 29 +++++ ...2-Make-TestVM-creation-architecture-aware.patch | 137 +++++++++++++++++++++ 2 files changed, 166 insertions(+) create mode 100644 patches/fuel-library/multiarch-fuel/0001-Make-qemu-kvm-architecture-aware.patch create mode 100644 patches/fuel-library/multiarch-fuel/0002-Make-TestVM-creation-architecture-aware.patch (limited to 'patches/fuel-library/multiarch-fuel') 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 new file mode 100644 index 00000000..ef1b8554 --- /dev/null +++ b/patches/fuel-library/multiarch-fuel/0001-Make-qemu-kvm-architecture-aware.patch @@ -0,0 +1,29 @@ +From: Stanislaw Kardach +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 new file mode 100644 index 00000000..325b51d4 --- /dev/null +++ b/patches/fuel-library/multiarch-fuel/0002-Make-TestVM-creation-architecture-aware.patch @@ -0,0 +1,137 @@ +From: Stanislaw Kardach +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 = $name + $id = $details['id'] + ++ case $::architecture { ++ 'arm64', 'aarch64': { ++ $machine_arch = 'aarch64' ++ $machine_type = 'virt' ++ } ++ default: { ++ $machine_arch = 'x86_64' ++ $machine_type = 'pc-i440fx-trusty' ++ } ++ } ++ + file { "${template_dir}/template_${id}_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,23 @@ + <%= @details['mem'] %> + <%= @details['cpu'] %> + +- hvm ++ hvm ++ <% if == 'aarch64' %> ++ /var/lib/nova/<%= @details['id'] %>_vm.kernel ++ /var/lib/nova/<%= @details['id'] %>_vm.initramfs ++ root=/dev/vda1 rw rootwait console=tty0 console=ttyS0 console=ttyAMA0 ++ <% else %> + + ++ <% end %> + + + + + ++ <% if $machine_arch == 'aarch64' %> ++ ++ <% end %> + + + destroy +@@ -57,7 +66,11 @@ + + + + + +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(){ + ${fvm_ram} + ${fvm_cpu} + +- hvm ++ hvm + + + + + + ++ ${arch/aarch64/} + + + destroy -- cgit 1.2.3-korg