diff options
-rwxr-xr-x | ci/deploy.sh | 4 | ||||
-rw-r--r-- | mcp/patches/0007-linux.network.interface-noifupdown-support.patch | 33 | ||||
-rw-r--r-- | mcp/patches/patches.list | 1 | ||||
-rw-r--r-- | mcp/scripts/lib.sh | 14 |
4 files changed, 11 insertions, 41 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh index c93adc657..1b4dd95c8 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -272,10 +272,10 @@ pushd "${DEPLOY_DIR}" > /dev/null # Install required packages [ -n "$(command -v apt-get)" ] && sudo apt-get install -y \ git make rsync mkisofs curl virtinst cpu-checker qemu-kvm uuid-runtime \ - libvirt-bin cloud-guest-utils e2fsprogs + libvirt-bin cloud-guest-utils e2fsprogs kpartx [ -n "$(command -v yum)" ] && sudo yum install -y --skip-broken \ git make rsync genisoimage curl virt-install qemu-kvm util-linux \ - libvirt cloud-utils-growpart e2fsprogs + libvirt cloud-utils-growpart e2fsprogs kpartx # For baremetal, python is indirectly required for PDF parsing if [ "${DEPLOY_TYPE}" = 'baremetal' ]; then diff --git a/mcp/patches/0007-linux.network.interface-noifupdown-support.patch b/mcp/patches/0007-linux.network.interface-noifupdown-support.patch deleted file mode 100644 index 5539602f5..000000000 --- a/mcp/patches/0007-linux.network.interface-noifupdown-support.patch +++ /dev/null @@ -1,33 +0,0 @@ -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -: Copyright (c) 2017 Mirantis Inc., 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: Sat, 5 Aug 2017 02:03:01 +0200 -Subject: [PATCH] linux.network.interface: noifupdown support - -According to [1], salt states/network supports "noifupdown" as a -parameter for each interface. -Adjust salt formula part for `linux.network.interface`, by extending -the "interface_params" in <linux/map.jinja> accordingly. - -Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com> -Signed-off-by: Charalampos Kominos <Charalampos.Kominos@enea.com> -Signed-off-by: Guillermo Herrero <Guillermo.Herrero@enea.com> ---- - -diff --git a/linux/map.jinja b/linux/map.jinja ---- a/linux/map.jinja -+++ b/linux/map.jinja -@@ -92,6 +92,7 @@ - 'hashing-algorithm', - 'hardware-dma-ring-rx', - 'hwaddr', -+ 'noifupdown', - ] %} - - {% set network = salt['grains.filter_by']({ diff --git a/mcp/patches/patches.list b/mcp/patches/patches.list index d0bb7c431..fcbd3ae88 100644 --- a/mcp/patches/patches.list +++ b/mcp/patches/patches.list @@ -11,7 +11,6 @@ /usr/share/salt-formulas/env: 0004-maas-region-use-authorized_keys-1st-entry.patch /usr/share/salt-formulas/env: 0005-maas-module-Obtain-fabric-ID-from-CIDR.patch /usr/share/salt-formulas/env: 0006-maas-module-Add-VLAN-DHCP-enable-support.patch -/usr/share/salt-formulas/env: 0007-linux.network.interface-noifupdown-support.patch /usr/share/salt-formulas/env: 0008-Handle-file_recv-option.patch /usr/share/salt-formulas/env: 0009-seedng-module-Sync-salt-version.patch /usr/share/salt-formulas/env: 0010-maas-region-allow-timeout-override.patch diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh index 8dd92e1ec..3dee9c51f 100644 --- a/mcp/scripts/lib.sh +++ b/mcp/scripts/lib.sh @@ -49,18 +49,21 @@ function mount_image { fi done OPNFV_LOOP_DEV=$(losetup -f) + OPNFV_MAP_DEV=/dev/mapper/$(basename "${OPNFV_NBD_DEV}")p1 export OPNFV_MNT_DIR OPNFV_LOOP_DEV [ -n "${OPNFV_NBD_DEV}" ] && [ -n "${OPNFV_LOOP_DEV}" ] || exit 1 qemu-img resize "${image_dir}/${image}" 3G sudo qemu-nbd --connect="${OPNFV_NBD_DEV}" --aio=native --cache=none \ "${image_dir}/${image}" - sleep 5 # /dev/nbdNp1 takes some time to come up + sudo kpartx -av "${OPNFV_NBD_DEV}" # Hardcode partition index to 1, unlikely to change for Ubuntu UCA image if sudo growpart "${OPNFV_NBD_DEV}" 1; then - sudo e2fsck -yf "${OPNFV_NBD_DEV}p1" && sudo resize2fs "${OPNFV_NBD_DEV}p1" + sudo kpartx -u "${OPNFV_NBD_DEV}" + sudo e2fsck -yf "${OPNFV_MAP_DEV}" + sudo resize2fs "${OPNFV_MAP_DEV}" fi # grub-update does not like /dev/nbd*, so use a loop device to work around it - sudo losetup "${OPNFV_LOOP_DEV}" "${OPNFV_NBD_DEV}p1" + sudo losetup "${OPNFV_LOOP_DEV}" "${OPNFV_MAP_DEV}" mkdir -p "${OPNFV_MNT_DIR}" sudo mount "${OPNFV_LOOP_DEV}" "${OPNFV_MNT_DIR}" sudo mount -t proc proc "${OPNFV_MNT_DIR}/proc" @@ -141,6 +144,7 @@ function cleanup_mounts { sudo losetup -d "${OPNFV_LOOP_DEV}" fi if [ -n "${OPNFV_NBD_DEV}" ]; then + sudo kpartx -d "${OPNFV_NBD_DEV}" || true sudo qemu-nbd -d "${OPNFV_NBD_DEV}" || true fi } @@ -277,9 +281,9 @@ function update_mcpcontrol_network { local cmac=$(virsh domiflist cfg01 2>&1| awk '/mcpcontrol/ {print $5; exit}') local amac=$(virsh domiflist mas01 2>&1| awk '/mcpcontrol/ {print $5; exit}') virsh net-update "mcpcontrol" add ip-dhcp-host \ - "<host mac='${cmac}' name='cfg01' ip='${SALT_MASTER}'/>" --live + "<host mac='${cmac}' name='cfg01' ip='${SALT_MASTER}'/>" --live --config [ -z "${amac}" ] || virsh net-update "mcpcontrol" add ip-dhcp-host \ - "<host mac='${amac}' name='mas01' ip='${MAAS_IP}'/>" --live + "<host mac='${amac}' name='mas01' ip='${MAAS_IP}'/>" --live --config } function start_vms { |