-
Notifications
You must be signed in to change notification settings - Fork 572
Support Spot Instances #32
Comments
could be nice, but spot instances might be killed at any moment, good for fault tolerant tasks |
I have this on my mind as well. Not for development per se, but as a way to spin up a temporary big box at low cost without all this I'd be willing to take a stab at implementation but I need to learn a bit more about Vagrant's architecture. In particular, it would be preferable to me to specify the price limit and instance type on the command line, but I don't know if providers can specify their own command line options. |
I think this would be perfect for Vagrant-style development where creating a dev environment can be "cheap" I'd love to look into this. |
I looked into spot instance requests, they are extremely slow (5 to 10 minutes sometimes). I have a prototype implementation which records a spot request id in the data_dir. I don't know if that is the correct approach. Maybe the simplest would be to implement separate commands for that. |
Oh great! I was going to look into this later this week because it's something I really want: an easier interface for one-off spot instances to do big crunching. Can you throw your code up into a branch on your fork? |
@tralamazza Bumpity bump! Do you think you'll keep going with yours? |
👍 |
|
Thanks! I'll take a look when I get some time. Are you still working on it? |
I have a working version here. # ...
aws.region_config "eu-west-1" do |region|
# ...
region.spot_instance = true
region.spot_max_price = "0.2"
end
Note: these are one-off spot requests. |
+1 @mitchellh Do you have a plan to merge this feature from the @tralamazza 's branch? |
👍 |
Anyone tried this patch? Any feedback? |
@tralamazza I tried your changes and it works well. I fixed a minor problem at nabeken@86ff6b6 A parallel acceptance test with a combination of vagrant-aws + spot instance + Jenkins dramatically accelerates the tests and also keeps down costs:satisfied: |
@nabeken nice! thanks. |
Vagrant + Spot instances would be great! |
I would like to get it |
Implementing it will be very useful. |
👍 |
Building on the work @nabeken did, I've merged in the latest changes from master at varju@0bb9f27 |
I'd love for this to get merged. It's incredibly useful and will save me a lot of money! 👍 |
rebased on current 0.5.0 with original work at mitchellh#32
FYI: I've rebased spot instance support on current master at https://github.com/nabeken/vagrant-aws/tree/spot-3 |
This would be useful for me too. |
👍 |
oh yes please 👍 |
+1 |
👍 Would be an awesome feature. In the meantime, I'm going to check out @nabeken's implementation. |
👍 any ETA for release? |
👍 for merging this |
Rebased onto current master at https://github.com/KariusDx/vagrant-aws/tree/spot |
If I could vote more than +1 this I would |
any ETA when this will be in master? |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
There have been outstanding PRs for this feature for over a year. @mitchellh - What can the user community do to help get this accepted and released in the main branch? |
@mitchellh It would be nice to have this feature. |
@mitchellh Any plans? |
There were issues with EBS settings not being passed through, and tagging wasn't working either. The tagging is more of a fog limitation, but I've added code to tag the server after its up to solve that one. Created a pull request for https://github.com/KariusDx/vagrant-aws/tree/spot aswell |
+1 |
2 similar comments
+1 |
+1 |
@rtyler could you assist with this PR? |
Is there any development on this request? Pulled the spot_instances branch just to find that it was a stalled branch with broken features. Spot request would be a great addition to the aws plugin |
@mblanche Not sure if this helps you: I made a fork with some fixes to get it working. See here: https://github.com/jhedev/vagrant-aws/tree/spot (branch |
Hi @jhedev I just forked your repo and I'm trying to install the plugin with spot support. Unfortunately, I got this error: Unable to resolve dependency: user requested 'vagrant-aws (= 0.7.2.spot)'.
Can you help me, please? |
Hmm... I just tried your commands on a fresh copy of the repo and it works fine for me... I have to admit I'm not an ruby expert so not sure what's going on. Was the Maybe you can try uninstall any previously installed version of the |
Hi @jhedev Thanks very much for your help! Should be something wrong in my configuration, if you can install the plugin following these steps... I had already uninstalled the previous one before installing this new version, but it looks like vagrant is trying to reinstall the remote version. I thing it needs some work to find out what's going on. Thanks! |
Hi @mitchellh Any chance to have it supported? |
I have created new Gem vagrant-aws-mkubenka with spot instances support (#514). Installation instructions: vagrant plugin uninstall vagrant-aws
vagrant plugin install vagrant-aws-mkubenka --plugin-version "0.7.2.pre.14" |
@mkubenka - Is there any reason 'vagrant reload' is disallowed from your plugin? I tried to do so to reboot the host, but I get the following error. /.vagrant.d/gems/2.2.5/gems/excon-0.58.0/lib/excon/middlewares/expects.rb:7:in `response_call': UnsupportedOperation => The instance 'i-014c10ea90810dacc' is a spot instance and may not be stopped. (Fog::Compute::AWS::Error) However, looking at AWS documentation on the same at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-spot-instances-work.html Note that you can't stop and start an Amazon EBS-backed instance if it is a Spot instance, but you can reboot or terminate it. I have the need to be able to reboot an AWS spot instance. Could you please let me know how I can achieve this? |
@harmanbirdi - One of the caveats to choosing to use spot instances is the fact that you can't stop the server - it has 2 states, running or destroyed. I'm not sure if the API allows a proper reboot, but traditionally Vagrant uses a combination of stop and start. You could try As a rule of thumb, try to only host code on a Spot Instance that can be wiped at any time without losing your data. (This should be the case with all types of cloud instance really, but we all know that its never as black and white as that in the real world!) Don't forget that another caveat to a spot instance is that if the cost of your instance spikes above what you've said that you're prepared to pay, Amazon will reclaim your instance, destroying it in the process anyway. |
@3vcloud - I should have mentioned that I was able to successfully reboot spot instance from AWS UI. I did not try to do so via an API yet though. What I am looking for is the capability for vagrant reload to be able to reboot the spot instance because according to AWS documentation, it is possible to do so. I am aware of the limitations of spot instances, but still need to be able to reboot it via vagrant using reload. I think there are three states - running (up), terminated (destroy), reboot (reload). I have put vagrant equivalents in parenthesis. UPDATE - I was able to just successfully reboot the spot instance using command line as well. $ vagrant ssh ws-1 ubuntu@ip-10-128-168-173:~$ date Fri Sep 1 07:13:25 UTC 2017 ubuntu@ip-10-128-168-173:~$ uptime 07:13:31 up 2 min, 1 user, load average: 1.35, 0.58, 0.22 ubuntu@ip-10-128-168-173:~$ sudo shutdown -r now Broadcast message from ubuntu@ip-10-128-168-173 (/dev/pts/0) at 7:15 ... The system is going down for reboot NOW! ubuntu@ip-10-128-168-173:~$ Connection to ec2-54-176-132-208.us-west-1.compute.amazonaws.com closed by remote host. Connection to ec2-54-176-132-208.us-west-1.compute.amazonaws.com closed. $ vagrant ssh ws-1 ubuntu@ip-10-128-168-173:~$ uptime 07:16:54 up 1 min, 1 user, load average: 1.55, 0.49, 0.17 ubuntu@ip-10-128-168-173:~$ |
@3vcloud @harmanbirdi Spot instances can now be stopped, if EBS backed (which most are, nowadays). This feature was released publicly just last month, see here. |
@kadrach thanks for the clarification, I've been on the road since last year and didn't read up on the change |
Testing costs could be lowered from 3 cents an hour to .003 cents an hour.
Edited to remove development from issue, tralamazza has a point
The text was updated successfully, but these errors were encountered: