Skip to content

Commit

Permalink
image-update: fail upgrades if there is a local storage domain on /
Browse files Browse the repository at this point in the history
Local storage should be on a separate filesystem. If it's on /
(/data, for example, without an LV), bomb out inside %pre and warn
users.

Change-Id: I5516eafabe497222b377b05bfc96056395391035
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1549630
Signed-off-by: Ryan Barry <rbarry@redhat.com>
  • Loading branch information
Ryan Barry committed Mar 1, 2018
1 parent 31a0aed commit a46150d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packaging/ovirt-node-ng.spec.in
Expand Up @@ -102,6 +102,19 @@ install -Dm 0755 scripts/nodectl-run-banner.sh %{buildroot}%{_sysconfdir}/profil
/usr/bin/install -m 644 %{SOURCE1} %{buildroot}/%{_node_image_file}
/usr/bin/install -m 644 %{SOURCE2} %{buildroot}/%{_node_image_dir}/product.img

%pre image-update
local_sds=($(find / -xdev -name "__DIRECT_IO_TEST__"))

if [ "$local_sds" ]; then
echo "Local storage domains were found on the same filesystem as / ! Please migrate the data to a new LV before upgrading, or you will lose the VMs"
echo "See: https://bugzilla.redhat.com/show_bug.cgi?id=1550205#c3"
echo "Storage domains were found in:"
for sd in "${local_sds[@]}"; do
echo -e "\t$(dirname $sd)"
done
exit 1
fi

%post image-update
set -e
# Some magic to ensure that imgbase from
Expand Down

0 comments on commit a46150d

Please sign in to comment.