cloud-machine icon indicating copy to clipboard operation
cloud-machine copied to clipboard

Load EBS by ID if it exists, else Create

Open vitorarins opened this issue 9 years ago • 8 comments

Right now we load and attach an EBS disk if a specific ID is passed. It would be nice if we could detect when that volume ID does not exist and then Create a new volume with the specified configuration.

vitorarins avatar Nov 12 '15 19:11 vitorarins

Maybe, it's important to user knows if volume ID doens't exists... For example, if you always have a volume ready, you want always specify the volume ID, and if you specify a wrong, or invalid ID it will be created even you don't want. I'm not sure, but that can be a flag (inside of yml) or a command line flag (like -force), in this case you can control both case, what do you think?

guilherme-santos avatar Nov 16 '15 16:11 guilherme-santos

@guilherme-santos "warning message" for this case would not be sufficient ?

lborguetti avatar Nov 16 '15 16:11 lborguetti

I agree with the idea of having the flag inside the .yml file, only because the warning message would not stop the unwanted volume creation, right?

vitorarins avatar Nov 16 '15 17:11 vitorarins

@vitorarins yes, I think that too, warning will not stop the creating, and the volume will be created, since it was wrong!

guilherme-santos avatar Nov 16 '15 20:11 guilherme-santos

Another idea would be to stop execution and ask a question to the user instead of just a warning. But I am not sure that's a good solution. @lborguetti what do you think?

vitorarins avatar Nov 17 '15 00:11 vitorarins

The problem with this approch is because you have to decide before execute cloud-machine what you want to do, because we cannot rollback secure, if we stop and ask to user, maybe some machine already be created, and you have to decide if you want to create or load by new Id. For that, I don't know if is a good way...

guilherme-santos avatar Nov 17 '15 10:11 guilherme-santos

Now, I understand the problem with "warning message" ... I agree with the idea of the flag inside the .yml file too.

@vitorarins I think interaction with user never is a good way, because it breaks full automation

lborguetti avatar Nov 17 '15 11:11 lborguetti

Agreed!

vitorarins avatar Nov 17 '15 13:11 vitorarins