Merge pull request #2845 from abridgett/feature/spot_price_zero

spot_price of "0" to mean on demand
This commit is contained in:
Mark Peek 2015-10-26 21:51:44 -07:00
commit 4e1e9b788a
4 changed files with 6 additions and 4 deletions

View file

@ -136,7 +136,7 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
var instanceId string
if spotPrice == "" {
if spotPrice == "" || spotPrice == "0" {
runOpts := &ec2.RunInstancesInput{
KeyName: &keyName,
ImageId: &s.SourceAMI,

View file

@ -19,7 +19,7 @@ func (s *stepStopInstance) Run(state multistep.StateBag) multistep.StepAction {
ui := state.Get("ui").(packer.Ui)
// Skip when it is a spot instance
if s.SpotPrice != "" {
if s.SpotPrice != "" && s.SpotPrice != "0" {
return multistep.ActionContinue
}

View file

@ -154,7 +154,8 @@ builder.
when the current spot price is less than the maximum price you specify. Spot
price will be updated based on available spot instance capacity and current
spot instance requests. It may save you some costs. You can set this to
"auto" for Packer to automatically discover the best spot price.
"auto" for Packer to automatically discover the best spot price or to "0"
to use an on demand instance (default).
- `spot_price_auto_product` (string) - Required if `spot_price` is set
to "auto". This tells Packer what sort of AMI you're launching to find the

View file

@ -195,7 +195,8 @@ builder.
maximum price that you specify exceeds the current spot price. Spot price
will be updated based on available spot instance capacity and current spot
Instance requests. It may save you some costs. You can set this to "auto"
for Packer to automatically discover the best spot price.
for Packer to automatically discover the best spot price or to "0" to use
an on demand instance (default).
- `spot_price_auto_product` (string) - Required if `spot_price` is set
to "auto". This tells Packer what sort of AMI you're launching to find the