[chef] RE: Re: Bootstrap windows server with knife ec2 server create?


Chronological Thread 
  • From: Paul Mooring < >
  • To: " " < >
  • Subject: [chef] RE: Re: Bootstrap windows server with knife ec2 server create?
  • Date: Thu, 16 May 2013 15:13:55 +0000
  • Accept-language: en-US

Hi Jeppe,

I think you're running into this bug: http://tickets.opscode.com/browse/KNIFE-266

There's some more discussion in the pull request linked there, but the short answer it's a known but and your work around is more or less the way to fix it.


Paul Mooring
Systems Engineer
www.opscode.com


From: Jeppe Nejsum Madsen
Sent: Thursday, May 16, 2013 7:31 AM
To:
Subject: [chef] Re: Bootstrap windows server with knife ec2 server create?
 
Thanks

I already did this (you can see it connects and starts to run the bootstrap script) and it works fine with my homegrown script (but like I posted in the SQL server thread the memory setting seems to be ignored in winrm 3). 

If I remove the waiting time for my own script it fails with the  same error. 

/Jeppe 

torsdag den 16. maj 2013 skrev Stephen Nelson-Smith :
You need to pass in user data to enable WinRM.

Create a local file like this called "enableWinRM.ps1"

<powershell>
    winrm quickconfig -q
    winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}'
    winrm set winrm/config '@{MaxTimeoutms="1800000"}'
    winrm set winrm/config/service '@{AllowUnencrypted="true"}'
    winrm set winrm/config/service/auth '@{Basic="true"}'
</powershell>

Then append to your knife ec2 server create command:

--user-data enableWinRM.ps1




On 16 May 2013 10:14, Jeppe Nejsum Madsen < > wrote:
Thanks for the quick feedback. A few comments:


@AJ, the chef-full template (unless some magic happens somewhere :-) seems to be a bash script and is not found.

Specifying the full path to the windows-chef-client.msi.erb works, thanks. This is not very intuitive though!

Now the instance launches and bootstrapping is starting, but fails with an error

ec2-54-216-82-224.eu-west-1.compute.amazonaws.com CScript Error: Execution of the Windows Script Host failed. (0x800A0007)
ec2-54-216-82-224.eu-west-1.compute.amazonaws.com Warning: Failed to download "https://www.opscode.com/chef/download?p=windows&pv=2012&m=x86_64" to "C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-latest.msi"
ec2-54-216-82-224.eu-west-1.compute.amazonaws.com Warning: Retrying download with PowerShell if available
ERROR: Failed to authenticate to ["ec2-54-216-82-224.eu-west-1.compute.amazonaws.com"] as Administrator
Response: Bad HTTP response returned from server (401).

I've seen this before (and mentioned elsewhere on the interwebs) and it seems to be an issue with WinRM not being completely ready even if the port is there. I've solved this in my own script by adding a delay between the port being available and trying to execute the bootstrap. Not exactly elegant....
 

/Jeppe


On Thu, May 16, 2013 at 10:33 AM, Chirag Jog < > wrote:
Hi Jeppe,
The windows template is present in the knife-windows gem which also gets installed now. Check /User/jeppe/....../gems/knife-windows/.../

The README should mention this though. I file a doc bug for it.



Regards,
Chirag Jog
Chief Technology Officer, 
Clogeny Technologies | http://clogeny.com 
(M) 0091-9766619440 | Skype: chirag.jog


--
Stephen Nelson-Smith,
Founder, Principal Consultant,
Atalanta Systems Ltd,
Web: http://agilesysadmin.net
Twitter: @lordcope
Skype: atalanta.systems
Direct: +44 (0) 1329 550203
Mobile: +44 (0) 7917 101919

Atalanta Systems: The Agile Infrastructure Enablers
http://atalanta-systems.com



Archive powered by MHonArc 2.6.16.

§