proxmox-management/delete_organisation

28 lines
522 B
Text
Raw Normal View History

2023-10-26 16:45:29 +02:00
#!/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}"