proxmox-management/delete_organisation
2023-10-26 16:45:29 +02:00

28 lines
522 B
Bash
Executable file

#!/bin/sh
set -e
ORGA=$1
usage() {
printf "usage: %s <organisation_name>\n" $0
}
# check if we where correctly called
[ $# != 1 ] && usage && exit 1
# remove storage from storage pool
pveum pool modify "${ORGA}" --storage "${ORGA}-images" --delete
# remove proxmox storage object
pvesm remove "${ORGA}-images"
# nuke zfs filesystem with isos and backups
zfs destroy rpool/customer/${ORGA}-images
# delete resource pool for the organisation
pveum pool delete "${ORGA}"
# delete group
pveum group delete "${ORGA}"