[chef] Re: Re: Re: Bootstrapping Windows Nodes via RDP


Chronological Thread 
  • From: Madhurranjan Mohaan < >
  • To:
  • Subject: [chef] Re: Re: Re: Bootstrapping Windows Nodes via RDP
  • Date: Wed, 23 Jan 2013 10:43:06 +0530

Hi Chris,

In our case we interact with Vmware infrastructure. As part of the base template we've added a startup job that runs chef client and in turn pulls the required recipes . One of those recipes is the winrm recipe .  Our flow is as follows:
Template ->  VM creation task -> Vm comes up and runs customization ( where it joins the domain , hostnames change , it gets the ip address, licenses are applied etc) -> Vm reboots and on startup it runs chef-client. If you're worried about what recipes to run at startup , one way is to even precreate the node and then assign it the required cookbooks so that it runs it.  I hope this is of some help with your cloud provider.  Let us know.

cheers
Ranjan


On Mon, Jan 21, 2013 at 11:38 PM, Chris McClimans < " target="_blank"> > wrote:
Ranjan,

How do you run that initial recipe... I'm looking at targeting cloud providers that may not enable winrm by default... or at locations that already use RDP. Basically trying to find a way to bootstrap bootstrap nodes via available default protocols.
Winrm rarely seems enabled by default. psexec and winexec require smb ports which cloud providers rarely allow access to, but RDP seems to be everywhere and mostly be default.


On Mon, Jan 21, 2013 at 12:36 AM, Madhurranjan Mohaan < " target="_blank"> > wrote:
Hi Chris,

We run a small recipe using windows_batch initially to turn on and configure winrm. It has worked well for us.  Following this , we have not had to RDP to any box to execute scripts. If and when needed we use knife windows to run commands remotely.

Ranjan



On Thu, Jan 17, 2013 at 2:41 PM, Chris McClimans < " target="_blank"> > wrote:
winrm is disabled by default for many windows installs, including cloud providers such as Azure.

I'm contemplating a way around this limitation by either finding a way to turn on winrm, or just executing commands via RDP instead.

I found an interesting from blog entry from 2008*[1] that suggested using the rdesktop executable (on linux) to run commands/scripts.

rdesktop -r disk:local="/tmp/dir/" my.new.server -s "cmd.exe /K net use x: \\\\tsclient\local & x:\setupwinrm.bat & shutdown /t 0 /r"

However that obviously requires shelling out to run a binary on Linux that requires the presence of an X server.

I was wondering if anyone has any suggestions or has seen any ruby gems or libraries that we could use to make something like this cross-platform.

The ideal scenario would give us the ability to run commands via the RDP procotol from plain ruby (no X or Linux required).

Then we could do something like:

knife bootstrap windows rdp my.new.server






Archive powered by MHonArc 2.6.16.

§