3 # ovirt-config-uninstall - destroys an installed copy of the oVirt node
6 # Destroys the HostVG volume group and logical volumes.
9 .
/etc
/init.d
/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 [ -d /dev
/HostVG
]; then
32 log
"Uninstalling node"
33 log
"Detaching logging"
35 log
"Removing volume group"
36 wipe_volume_group
"HostVG"
37 partition
=$
(findfs LABEL
=BOOT
)
38 if [ -n "$partition" ]; then
39 log
"Unmounting boot partition"
41 log
"Removing partitions"
42 drive
=$
(echo $partition |
awk '{ print substr($0, 1, length($0) - 1) }')
43 parted
-s $drive "rm 1"
44 parted
-s $drive "rm 2"
45 parted
-s $drive "rm 3"
46 parted
-s $drive "rm 4"
48 printf "Finished uninstalling node."
50 log
"There is no installed node instance to remove."