janeczku / docker-machine-vultr

:m: Docker Machine driver for Vultr Cloud
MIT License
192 stars 25 forks source link

Docker machine fails to create multiple servers at the same time #26

Closed AnTuanHa closed 7 years ago

AnTuanHa commented 7 years ago

Hi, I'm trying to simultaneously create multiple Vultr servers using docker-machine at the same time, but I get the following error:

(testmachine2) Validating Vultr VPS parameters...
Running pre-create checks...
(testmachine1) Validating Vultr VPS parameters...
Creating machine...
Creating machine...
(testmachine1) Creating Vultr VPS
(testmachine2) Creating Vultr VPS
(testmachine2) Waiting for IP address to become available...
Error creating machine: Error in driver during machine creation: Post https://api.vultr.com/v1/server/create?api_key=API_KEY: http: ContentLength=176 with Body length 0
(testmachine2) Created Vultr VPS ID: XXXXXXX, Public IP: XX.XX.XXX.XXX, Private IP: 
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...

I ran the following bash script

docker-machine create --driver vultr \
    --vultr-api-key API_KEY \
    --vultr-region-id=19 \
    --vultr-plan-id=201 \
    --vultr-os-id=215 \
    --vultr-private-networking=false \
    --vultr-backups=false \
    --vultr-ssh-user=root \
    --vultr-ipv6=false \
    testmachine1 &
docker-machine create --driver vultr \
    --vultr-api-key API_KEY \
    --vultr-region-id=19 \
    --vultr-plan-id=201 \
    --vultr-os-id=215 \
    --vultr-private-networking=false \
    --vultr-backups=false \
    --vultr-ssh-user=root \
    --vultr-ipv6=false \
    testmachine2 &

Could this be related to issue #12 regarding Vultr's API rate limit to 2 requests per second? It seems that v1.0.7 has implemented retry logic for API rate limit errors, but I'm not entirely sure if it's working, or if this problem is related to the API rate limit problem.

janeczku commented 7 years ago

Thanks for the report @zero57. Submitted a fix in the upstream library.

samgurtman-zz commented 7 years ago

Now that it's merged upstream what are the chances of getting a new build based off a snapshot?

AnTuanHa commented 7 years ago

@janeczku Any updates?

janeczku commented 7 years ago

@zero57 I'll cut a new release by the end of the week.

tja commented 7 years ago

@janeczku Any news on this one? Thanks for your work!

janeczku commented 7 years ago

Fixed in v1.4.0 https://github.com/janeczku/docker-machine-vultr/releases/tag/v1.4.0. Sorry for the delay 😅