"Detach" an AWS instance from Vagrant

176 views
Skip to first unread message

Christophe Pettus

unread,
Jul 25, 2013, 10:32:19 PM7/25/13
to vagra...@googlegroups.com
Hi,

I've started to use Vagrant to provision real live production machines, but I live in fear that I will issue a vagrant destroy in the wrong directory. Is there a standard way of "detaching" an instance from a VagrantFile instance so that it can go about its business and I can provision anew... or is there a better way to handle this particular situation?

Thanks!
--
-- Christophe Pettus
x...@thebuild.com

Mike Ryan

unread,
Jul 26, 2013, 7:52:40 AM7/26/13
to vagra...@googlegroups.com
Hi Christophe,

Deleting the .vagrant/machines/default/aws/id file might do what you are looking for - once you do that, vagrant status will show 'not created' and you should be able to provision a new instance. This feels a bit hacky though, there might be a cleaner solution.

It is possible to protect instances from being terminated via the API - this won't let you provision new machines from the same Vagrantfile, but it will render vagrant destroy harmless if you do run it in the wrong dir.

Torben Knerr

unread,
Jul 27, 2013, 2:58:57 AM7/27/13
to vagra...@googlegroups.com


On Jul 26, 2013 5:19 PM, "Mike Ryan" <mi...@fadedink.co.uk> wrote:
>
> Hi Christophe,
>
> Deleting the .vagrant/machines/default/aws/id file might do what you are looking for - once you do that, vagrant status will show 'not created' and you should be able to provision a new instance. This feels a bit hacky though, there might be a cleaner solution.
>
> It is possible to protect instances from being terminated via the API - this won't let you provision new machines from the same Vagrantfile, but it will render vagrant destroy harmless if you do run it in the wrong dir.
>
> http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_ChangingDisableAPITermination.html

Is this option exposed via the vagrant-aws provider?

>
> Mike
>
>
>
> On Friday, July 26, 2013 4:32:19 AM UTC+2, Christophe Pettus wrote:
>>
>> Hi,
>>
>> I've started to use Vagrant to provision real live production machines, but I live in fear that I will issue a vagrant destroy in the wrong directory.  Is there a standard way of "detaching" an instance from a VagrantFile instance so that it can go about its business and I can provision anew... or is there a better way to handle this particular situation?
>>
>> Thanks!
>> --
>> -- Christophe Pettus
>>    x...@thebuild.com
>>

> --
> You received this message because you are subscribed to the Google Groups "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

Mike Ryan

unread,
Jul 27, 2013, 4:25:45 AM7/27/13
to vagra...@googlegroups.com
No, presently it needs to be done through the EC2 API or Web Console. This might be a useful future addition:

vagrant protect-instance
vagrant unprotect-instance

... or something similar.
July 27, 2013 8:58 AM
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/6uOBhj_wSD4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
July 26, 2013 1:52 PM
Hi Christophe,

Deleting the .vagrant/machines/default/aws/id file might do what you are looking for - once you do that, vagrant status will show 'not created' and you should be able to provision a new instance. This feels a bit hacky though, there might be a cleaner solution.

It is possible to protect instances from being terminated via the API - this won't let you provision new machines from the same Vagrantfile, but it will render vagrant destroy harmless if you do run it in the wrong dir.

Mike



On Friday, July 26, 2013 4:32:19 AM UTC+2, Christophe Pettus wrote:
--
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/6uOBhj_wSD4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages