Gitlab Pipeline 报告默认 "Failed to complete #create action: [execution expired]"-windows-2016

Gitlab Pipeline reports "Failed to complete #create action: [execution expired]" on default-windows-2016

实例卷为 AWS public EC2 windows 2012/2016 AMI 准备好后,Gitlab Pipeline 失败并出现以下错误。如果我们在 kitchen.local.yml 内使用相同的子网、sg-group 和 Public AMI 执行此操作,一切正常,直到 kitchen converge。

.gitlab-ci yml文件

stages:
  - verify
  - build
  - deliver

syntax_lint_unit_tests:
  stage: verify
  script:
    - chef exec rake -g verify
  tags:
    - chef
kitchen_tests:
  stage: build
  script:
    - chef exec rake -g build
  tags:
    - chef
berks_upload:
  stage: deliver
  script:
    - chef exec rake -g deliver
  only:
    - master
  tags:
    - chef

执行Gitlab Pipeline时抓到这些错误日志-

Running with gitlab-runner 10.1.0 (c1ecf97f)
  on Test Chef Pipeline (7f07ecd0)
Using Shell executor...
Running on ip-**-***-**-***...
Fetching changes...
Removing Berksfile.lock
HEAD is now at fea0626 changes in kitchen.yml file updated to old sg,subnet values
Checking out fea06264 as master...
Skipping Git submodules setup
$ chef exec rake -g build
(in /home/ec2-user/builds/7f07ecd0/0/Users/cookbook)
chef exec kitchen test -d always
-----> Starting Kitchen (v1.17.0)
-----> Cleaning up any prior instances of <default-windows-2016>
-----> Destroying <default-windows-2016>...
       Finished destroying <default-windows-2016> (0m0.00s).
-----> Testing <default-windows-2016>
-----> Creating <default-windows-2016>...
       Detected platform: windows version 2016rtm on x86_64. Instance Type: t2.micro. 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.

       Instance <i-InstanceID> requested.
       Polling AWS for existence, attempt 0...
       Polling AWS for existence, attempt 1...
       Attempting to tag the instance, 0 retries
       EC2 instance <i-InstanceID> created.
       Waited 0/600s for instance <i-InstanceID> volumes to be ready.
       Waited 5/600s for instance <i-InstanceID> volumes to be ready.
       Waited 10/600s for instance <i-InstanceID> volumes to be ready.
       Waited 0/600s for instance <i-InstanceID> to become ready.
       Waited 5/600s for instance <i-InstanceID> to become ready.
       Waited 10/600s for instance <i-InstanceID> to become ready.
       Waited 15/600s for instance <i-InstanceID> to become ready.
       Waited 20/600s for instance <i-InstanceID> to become ready.
       Waited 25/600s for instance <i-InstanceID> to become ready.
       Waited 30/600s for instance <i-InstanceID> to become ready.
       Waited 35/600s for instance <i-InstanceID> to become ready.
       Waited 40/600s for instance <i-InstanceID> to become ready.
       Waited 45/600s for instance <i-InstanceID> to become ready.
       Waited 50/600s for instance <i-InstanceID> to become ready.
       Waited 55/600s for instance <i-InstanceID> to become ready.
       Waited 60/600s for instance <i-InstanceID> to become ready.
       Waited 65/600s for instance <i-InstanceID> to become ready.
       Waited 70/600s for instance <i-InstanceID> to become ready.
       Waited 75/600s for instance <i-InstanceID> to become ready.
       Waited 80/600s for instance <i-InstanceID> to become ready.
       Waited 85/600s for instance <i-InstanceID> to become ready.
       Waited 90/600s for instance <i-InstanceID> to become ready.
       Waited 95/600s for instance <i-InstanceID> to become ready.
       Waited 100/600s for instance <i-InstanceID> to become ready.
       Waited 105/600s for instance <i-InstanceID> to become ready.
       Waited 110/600s for instance <i-InstanceID> to become ready.
       Waited 115/600s for instance <i-InstanceID> to become ready.
       Waited 120/600s for instance <i-InstanceID> to become ready.
       Waited 125/600s for instance <i-InstanceID> to become ready.
       Waited 130/600s for instance <i-InstanceID> to become ready.
       Waited 0/600s for instance <i-InstanceID> to fetch windows admin password.
       Retrieved Windows password for instance <i-InstanceID>.
       EC2 instance <i-InstanceID> ready.
-----> Destroying <default-windows-2016>...
       EC2 instance <i-InstanceID> destroyed.
       Finished destroying <default-windows-2016> (0m0.33s).
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #create action: [execution expired] on default-windows-2016
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
rake aborted!
Command failed with status (20): [chef exec kitchen test -d always...]
/home/ec2-user/.rake/Rakefile.rake:43:in `block (2 levels) in <top (required)>'
Tasks: TOP => build => test:integration
(See full trace by running task with --trace)
ERROR: Job failed: exit status 1

我在 运行 厨房测试时遇到了同样的问题。

------Exception-------
Class: Kitchen::ActionFailed
Message: 1 actions failed.
Failed to complete #create action: [execution expired] on default-windows-2012r2`

问题出在 .kitchen 中关联的安全组我已经为 winrm http 和 https: 5985-5986 添加了安全组入站规则,ssh 在 22 开始工作。