initial commit
This commit is contained in:
commit
74412c51a4
9 changed files with 229 additions and 0 deletions
32
create_organisation
Executable file
32
create_organisation
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
ZFS_PARENT_PATH=rpool/customer
|
||||
|
||||
ORGA=$1
|
||||
|
||||
usage() {
|
||||
printf "usage: %s <organisation_name>\n" $0
|
||||
}
|
||||
|
||||
# check if we where correctly called
|
||||
[ $# != 1 ] && usage && exit 1
|
||||
|
||||
# create group for organisation
|
||||
pveum group add "${ORGA}" --comment "group for the organisation '${ORGA}'"
|
||||
|
||||
# create resource pool for the organisation
|
||||
pveum pool add "${ORGA}" --comment "pool for the organisation '${ORGA}'"
|
||||
|
||||
# allow group to access resource pool
|
||||
pveum acl modify "/pool/${ORGA}/" --roles PVEVMUser,PVEDatastoreAdmin,RDNTZVMSnapshot --groups "${ORGA}"
|
||||
|
||||
# create zfs filesystem for isos, backups and stuff
|
||||
zfs create -o quota=150G -p "${ZFS_PARENT_PATH}/${ORGA}-images"
|
||||
|
||||
# create proxmox storage ontop of zfs filesystem
|
||||
pvesm add dir "${ORGA}-images" --path "/${ZFS_PARENT_PATH}/${ORGA}-images" --content vztmpl,iso,backup,backup
|
||||
|
||||
# add storage into storage pool
|
||||
pveum pool modify "${ORGA}" --storage "${ORGA}-images"
|
Loading…
Add table
Add a link
Reference in a new issue