Bootstraping multiple windows nodes


Hi guys,

I would like to bootstrap many nodes at the same time using knife command how can i do it? should i setup environment and roles using json files?




On windows (with powershell) you can use a command like this:
foreach ( $machine in Get-Content D:\machines.txt ) { knife node delete $machine -y; knife client delete $machine -y; knife bootstrap $machine -N $machine -x root -P 'rootpassword'; knife download nodes/$machine.json }

The script above also deletes an existing node. you can remove the first two commands knife node delete $machine -y; knife client delete $machine -y if the nodes does not already exists.

Of course, you can use another user if that user have sudo rights.
An example with the content of machines.txt:

In Linux you can use a shell script alike.

All the machines should have records in DNS in order to be seen by chef server.

Hope this helps.



my workstation is under centos7 so i’m not using powershell to bootstrap my nodes, i’m using knife bootstrap windows winrm!


The bash script would be like
for MACHINE in cat hostlist.txt; do knife bootstrap $MACHINE -N $MACHINE -u root -P ‘rootpasswd’;done
ofcourse, you can use an user with sudo rights.

I hope this helps,


Okay thanks that’s very helpful. Are the bootstrap operations occuring at the same time?


It would do them linearly, not in paralell.

Nathan Clemons

DevOps Engineer

Moxie Cloud Services (MCS)

O +1.425.467.5075

M +1.360.861.6291


W www.gomoxie.com


It might be worth mentioning spiceweasel here.


If you are bootstrapping in an environment supported by a chef-provisioning driver like EC2 or Azure (there are others too), then the machine and machine_batch resources are worth a look. machines inside a machine_batch will converge concurrently.


I 'm bootstraping physical machines running under windows 7 so i’m not in an environement supported by chef_provisionning i guess i’m i wrong?
So in that case, how can i bootstrap my nodes in parallel?



@chernaj you can bootstrap physical machines with chef-provisioning. Check out the chef-provisioning-ssh driver (it also does winrm for windows nodes).


Ok thanks i’ll try it with chef delivery too!


Can someone explain hox to install and configure ssh provisionning driver?