Knife vsphere bootstrap winrm

Hi All,

Do you know if I can get knife vsphere to support bootstrapping with winrm? Is there any pre-written code anywhere to do this?

Cheers,

Simon Hawkins

Senior Windows Systems Engineer
Total Jobs Group
8th Floor, Lacon House
84 Theobalds Road
London WC1X 8TG
’ +44 (0)20 7611 4359 (mobile) 07799 885261
@ simon.hawkins@totaljobsgroup.commailto:simon.hawkins@totaljobsgroup.com
T www.totaljobsgroup.comhttp://www.totaljobsgroup.com/


Disclaimer

This message is intended only for the use of the person(s) (“Intended Recipient”) to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Holden House, 57 Rathbone Place, London, W1T 1JU, UK Registered in England and Wales under company no. 4269861


Looking in the code for knife-vsphere, I don't see anything related to
Windows bootstrapping.

There is Windows bootstrapping support in several knife plugins (EC2,
OpenStack, etc.), so I assume porting this logic over would be fairly
straightforward. It's not a Chef-maintained plugin, but if someone's
interested in getting this done, I'd be happy to lend a hand.

Thanks,
Matt Ray
Director of Partner Integration :: Chef
512.731.2218 :: matt@getchef.com
mattray :: GitHub :: IRC :: Twitter

On Tue, Jun 10, 2014 at 4:08 AM, Simon Hawkins
Simon.Hawkins@totaljobsgroup.com wrote:

Hi All,

Do you know if I can get knife vsphere to support bootstrapping with winrm?
Is there any pre-written code anywhere to do this?

Cheers,

Simon Hawkins

Senior Windows Systems Engineer

Total Jobs Group

8th Floor, Lacon House

84 Theobalds Road

London WC1X 8TG

' +44 (0)20 7611 4359 (mobile) 07799 885261

@ simon.hawkins@totaljobsgroup.com

T www.totaljobsgroup.com


Disclaimer

This message is intended only for the use of the person(s) ("Intended
Recipient") to whom it is addressed. It may contain information which is
privileged and confidential. Accordingly any dissemination, distribution,
copying or other use of this message or any of its content by any person
other than the Intended Recipient may constitute a breach of civil or
criminal law and is strictly prohibited. If you are not the Intended
Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Holden House, 57 Rathbone Place,
London, W1T 1JU, UK Registered in England and Wales under company no.
4269861


Hi Matt,

I would be, I have found some code in https://github.com/opscode/knife-ec2/blob/master/lib/chef/knife/ec2_server_create.rb

But if you could point me in the direction of where the knife vsphere code is placed on my chef workstation I could possibly figure out the logic.

Cheers,

Simon.

-----Original Message-----
From: Matt Ray [mailto:matt@getchef.com]
Sent: 11 June 2014 05:21
To: chef@lists.opscode.com
Subject: [chef] Re: knife vsphere bootstrap winrm

Looking in the code for knife-vsphere, I don't see anything related to Windows bootstrapping.

There is Windows bootstrapping support in several knife plugins (EC2, OpenStack, etc.), so I assume porting this logic over would be fairly straightforward. It's not a Chef-maintained plugin, but if someone's interested in getting this done, I'd be happy to lend a hand.

Thanks,
Matt Ray
Director of Partner Integration :: Chef
512.731.2218 :: matt@getchef.com
mattray :: GitHub :: IRC :: Twitter

On Tue, Jun 10, 2014 at 4:08 AM, Simon Hawkins Simon.Hawkins@totaljobsgroup.com wrote:

Hi All,

Do you know if I can get knife vsphere to support bootstrapping with winrm?
Is there any pre-written code anywhere to do this?

Cheers,

Simon Hawkins

Senior Windows Systems Engineer

Total Jobs Group

8th Floor, Lacon House

84 Theobalds Road

London WC1X 8TG

' +44 (0)20 7611 4359 (mobile) 07799 885261

@ simon.hawkins@totaljobsgroup.com

T www.totaljobsgroup.com


Disclaimer

This message is intended only for the use of the person(s) ("Intended
Recipient") to whom it is addressed. It may contain information which
is privileged and confidential. Accordingly any dissemination,
distribution, copying or other use of this message or any of its
content by any person other than the Intended Recipient may constitute
a breach of civil or criminal law and is strictly prohibited. If you
are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Holden House, 57 Rathbone
Place, London, W1T 1JU, UK Registered in England and Wales under company no.
4269861



Disclaimer

This message is intended only for the use of the person(s) ("Intended Recipient") to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Holden House, 57 Rathbone Place, London, W1T 1JU, UK Registered in England and Wales under company no. 4269861


It should be at
c:opscodechefembeddedlibrubygems1.9.1gemschef-11.8.0-x86-mingw32libchefknifeec2_server_create.rb

Change the version and install dir to fit your install.

Tensibai

Le 2014-06-11 11:39, Simon Hawkins a écrit :

Hi Matt,

I would be, I have found some code in https://github.com/opscode/knife-ec2/blob/master/lib/chef/knife/ec2_server_create.rb [2]

But if you could point me in the direction of where the knife vsphere code is placed on my chef workstation I could possibly figure out the logic.

Cheers,

Simon.

-----Original Message-----
From: Matt Ray [mailto:matt@getchef.com]
Sent: 11 June 2014 05:21
To: chef@lists.opscode.com
Subject: [chef] Re: knife vsphere bootstrap winrm

Looking in the code for knife-vsphere, I don't see anything related to Windows bootstrapping.
https://github.com/ezrapagel/knife-vsphere/blob/master/lib/chef/knife/vsphere_vm_clone.rb [3]

There is Windows bootstrapping support in several knife plugins (EC2, OpenStack, etc.), so I assume porting this logic over would be fairly straightforward. It's not a Chef-maintained plugin, but if someone's interested in getting this done, I'd be happy to lend a hand.

Thanks,
Matt Ray
Director of Partner Integration :: Chef
512.731.2218 :: matt@getchef.com
mattray :: GitHub :: IRC :: Twitter

On Tue, Jun 10, 2014 at 4:08 AM, Simon Hawkins Simon.Hawkins@totaljobsgroup.com wrote:

Hi All, Do you know if I can get knife vsphere to support bootstrapping with winrm? Is there any pre-written code anywhere to do this? Cheers, Simon Hawkins Senior Windows Systems Engineer Total Jobs Group 8th Floor, Lacon House 84 Theobalds Road London WC1X 8TG ' +44 (0)20 7611 4359 (mobile) 07799 885261 @ simon.hawkins@totaljobsgroup.com T www.totaljobsgroup.com [1] ________________________________ Disclaimer This message is intended only for the use of the person(s) ("Intended Recipient") to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible. Totaljobs Group Limited Registered Office: Holden House, 57 Rathbone Place, London, W1T 1JU,
UK Registered in England and Wales under company no. 4269861 ________________________________


Disclaimer

This message is intended only for the use of the person(s) ("Intended Recipient") to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Holden House, 57 Rathbone Place, London, W1T 1JU, UK Registered in England and Wales under company no. 4269861


Links:

[1] http://www.totaljobsgroup.com
[2]
https://github.com/opscode/knife-ec2/blob/master/lib/chef/knife/ec2_server_create.rb
[3]
https://github.com/ezrapagel/knife-vsphere/blob/master/lib/chef/knife/vsphere_vm_clone.rb

Hi Tensibai,

I meant the vsphere code, but I managed to locate it in:

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/knife-vsphere-0.9.9/lib/chef/knife/vsphere_vm_clone.rb

So will see if I can make the code work.

Cheers,
Simon

From: Tensibai [mailto:tensibai@iabis.net]
Sent: 11 June 2014 13:23
To: chef@lists.opscode.com
Subject: [chef] Re: RE: Re: knife vsphere bootstrap winrm

It should be at c:\opscode\chef\embedded\lib\ruby\gems\1.9.1\gems\chef-11.8.0-x86-mingw32\lib\chef\knife\ec2_server_create.rb

Change the version and install dir to fit your install.

Tensibai

Le 2014-06-11 11:39, Simon Hawkins a écrit :

Hi Matt,

I would be, I have found some code in https://github.com/opscode/knife-ec2/blob/master/lib/chef/knife/ec2_server_create.rb

But if you could point me in the direction of where the knife vsphere code is placed on my chef workstation I could possibly figure out the logic.

Cheers,

Simon.

-----Original Message-----

From: Matt Ray [mailto:matt@getchef.commailto:matt@getchef.com]

Sent: 11 June 2014 05:21

To: chef@lists.opscode.commailto:chef@lists.opscode.com

Subject: [chef] Re: knife vsphere bootstrap winrm

Looking in the code for knife-vsphere, I don’t see anything related to Windows bootstrapping.

There is Windows bootstrapping support in several knife plugins (EC2, OpenStack, etc.), so I assume porting this logic over would be fairly straightforward. It’s not a Chef-maintained plugin, but if someone’s interested in getting this done, I’d be happy to lend a hand.

Thanks,

Matt Ray

Director of Partner Integration :: Chef

512.731.2218 :: matt@getchef.commailto:matt@getchef.com

mattray :: GitHub :: IRC :: Twitter

On Tue, Jun 10, 2014 at 4:08 AM, Simon Hawkins <Simon.Hawkins@totaljobsgroup.commailto:Simon.Hawkins@totaljobsgroup.com> wrote:
Hi All, Do you know if I can get knife vsphere to support bootstrapping with winrm? Is there any pre-written code anywhere to do this? Cheers, Simon Hawkins Senior Windows Systems Engineer Total Jobs Group 8th Floor, Lacon House 84 Theobalds Road London WC1X 8TG ’ +44 (0)20 7611 4359 (mobile) 07799 885261 @ simon.hawkins@totaljobsgroup.commailto:simon.hawkins@totaljobsgroup.com T www.totaljobsgroup.comhttp://www.totaljobsgroup.com ________________________________ Disclaimer This message is intended only for the use of the person(s) (“Intended Recipient”) to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible. Totaljobs Group Limited Registered Office: Holden House, 57 Rathbone Place, London, W1T 1JU, UK Registered in England and Wales under company no. 4269861 ________________________________


Disclaimer

This message is intended only for the use of the person(s) (“Intended Recipient”) to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Holden House, 57 Rathbone Place, London, W1T 1JU, UK Registered in England and Wales under company no. 4269861


Hi All,

I’ve managed to combine some code into knife vsphere to bootstrap using winrm, but I get the following error:

Exception: NameError: undefined local variable or method `bootstrap_directory’

And it happens when it calls this method:

def bootstrap_for_node_windows()
Chef::knife::Bootstrap.load_deps
bootstrap = Chef::knife::Bootstrap.new
bootstrap.name_args = [config[:fqdn]]
bootstrap.config[:run_list] = get_config(:run_list).split(/[\s,]+/)
bootstrap.config[:winrm_user] = get_config(:winrm_user)
bootstrap.config[:winrm_password] = get_config(:windows_password)
bootstrap.config[:winrm_transport] = get_config(:winrm_transport)
bootstrap.config[:kerberos_keytab_file] = Chef::Config[:knife][:kerberos_keytab_file] if Chef::Config[:knife][:kerberos_keytab_file]
bootstrap.config[:kerberos_realm] = Chef::Config[:knife][:kerberos_realm] if Chef::Config[:knife][:kerberos_realm]
bootstrap.config[:kerberos_service] = Chef::Config[:knife][:kerberos_service] if Chef::Config[:knife][:kerberos_service]
bootstrap.config[:ca_trust_file] = Chef::Config[:knife][:ca_trust_file] if Chef::Config[:knife][:ca_trust_file]
bootstrap.config[:manual] = true
bootstrap.config[:winrm_port] = get_config(:winrm_port)
bootstrap.config[:secret_file] = get_config(:secret_file)
bootstrap.config[:ssh_user] = get_config(:ssh_user)
bootstrap.config[:ssh_password] = get_config(:ssh_password)
bootstrap.config[:ssh_port] = get_config(:ssh_port)
bootstrap.config[:identity_file] = get_config(:identity_file)
bootstrap.config[:chef_node_name] = get_config(:chef_node_name)
bootstrap.config[:prerelease] = get_config(:prerelease)
bootstrap.config[:bootstrap_version] = get_config(:bootstrap_version)
bootstrap.config[:distro] = get_config(:distro)
bootstrap.config[:use_sudo] = true unless get_config(:ssh_user) == 'root’
bootstrap.config[:template_file] = get_config(:template_file)
bootstrap.config[:environment] = get_config(:environment)
bootstrap.config[:first_boot_attributes] = get_config(:first_boot_attributes)
bootstrap.config[:log_level] = get_config(:log_level)
# may be needed for vpc_mode
bootstrap.config[:no_host_key_verify] = get_config(:no_host_key_verify)
bootstrap
end

Am I missing a class that should be loaded which contains a method called “bootstrap_directory’ ?

Cheers,
Simon.

From: Simon Hawkins [mailto:Simon.Hawkins@totaljobsgroup.com]
Sent: 11 June 2014 13:30
To: chef@lists.opscode.com
Subject: [chef] RE: Re: RE: Re: knife vsphere bootstrap winrm

Hi Tensibai,

I meant the vsphere code, but I managed to locate it in:

/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/knife-vsphere-0.9.9/lib/chef/knife/vsphere_vm_clone.rb

So will see if I can make the code work.

Cheers,
Simon

From: Tensibai [mailto:tensibai@iabis.net]
Sent: 11 June 2014 13:23
To: chef@lists.opscode.commailto:chef@lists.opscode.com
Subject: [chef] Re: RE: Re: knife vsphere bootstrap winrm

It should be at c:\opscode\chef\embedded\lib\ruby\gems\1.9.1\gems\chef-11.8.0-x86-mingw32\lib\chef\knife\ec2_server_create.rb

Change the version and install dir to fit your install.

Tensibai

Le 2014-06-11 11:39, Simon Hawkins a écrit :

Hi Matt,

I would be, I have found some code in https://github.com/opscode/knife-ec2/blob/master/lib/chef/knife/ec2_server_create.rb

But if you could point me in the direction of where the knife vsphere code is placed on my chef workstation I could possibly figure out the logic.

Cheers,

Simon.

-----Original Message-----

From: Matt Ray [mailto:matt@getchef.commailto:matt@getchef.com]

Sent: 11 June 2014 05:21

To: chef@lists.opscode.commailto:chef@lists.opscode.com

Subject: [chef] Re: knife vsphere bootstrap winrm

Looking in the code for knife-vsphere, I don’t see anything related to Windows bootstrapping.

There is Windows bootstrapping support in several knife plugins (EC2, OpenStack, etc.), so I assume porting this logic over would be fairly straightforward. It’s not a Chef-maintained plugin, but if someone’s interested in getting this done, I’d be happy to lend a hand.

Thanks,

Matt Ray

Director of Partner Integration :: Chef

512.731.2218 :: matt@getchef.commailto:matt@getchef.com

mattray :: GitHub :: IRC :: Twitter

On Tue, Jun 10, 2014 at 4:08 AM, Simon Hawkins <Simon.Hawkins@totaljobsgroup.commailto:Simon.Hawkins@totaljobsgroup.com> wrote:
Hi All, Do you know if I can get knife vsphere to support bootstrapping with winrm? Is there any pre-written code anywhere to do this? Cheers, Simon Hawkins Senior Windows Systems Engineer Total Jobs Group 8th Floor, Lacon House 84 Theobalds Road London WC1X 8TG ’ +44 (0)20 7611 4359 (mobile) 07799 885261 @ simon.hawkins@totaljobsgroup.commailto:simon.hawkins@totaljobsgroup.com T www.totaljobsgroup.comhttp://www.totaljobsgroup.com ________________________________ Disclaimer This message is intended only for the use of the person(s) (“Intended Recipient”) to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible. Totaljobs Group Limited Registered Office: Holden House, 57 Rathbone Place, London, W1T 1JU, UK Registered in England and Wales under company no. 4269861 ________________________________


Disclaimer

This message is intended only for the use of the person(s) (“Intended Recipient”) to whom it is addressed. It may contain information which is privileged and confidential. Accordingly any dissemination, distribution, copying or other use of this message or any of its content by any person other than the Intended Recipient may constitute a breach of civil or criminal law and is strictly prohibited. If you are not the Intended Recipient, please contact the sender as soon as possible.

Totaljobs Group Limited Registered Office: Holden House, 57 Rathbone Place, London, W1T 1JU, UK Registered in England and Wales under company no. 4269861