
#!/bin/sh
# File	: set_space-gar.sh
# By	: Maarten.deBoer@Atos.net, 2016-10-27
# Subject	: Script to set space-guarantee
PGM="`basename $0`"
VER="0.1"
TMP="/tmp/${PGM}.$$"
LOG="${HOME}/log/${PGM}.log"

CLUSTER="nlnaf100"
PREFIX="nlnaf"

echo "`date` ${PGM} v${VER} started."|tee -a ${LOG}

ssh -n ${CLUSTER} 'df -A -g n03a0601'

ssh -n ${CLUSTER} 'volume show -vserver nlnafsctc08 -aggr n03a0601 -state online'|grep ${PREFIX}|awk '{print $1,$2}'|while read VSERVER VOLUME
do
  echo "${VSERVER} ${VOLUME}"
#  ssh -n ${CLUSTER} "volume show -vserver ${VSERVER} -volume ${VOLUME} -field space-guarantee"|grep ${PREFIX}|tee -a ${LOG}
#  ssh -n ${CLUSTER} "volume online -vserver ${VSERVER} -volume ${VOLUME} "
  ssh -n ${CLUSTER} "volume show -vserver ${VSERVER} -volume ${VOLUME} -field space-guarantee"|grep ${PREFIX}|tee -a ${LOG}
#  ssh -n ${CLUSTER} "volume modify -vserver ${VSERVER} -volume ${VOLUME} -space-guarantee none"
  ssh -n ${CLUSTER} "volume modify -vserver ${VSERVER} -volume ${VOLUME} -space-guarantee volume"
#  ssh -n ${CLUSTER} "volume offline -vserver ${VSERVER} -volume ${VOLUME} "




done



echo "`date` ${PGM} v${VER} finished."|tee -a ${LOG}

exit

