Skip to content

Commit

Permalink
destroy_virtual_hardware.sh needs to unmount backing filesystems (#4255)
Browse files Browse the repository at this point in the history
The backing filesystems added in d624bce prevent the
destroy_virtual_hardware.sh script from properly cleaning up all ZFS
pools and cause the fmd service to go into maintenance which delays
control plane startup. This updates the script to unwind the backing
datasets as part of its work.
  • Loading branch information
citrus-it authored Oct 11, 2023
1 parent 194889b commit a972c80
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tools/destroy_virtual_hardware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,23 @@ function remove_softnpu_zone {
--ports sc0_1,tfportqsfp0_0
}

# Some services have their working data overlaid by backing mounts from the
# internal boot disk. Before we can destroy the ZFS pools, we need to unmount
# these.

BACKED_SERVICES="svc:/system/fmd:default"

function demount_backingfs {
svcadm disable -st $BACKED_SERVICES
zpool list -Hpo name | grep '^oxi_' \
| xargs -i zfs list -Hpo name,canmount,mounted -r {}/backing \
| awk '$3 == "yes" && $2 == "noauto" { print $1 }' \
| xargs -l zfs umount
svcadm enable -st $BACKED_SERVICES
}

verify_omicron_uninstalled
demount_backingfs
unload_xde_driver
remove_softnpu_zone
try_remove_vnics
Expand Down

0 comments on commit a972c80

Please sign in to comment.