Add cpu core count

This commit is contained in:
thorstenspille 2023-10-07 15:09:15 +02:00
parent 862929cd51
commit c51d2a91ff
2 changed files with 8 additions and 1 deletions

View File

@ -27,6 +27,9 @@ LXC_SHAREFS_STORAGE="local-zfs"
# Defines the mountpoint of the filesystem shared by Zamba inside your LXC container (default: tank) # Defines the mountpoint of the filesystem shared by Zamba inside your LXC container (default: tank)
LXC_SHAREFS_MOUNTPOINT="tank" LXC_SHAREFS_MOUNTPOINT="tank"
# cpu core count (default: 0 = unlimited)
LXC_THREADS=0
# Defines the amount of RAM in MB your LXC container is allowed to use (default: 1024) # Defines the amount of RAM in MB your LXC container is allowed to use (default: 1024)
LXC_MEM=1024 LXC_MEM=1024

View File

@ -130,9 +130,13 @@ else
fi fi
echo "Will now create LXC Container $LXC_NBR!"; echo "Will now create LXC Container $LXC_NBR!";
if [ $LXC_THREADS -gt 0 ]; then
LXC_CORES=--cores$LXC_THREADS
fi
# Create the container # Create the container
set +u set +u
pct create $LXC_NBR $TAGS --password $LXC_PWD -unprivileged $LXC_UNPRIVILEGED $LXC_TEMPLATE_STORAGE:vztmpl/$TMPL_NAME -rootfs $LXC_ROOTFS_STORAGE:$LXC_ROOTFS_SIZE; pct create $LXC_NBR $TAGS $LXC_CORES --password $LXC_PWD -unprivileged $LXC_UNPRIVILEGED $LXC_TEMPLATE_STORAGE:vztmpl/$TMPL_NAME -rootfs $LXC_ROOTFS_STORAGE:$LXC_ROOTFS_SIZE;
set -u set -u
sleep 2; sleep 2;