"docker-machine rm" does not work on a non-existent instance of EC2

I am using a docker machine to manage docker nodes in AWS. Today I tried to create a new node and failed due to incompatibility between the instance type and the specified AMI:

docker-machine create --driver amazonec2 --amazonec2-instance-type t2.micro --amazonec2-ami ami-b4a015d4 certbot-config
Running pre-create checks...
Creating machine...
(certbot-config) Launching instance...
Error creating machine: 
    Error in driver during machine creation: 
    Error launching instance: InvalidParameterCombination: Virtualization type 'hvm' is required for instances of type 't2.micro'. Ensure that you are using an AMI with virtualization type 'hvm'. For more information, see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/virtualization_types.html

Be that as it may, I am correcting the error. My problem is that I seem to have created a ghost machine; if I run docker-machine ls, I get the following:

NAME             ACTIVE   DRIVER      STATE   URL   SWARM   DOCKER    ERRORS
certbot-config   -        amazonec2   Error                 Unknown   MissingParameter: The request must contain the parameter InstanceId
             status code: 400, request id: 

I cannot delete it, kill it, restart it or provide it; each command exits with a 400 error from the AWS driver:

~$ docker-machine rm certbot-config
About to remove certbot-config
Are you sure? (y/n): y
Error removing host "certbot-config": unknown instance
MissingParameter: The request must contain the parameter KeyName
    status code: 400, request id: 

How can I delete this dangling instance? I have many instances working under the docker machine, so I would prefer not to do anything decisive, such as reinstalling.

Edit:

, : -? - , "docker-machine ls", . , , , , , ?

+4
2

, : -?

, MACHINE_STORAGE_PATH.

, VMS ~/.docker.

3555:

- , , , docker-machine , . .

Spot docker-machine 226.

Spot Request Bid, Request valid From/To Persistent request.

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/images/spot_introduction.png

, , request valid to = now + 2 minutes , .

PR, , PR 942 PR 1000.
, docker-machine rm , .

~/.docker/machine/machines EC2 AWS EC2.

+4

, docker-machine rm -f [name] .

, , ( EC2 → Key Pair AWS). .

+2

Source: https://habr.com/ru/post/1664608/


All Articles