I think that you should change $CTID to $VEID
in all your custom scripts. Probably the naming scheme has changed
with vzctl versions newer than 3.0.22 from VE to CT.
This is what i've setup
#!/bin/bash
CONFIGFILE=/etc/vz/conf/$VEID.conf
. $CONFIGFILE
VZHOSTIF=`echo $NETIF |sed 's/^.*host_ifname=\(.*\),.*$/\1/g'`
if [ ! -n "$VZHOSTIF" ]; then
echo "According to $CONFIGFILE VE$VEID has no veth interface configured."
exit 1
fi
if [ ! -n "$BRIDGEDEV" ]; then
echo "According to $CONFIGFILE VE$VEID veth interface is not enslaved to any bridge."
exit 1
fi
ifconfig veth${VEID}.0 0
brctl addif ${BRIDGEDEV} veth${VEID}.0
exit $?