test-kitchen / kitchen-ec2

A Test Kitchen Driver for Amazon EC2
Other
221 stars 202 forks source link

Windows create fails fetching password #211

Closed jsmickey closed 8 years ago

jsmickey commented 8 years ago

I am having trouble retrieving passwords for Windows instances. I am starting with a simple setup very similar to https://learn.chef.io/local-development/windows/apply-the-web-application-cookbook-locally/

Please note, the workstation is Ubuntu and I am building and testing EC2 instances for Ubuntu and RHEL with no issues. I am able to telnet to the instance via the winRM ports from my workstation. I have checked the instances and see the Powershell user data scripts did run properly.

Here is my .kitchen.yml


---
driver:
  name: ec2
  aws_ssh_key_id: my_key
  security_group_ids: ["sg-xxxxxx"]
  region: us-west-2
  availability_zone: us-west-2b
  subnet_id: subnet-xxxxxxxxxxxx
  iam_profile_name: my_profile
  instance_type: t2.medium
  associate_pulbic_ip: false
  interface: private
  retryable_tries: 120

transport:
  username: Administrator
  connection_retries: 60
  connection_retry_sleep: 5

platforms:
  - name: windows-2012r2
    driver:
      image_id: ami-91a7bef0

suites:
  - name: default
    run_list:
      - recipe[my_cookbook::default]

And here is the error

2016/01/06 21:18:11Z: AMI-ID: ami-91a7bef0
2016/01/06 21:18:11Z: Instance-ID: i-c041ac07
2016/01/06 21:18:13Z: Driver: AWS PV Network Device v7.3.2.0
2016/01/06 21:18:13Z: Driver: AWS PV Storage Host Adapter v7.3.2.0
2016/01/06 21:18:13Z: Ec2SetPassword: Enabled
2016/01/06 21:18:15Z: RDPCERTIFICATE-SUBJECTNAME: WIN-M5RBN59CS2C
2016/01/06 21:18:15Z: RDPCERTIFICATE-THUMBPRINT: 2999277D5D9AE4F083D260A0D9676F158EF42543
2016/01/06 21:18:18Z: Username: Administrator
2016/01/06 21:18:18Z: Password: <Password>
bbMMcxK/2iGPIN/9+ArEZNDDEybs+eMb7X170FIlg6e1KmEvYGQTc/bPC8TNlTVUoj/a3Jue/+u618Mb45J4H0GDRFePVBTy0W1gPmMaz4nvSLIbYlxkJgFOicwavpeK7kBHYSPUXLzRQlRkguDkTD3jgNOaP092Az9wV7dMMoi63LcVMJDis9iWa70sdrtXM2TJ4CpLFMPL6NWAXuI6Qd0BXVkQ+56zoX2asAoIKAujzEoCnIz+wOXfdmio8ILntqaPvJNsis7r/WRIKLgt9QH3YgISMBy6DwmXA6d3St10/HMC6fQ+gI3A2vqp96qY5YC7AFxwCeTvDSS8Yrh8+w==
</Password>
2016/01/06 21:18:22Z: Message: Windows is Ready to use

       Waited 0/600s for instance <i-c041ac07> to fetch windows admin password.
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [no implicit conversion of nil into String]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

I have run kitchen diagnose, tried different AMIs, and tried different transport options with no success. Any help is appreciated

rhass-r7 commented 8 years ago

This is likely a duplicate of issue #201

jsmickey commented 8 years ago

Thanks @rhass-r7

jsmickey commented 8 years ago

Figured out a workaround

1 kitchen create windows 2 This will fail when trying to fetch the password 3 Edit .kitchen/windows.yml - Add the username, password, and status lines

---
server_id: i-28c22aef
hostname: 172.16.3.49
username: Administrator
password: xxxxxxxxxxx
status: created

4 kitchen create windows 5 kitchen converge windows

cheeseplus commented 8 years ago

Closing as dupe