Applicable to:
- SolusVM 2
Symptoms
OSTEMPLATE directive value is left empty in VZ VPS config after creation in SolusVM 2
Cause
SolusVM 2 bug with ID #SVM2-468 which will be fixed in future SolusVM 2 updates.
Resolution
As a workaround:
- Connect to OpenVZ Compute Resource via SSH
- Create a directory for hook scripts:
# mkdir -p /usr/local/solus/hooks
- Create a script file and set execution permission to it:
# touch /usr/local/solus/hooks/hook.sh
# chmod +x /usr/local/solus/hooks/hook.sh - Add the following content into the script:
CONFIG_TEXT: #!/bin/bash -x
tfile=$(mktemp /tmp/foo.XXXXXXXXX)
cat /dev/stdin >"$tfile"
trap 'rm -f $tfile' EXIT
if [ false = "$(jq -j '[contains({action: "server-create", stage: "post"})]|any' <"$tfile")" ]; then
exit 0
fi
UUID=`jq -j '.data.uuid' <"$tfile"`
OSTEMPLATE=`jq -j '.data.os_template' <"$tfile"`
sleep 5
vzctl set $UUID --ostemplate $OSTEMPLATE --save
Comments
0 commentsPlease sign in to leave a comment.