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 am creating a droplet like this :
new_droplet=$(curl -X POST “https://api.digitalocean.com/v2/droplets”
-d’{“name”:“laminarghost”,“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”)
after extracting some item from the JSON I am using the following to move a folder and substructure to the droplet:
tar -vczf - * | ssh -o StrictHostKeyChecking=accept-new root@${new_droplet_ip} tar -xzf - -C /opt/
it starts listing files and then stops. 30 percent of the time it announces that the key has been added to known hosts. and proceeds through the rest of the script
the rest of the time it returns ssh: connect to host IP address here port 22: Connection refused tar: -: Wrote only 4096 of 10240 bytes tar: Child returned status 141 tar: Error is not recoverable: exiting now
the ssh takes (15 seconds? ish )to respond, I suspect sometimes it’s longer and times out?
comments and suggestions appreciated
ebeecroft
Noor Ellis
384d3f11289345379905a243f7b817
IsaacMvd
Ervan Agus
Teckno
dc1bce8262314f84b368813178d9e4
gerard
gerard
Stan Flint