Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I have a script that starts a droplet and runs through till everything is installed.
I am checking for a response on SSH to decide if the server is ready to start loading software.
new_droplet=$(curl -X POST "https://api.digitalocean.com/v2/droplets" \
-d'{"name":"jeffsproject","region":"nyc3","size":"s-1vcpu-2gb","image":"ubuntu-18-04-x64","ssh_keys":['$SSH_ID'],"user_data":null}' \
-H "Authorization: Bearer $DO_TOKEN" \
-H "Content-Type: application/json")
echo " Create new droplet"
set -xv
new_droplet_id=$(echo $new_droplet | jq .droplet.id)
while [[ ${new_droplet_id} == "null" ]] ; do
sleep 10
new_droplet_id=$(echo $new_droplet | jq .droplet.id)
echo "droplet failed"
done
echo $new_droplet_id | jq .
while [[ ${droplet_status} != "active" ]] ; do
sleep 10
new_droplet_details=$(curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $DO_TOKEN" "https://api.digitalocean.com/v2/droplets/${new_droplet_id}")
new_droplet_ip=$(echo $new_droplet_details | jq -r .droplet.networks.v4[1].ip_address)
droplet_status=$(echo $new_droplet_details | jq -r .droplet.status)
export DROPLET_IP=$new_droplet_ip
done
while [[ $ssh_ready != 0 ]] ;
do
sleep 5
ssh_ready=$(ssh -vvv -o BatchMode=yes -o StrictHostKeyChecking=no -o ConnectTimeout=5 root@$new_droplet_ip echo '0')
echo "Trying again..."
echo $ssh_ready
done
its pretty basic stuff. My token and ssh ID are in my environment
++ ssh -vvv -o BatchMode=yes -o StrictHostKeyChecking=no -o ConnectTimeout=5 root@10.132.1.224 echo 0
OpenSSH_7.6p1 Ubuntu-4ubuntu0.5, OpenSSL 1.0.2n 7 Dec 2017
debug1: Reading configuration data /home/jeff/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "10.132.1.224" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 10.132.1.224 [10.132.1.224] port 22.
debug2: fd 3 setting O_NONBLOCK
debug1: connect to address 10.132.1.224 port 22: Connection timed out
ssh: connect to host 10.132.1.224 port 22: Connection timed out
+ ssh_ready=
+ echo 'Trying again...'
Trying again...
+ echo
+ [[ '' != 0 ]]
+ sleep 5
++ ssh -vvv -o BatchMode=yes -o StrictHostKeyChecking=no -o ConnectTimeout=5 root@10.132.1.224 echo 0
OpenSSH_7.6p1 Ubuntu-4ubuntu0.5, OpenSSL 1.0.2n 7 Dec 2017
debug1: Reading configuration data /home/jeff/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "10.132.1.224" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 10.132.1.224 [10.132.1.224] port 22.
debug2: fd 3 setting O_NONBLOCK
I have also tried to SSH in as root and it times out.
any ideas appreciated
jhonnydepp12
dolphinnn
Vaishnavi Vundyala
016512ea60864da0867e5280f293de
Peter Monadjemi
Prince7hakur
devjk1
fc9acbfbc3124cbf8df28a1c5c5cdb
ab871885551143798f41908c709271
gouskova
Saivion Services