reproman icon indicating copy to clipboard operation
reproman copied to clipboard

create -t aws-ec2 which fails should remove the key it generated

Open yarikoptic opened this issue 5 years ago • 1 comments

Otherwise it requires to breed more of them for no good reason.

(git)lena:~/proj/repronim/reproman-master[master]git
$> reproman create -t aws-ec2 my-nitrc-west-2 -b region_name=us-west-2 image=ami-080483fe6f1382eab instance_type=t2.medium
You did not specify an EC2 SSH key-pair name to use when creating your EC2
environment.
Please enter a unique name to create a new key-pair or press [enter] to exit: my-nitrc-west-2

2019-11-14 14:57:47,251 [INFO   ] Created private key file /home/yoh/.local/share/reproman/ec2_keys/my-nitrc-west-2.pem 
2019-11-14 14:57:47,708 [ERROR  ] An error occurred (InvalidAMIID.NotFound) when calling the RunInstances operation: The image id '[ami-080483fe6f1382eab]' does not exist [client.py:_make_api_call:661] (ClientError) 


$> reproman create -t aws-ec2 my-nitrc-west-2 -b region_name=us-west-2 image=ami-087678aa4e2b9469a instance_type=t2.medium                  
You did not specify an EC2 SSH key-pair name to use when creating your EC2
environment.
Please enter a unique name to create a new key-pair or press [enter] to exit: my-nitrc-west-2

That key name exists already, try again: my-nitrc-west-2+

2019-11-14 15:02:57,871 [INFO   ] Created private key file /home/yoh/.local/share/reproman/ec2_keys/my-nitrc-west-2+.pem 
2019-11-14 15:02:58,241 [ERROR  ] An error occurred (InvalidAMIID.NotFound) when calling the RunInstances operation: The image id '[ami-087678aa4e2b9469a]' does not exist [client.py:_make_api_call:661] (ClientError)

relates to #298, #285 in that we need to improve handling and management of those keys

yarikoptic avatar Nov 14 '19 20:11 yarikoptic

additionally confusingly reproman claims that key exists whenever (physically) it doesn't (I rmed it):

(git)lena:~/proj/repronim/reproman-master[master]
$> reproman create -t aws-ec2 my-debian-west-2 -b region_name=us-west-2 image=ami-06a216b1ced835440 instance_type=t2.medium
You did not specify an EC2 SSH key-pair name to use when creating your EC2
environment.
Please enter a unique name to create a new key-pair or press [enter] to exit: my-debian-west-2

That key name exists already, try again: 

yarikoptic avatar Nov 14 '19 21:11 yarikoptic