Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kitchen Failure: Could not create a spot #475

Closed
ObiH15 opened this issue Dec 3, 2019 · 2 comments
Closed

Kitchen Failure: Could not create a spot #475

ObiH15 opened this issue Dec 3, 2019 · 2 comments

Comments

@ObiH15
Copy link

ObiH15 commented Dec 3, 2019

Hello,

I'm trying to utilize the spot_price configuration option but I am receiving the following error:

Creating EC2 Spot Instance..
------Exception-------
Class: Kitchen::ActionFailed
Message: 1 actions failed.
Failed to complete #create action: [Could not create a spot] on windows2019
------Exception-------
------Backtrace-------
Class: Kitchen::ActionFailed
/usr/lib64/ruby/gems/2.4.0/gems/test-kitchen-2.3.4/lib/kitchen/command.rb:184:in report_errors' Message: 1 actions failed. /usr/lib64/ruby/gems/2.4.0/gems/test-kitchen-2.3.4/lib/kitchen/command.rb:175:in run_action'
Failed to complete #create action: [Could not create a spot] on base-windows-2019
/usr/lib64/ruby/gems/2.4.0/gems/test-kitchen-2.3.4/lib/kitchen/command/test.rb:42:in block in call' /usr/lib64/ruby/2.4.0/benchmark.rb:293:in measure'
Please see .kitchen/logs/kitchen.log for more details
/usr/lib64/ruby/gems/2.4.0/gems/test-kitchen-2.3.4/lib/kitchen/command/test.rb:38:in call' Also try running kitchen diagnose --allfor configuration /usr/lib64/ruby/gems/2.4.0/gems/test-kitchen-2.3.4/lib/kitchen/cli.rb:52:inperform'
/usr/lib64/ruby/gems/2.4.0/gems/test-kitchen-2.3.4/lib/kitchen/cli.rb:250:in test' /usr/lib64/ruby/gems/2.4.0/gems/thor-0.20.3/lib/thor/command.rb:27:in run'
/usr/lib64/ruby/gems/2.4.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in invoke_command' /usr/lib64/ruby/gems/2.4.0/gems/thor-0.20.3/lib/thor.rb:387:in dispatch'
/usr/lib64/ruby/gems/2.4.0/gems/thor-0.20.3/lib/thor/base.rb:466:in start' /usr/lib64/ruby/gems/2.4.0/gems/test-kitchen-2.3.4/bin/kitchen:13:in block in <top (required)>'
/usr/lib64/ruby/gems/2.4.0/gems/test-kitchen-2.3.4/lib/kitchen/errors.rb:171:in with_friendly_errors' /usr/lib64/ruby/gems/2.4.0/gems/test-kitchen-2.3.4/bin/kitchen:13:in <top (required)>'
/usr/bin/kitchen:22:in load' /usr/bin/kitchen:22:in

'
----End Backtrace-----
-Composite Exception--
Class: Kitchen::ActionFailed
Message: Failed to complete #create action: [Could not create a spot] on base-windows-2019

Environment Info:
test-kitchen 2.3.4
kitchen-ec2 3.2.0
kitchen-inspec 1.3.1

kitchen.yml

driver:
name: ec2
region: us-east-1
availability_zone: a
instance_type: t2.xlarge
spot_price: 0.0967
block_duration_minutes: 60
associate_public_ip: false
interface: private
subnet_id: <%= ENV[''] %>
security_group_ids: [ <%= ENV['
'] %> ]
retryable_tries: 120

provisioner:
name: shell
log_level: debug

@lmayorga1980
Copy link

lmayorga1980 commented Jan 7, 2020

@obxh0 Are you biding on the same price as listed or are you increasing the value a bit

https://aws.amazon.com/ec2/spot/pricing/

kitchen.yml

---
driver:
  name: ec2
  aws_ssh_key_id: <SOMEKEY>
  region: us-east-1
  availability_zone: b
  instance_type: t2.2xlarge
  associate_public_ip: true
  interface: private
  subnet_id: subnet-00e0909f6d9bc0f8d
  security_group_ids: ["sg-02a17b934696f5e6e"]
  retryable_tries: 120
  spot_price: 0.1735
  shared_credentials_profile: default
  user_data: user_data_windows_2016.ps1

Kitchen Test

[09:33:08] $ bundle exec kitchen test
-----> Starting Test Kitchen (v2.3.4)
-----> Cleaning up any prior instances of <base-windows-2016>
-----> Destroying <base-windows-2016>...
       EC2 instance <i-0a26e4271a2f33e5a> destroyed.
       Finished destroying <base-windows-2016> (0m0.21s).
-----> Testing <base-windows-2016>
-----> Creating <base-windows-2016>...
       Detected platform: windows version  on x86_64. Instance Type: t2.2xlarge. Default username: administrator (default).
       If you are not using an account that qualifies under the AWS
free-tier, you may be charged to run these suites. The charge
should be minimal, but neither Test Kitchen nor its maintainers
are responsible for your incurred costs.

       Waited 0/60s for spot request <sir-1t11kcsj> to become fulfilled.
       Waited 5/60s for spot request <sir-1t11kcsj> to become fulfilled.
       Instance <i-0ffcde91a2c36a13e> requested.
       Polling AWS for existence, attempt 0...
       Attempting to tag the instance, 0 retries
       EC2 instance <i-0ffcde91a2c36a13e> created.
       Waited 0/600s for instance <i-0ffcde91a2c36a13e> volumes to be ready.
       Waited 0/600s for instance <i-0ffcde91a2c36a13e> to become ready.
       Waited 5/600s for instance <i-0ffcde91a2c36a13e> to become ready.
       Waited 10/600s for instance <i-0ffcde91a2c36a13e> to become ready.
       Waited 15/600s for instance <i-0ffcde91a2c36a13e> to become ready.
       Waited 20/600s for instance <i-0ffcde91a2c36a13e> to become ready.
       Waited 25/600s for instance <i-0ffcde91a2c36a13e> to become ready.
       Waited 30/600s for instance <i-0ffcde91a2c36a13e> to become ready.
       Waited 35/600s for instance <i-0ffcde91a2c36a13e> to become ready.
       Waited 40/600s for instance <i-0ffcde91a2c36a13e> to become ready.
       Waited 45/600s for instance <i-0ffcde91a2c36a13e> to become ready.
       Waited 50/600s for instance <i-0ffcde91a2c36a13e> to become ready.
       Waited 55/600s for instance <i-0ffcde91a2c36a13e> to become ready.
       Waited 60/600s for instance <i-0ffcde91a2c36a13e> to become ready.
       
       Finished creating <base-windows-2016> (4m21.07s).
-----> Converging <base-windows-2016>...
       Preparing files for transfer
       Preparing script
       No provisioner script file specified, skipping
       Transferring files to <base-windows-2016>
       Downloading files from <base-windows-2016>
       Finished converging <base-windows-2016> (0m6.64s).
-----> Setting up <base-windows-2016>...
       Finished setting up <base-windows-2016> (0m0.00s).
-----> Verifying <base-windows-2016>...
       Loaded tests from {:path=>".home.lcentinel.gitcom.kitchen-ec2.test.base_spec.rb"} 

Profile: tests from {:path=>"/home/lcentinel/gitcom/kitchen-ec2/test/base_spec.rb"} (tests from {:path=>".home.lcentinel.gitcom.kitchen-ec2.test.base_spec.rb"})
Version: (not specified)
Target:  winrm://Administrator@https://<SOMEIP>:5986/wsman:3389

  Windows Feature 'Powershell'
     ✔  is expected to be installed

Test Summary: 1 successful, 0 failures, 0 skipped
       Finished verifying <base-windows-2016> (0m15.61s).
-----> Destroying <base-windows-2016>...
       EC2 instance <i-086b9b33caa4ad690> destroyed.
       Finished destroying <base-windows-2016> (0m0.47s).
       Finished testing <base-windows-2016> (4m44.13s).
-----> Test Kitchen is finished. (4m45.04s)

Gem Setup

[09:48:38] $ bundle exec gem list --local

*** LOCAL GEMS ***

activesupport (5.2.4.1)
addressable (2.7.0)
aws-eventstream (1.0.3)
aws-partitions (1.262.0)
aws-sdk-apigateway (1.36.0)
aws-sdk-apigatewayv2 (1.15.0)
aws-sdk-athena (1.22.0)
aws-sdk-autoscaling (1.22.0)
aws-sdk-budgets (1.27.0)
aws-sdk-cloudformation (1.29.0)
aws-sdk-cloudhsm (1.19.0)
aws-sdk-cloudhsmv2 (1.19.0)
aws-sdk-cloudtrail (1.20.0)
aws-sdk-cloudwatch (1.31.0)
aws-sdk-cloudwatchlogs (1.27.0)
aws-sdk-codecommit (1.30.0)
aws-sdk-codedeploy (1.27.0)
aws-sdk-codepipeline (1.27.0)
aws-sdk-configservice (1.40.0)
aws-sdk-core (3.86.0)
aws-sdk-costandusagereportservice (1.18.0)
aws-sdk-dynamodb (1.41.0)
aws-sdk-ec2 (1.130.0)
aws-sdk-ecr (1.24.0)
aws-sdk-ecs (1.55.0)
aws-sdk-eks (1.30.0)
aws-sdk-elasticache (1.29.0)
aws-sdk-elasticbeanstalk (1.26.0)
aws-sdk-elasticloadbalancing (1.19.0)
aws-sdk-elasticloadbalancingv2 (1.39.0)
aws-sdk-elasticsearchservice (1.29.0)
aws-sdk-firehose (1.24.0)
aws-sdk-iam (1.32.0)
aws-sdk-kafka (1.16.0)
aws-sdk-kinesis (1.20.0)
aws-sdk-kms (1.27.0)
aws-sdk-lambda (1.34.0)
aws-sdk-organizations (1.17.0)
aws-sdk-rds (1.74.0)
aws-sdk-redshift (1.35.0)
aws-sdk-route53 (1.30.0)
aws-sdk-route53domains (1.18.0)
aws-sdk-route53resolver (1.11.0)
aws-sdk-s3 (1.60.1)
aws-sdk-securityhub (1.15.0)
aws-sdk-ses (1.27.0)
aws-sdk-sms (1.17.0)
aws-sdk-sns (1.21.0)
aws-sdk-sqs (1.23.1)
aws-sdk-ssm (1.69.0)
aws-sigv4 (1.1.0)
azure_graph_rbac (0.17.1)
azure_mgmt_key_vault (0.17.5)
azure_mgmt_resources (0.17.8)
azure_mgmt_security (0.18.0)
bcrypt_pbkdf (1.0.1)
builder (3.2.4)
bundler (default: 1.17.2)
chef-config (15.6.10)
chef-telemetry (1.0.2)
chef-utils (15.6.10)
coderay (1.1.2)
concurrent-ruby (1.1.5)
declarative (0.0.10)
declarative-option (0.1.0)
diff-lcs (1.3)
docker-api (1.34.2)
domain_name (0.5.20190701)
ed25519 (1.2.4)
equatable (0.6.1)
erubi (1.9.0)
excon (0.71.1)
faraday (0.17.3)
faraday-cookie_jar (0.0.6)
faraday_middleware (0.13.1)
ffi (1.11.3)
ffi-yajl (2.3.3)
fuzzyurl (0.9.0)
google-api-client (0.34.1)
googleauth (0.10.0)
gssapi (1.3.0)
gyoku (1.3.1)
hashie (3.6.0)
htmlentities (4.3.4)
http (2.2.2)
http-cookie (1.0.3)
http-form_data (1.0.3)
http_parser.rb (0.6.0)
httpclient (2.8.3)
i18n (1.7.0)
inifile (3.0.0)
inspec (4.18.51)
jmespath (1.4.0)
json (2.3.0)
json-schema (2.8.1)
jwt (2.2.1)
kitchen-ec2 (3.2.0)
kitchen-inspec (1.3.1)
libyajl2 (1.2.0)
license-acceptance (1.0.13)
little-plugger (1.1.4)
logging (2.2.2)
memoist (0.16.2)
method_source (0.9.2)
mini_mime (1.0.2)
minitest (5.13.0)
mixlib-config (3.0.6)
mixlib-install (3.11.26)
mixlib-log (3.0.8)
mixlib-shellout (3.0.9)
mixlib-versioning (1.2.12)
ms_rest (0.7.5)
ms_rest_azure (0.11.1)
multi_json (1.14.1)
multipart-post (2.1.1)
necromancer (0.5.1)
net-scp (2.0.0)
net-ssh (5.2.0)
net-ssh-gateway (2.0.0)
nori (2.6.0)
os (1.0.1)
parallel (1.19.1)
parslet (1.8.2)
pastel (0.7.3)
pry (0.12.2)
public_suffix (4.0.3)
representable (3.0.4)
retriable (3.1.2)
retryable (3.0.5)
rspec (3.9.0)
rspec-core (3.9.1)
rspec-expectations (3.9.0)
rspec-its (1.3.0)
rspec-mocks (3.9.1)
rspec-support (3.9.2)
rubyntlm (0.6.2)
rubyzip (1.3.0)
semverse (3.0.0)
signet (0.12.0)
sslshake (1.3.0)
strings (0.1.8)
strings-ansi (0.2.0)
sync (default: 0.5.0)
term-ansicolor (1.7.1)
test-kitchen (2.3.4)
thor (0.20.3)
thread_safe (0.3.6)
timeliness (0.3.10)
tins (1.23.0)
tomlrb (1.2.9)
train (3.2.5)
train-aws (0.1.15)
train-habitat (0.2.13)
train-winrm (0.2.6)
tty-box (0.5.0)
tty-color (0.5.0)
tty-cursor (0.7.0)
tty-prompt (0.20.0)
tty-reader (0.7.0)
tty-screen (0.7.0)
tty-table (0.11.0)
tzinfo (1.2.6)
uber (0.1.0)
unf (0.1.4)
unf_ext (0.0.7.2)
unicode-display_width (1.6.0)
unicode_utils (1.4.0)
winrm (2.3.4)
winrm-elevated (1.1.2)
winrm-fs (1.3.3)
wisper (2.0.1)

@bdwyertech
Copy link
Contributor

#470 might resolve this

@ObiH15 ObiH15 closed this as completed May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants