3 # ovirt-config-uninstall - destroys an installed copy of the oVirt node
6 # Destroys the HostVG volume group and logical volumes.
9 .
/usr
/libexec
/ovirt-functions
12 warn
() { printf '%s: %s\n' "$ME" "$*" >&2; }
13 die
() { warn
"$*"; exit 1; }
15 trap '__st=$?; stop_log; exit $__st' 0
16 trap 'exit $?' 1 2 13 15
19 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
21 !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !!
23 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
25 If you proceed, you will DESTROY any existing data relating to the oVirt
26 installation on this machine.
30 if ask_yes_or_no
"Do you wish to continue and uninstall this node ([Y]es/[N]o)?"; then
31 if vgs
--noheadings HostVG
-o vg_name
>/dev
/null
2>&1; then
32 log
"Uninstalling node"
33 log
"Detaching logging"
35 # multipathd holds all mounts under /var in a private namespace
36 service multipathd stop
6>&- 7>&-
37 rm -f /var
/lib
/multipath
/bindings
39 unmount_config
/etc
/default
/ovirt
40 # remove rootfs labels
41 for label
in Root RootBackup RootUpdate RootNew
; do
42 root
="$(findfs LABEL=$label 2>/dev/null)"
46 rm -f /dev
/disk
/by-label
/$label
48 log
"Removing volume groups"
49 wipe_volume_group HostVG
50 wipe_volume_group AppVG
51 #log "Removing partitions"
52 #wipe_partitions "$pv_dev"
53 #wipe_partitions "$root_dev"
54 #wipe_partitions "$root2_dev"
59 service multipathd start
6>&- 7>&-
60 log
"Finished uninstalling node."
63 log
"There is no installed node instance to remove."