INSTANCE=$1
PROJECT=$2

if [ "$2" == "" ] ; then
	echo need to give vm name and project name
	exit 1
fi


ZONE=$(gcloud  --project=miso-cust-ipsec1 compute instances  list |awk '$1=="'$INSTANCE'"{print $2}')
echo ZONE for $1=$ZONE

gcloud compute instances export $INSTANCE \
    --project $PROJECT \
    --zone $ZONE \
    --destination=edit.$$

if [ $? -ne 0 ] ; then
	echo FAILED to pull properites for $INSTANCE
	exit 1
fi

vim edit.$$

gcloud compute instances update-from-file $INSTANCE \
    --project $PROJECT \
    --zone $ZONE \
    --source=edit.$$

rm -f edit.$$
