Image Provisioning + Windows OS

Hello !

I'm using VmWare. With Foreman 1.5.0, we can now deploy hosts from
templates, but it seems to be designed for linux hosts as we have to
provide ssh information… I deploy my linux hosts using PXE and TFTP, and
i was really waiting for this feature for windows hosts.
I tried to deploy an windows host with the new feature, it works, leaving
blank the ssh informations fields, but something is missing : the ability
to choose a customization specification from vmware, which would replace
the ssh part for linux hosts.

Can this new feature be adapted for windows hosts plz ?

I have been deploying both Windows and Linux hosts with Foreman for a while
now using a network based installation. Recently, I started deploying
hosts in AWS using user-data scripts for both Windows and Linux. The user
data script simply downloads a powershell or shell script from github to
provision the hosts. We'll begin using images on our VMWare clusters and
will adopt a similar approach as AWS. I plan to just bake the script which
downloads the provision scripts from github into the images and configure
it to run on first boot. This way we can modify the provision steps
without have to recreate the image. This is a workaround for Windows until
Foreman can support winrm, but I'm not sure when or if that will happen as
I think most people use Foreman for nix systems.

··· On Wednesday, June 4, 2014 5:39:27 AM UTC-7, Alexandre Barth wrote: > > Hello ! > > I'm using VmWare. With Foreman 1.5.0, we can now deploy hosts from > templates, but it seems to be designed for linux hosts as we have to > provide ssh information... I deploy my linux hosts using PXE and TFTP, and > i was really waiting for this feature for windows hosts. > I tried to deploy an windows host with the new feature, it works, leaving > blank the ssh informations fields, but something is missing : the ability > to choose a customization specification from vmware, which would replace > the ssh part for linux hosts. > > Can this new feature be adapted for windows hosts plz ? >

I'm VERY interested in this feature too.

··· On Wednesday, June 4, 2014 5:39:27 AM UTC-7, Alexandre Barth wrote: > > Hello ! > > I'm using VmWare. With Foreman 1.5.0, we can now deploy hosts from > templates, but it seems to be designed for linux hosts as we have to > provide ssh information... I deploy my linux hosts using PXE and TFTP, and > i was really waiting for this feature for windows hosts. > I tried to deploy an windows host with the new feature, it works, leaving > blank the ssh informations fields, but something is missing : the ability > to choose a customization specification from vmware, which would replace > the ssh part for linux hosts. > > Can this new feature be adapted for windows hosts plz ? >

Hi,

I apologize for being silent - I did no have a chance to finalize the
solution …I was quite busy last few months.
The solution I've tried worked fine … up to some point. I'm pretty sure
someone will be able to finalize it.

So, Foreman VM template provisioning and finish scripts were designed for
Linux/Unix systems with an SSH server starting by default.
Also Foreman uses Linux "scp" command to transfer ready finish script to a
new server - Cygwin has "scp" command and lucky it compatible with Foreman.

So, instead of changing Foreman code I decided to mimic a Linux environment
in a Windows Server VMWare template.

The template Windows Server must have:

  1. Cygwin installed - https://www.cygwin.com/

  2. Cygwin SSHD service configured - http://www.noah.org/ssh/cygwin-sshd.html

2.1) SSHD server *must be *starting when Windows starts

  1. Puppet Agent For Windows must be installed

Foreman server must have a finish shell script associated with Windows OS
or environment, etc…
This Foreman finish template for Windows should contain Windows commands
to configure all aspects of provisioning server - i.e. IP addresses, DNS
servers, gateways, etc…

Sorry I've lost the Foreman finish template for Windows I've made - so you
will need to figure all necessary commands by yourself:

··· ---- *#!/bin/bash*

cmd.exe /c “command line 1 - change IP address…”

cmd.exe /c “command line 2 - chage default gateway…”

*cmd.exe /c “command line 3 - change DNS servers…” *
cmd.exe /c “command line 4 - change default gateway…”

cmd.exe /c “command line 5 - configure Puppet Agent…”

cmd.exe /c “command line 6 - do something else…”


# Disable (or delete) Cygwin SSH server - if you won’t need it in the
future"

cmd.exe /c “sc config sshd start= disabled”

# you can even schedule wiping out of Cygwin folder if you want…

reboot new Windows server…

*cmd.exe /c “shutdown.exe /r /t 0” *

You have to program all

On Wednesday, June 4, 2014 at 5:39:27 AM UTC-7, Alexandre Barth wrote:

Hello !

I’m using VmWare. With Foreman 1.5.0, we can now deploy hosts from
templates, but it seems to be designed for linux hosts as we have to
provide ssh information… I deploy my linux hosts using PXE and TFTP, and
i was really waiting for this feature for windows hosts.
I tried to deploy an windows host with the new feature, it works, leaving
blank the ssh informations fields, but something is missing : the ability
to choose a customization specification from vmware, which would replace
the ssh part for linux hosts.

Can this new feature be adapted for windows hosts plz ?

Apparently vmware compute resource can't use user_data script, only a
finish script pushed via ssh. I just would like to be able to choose a
customizaton specification in foreman, instead of ssh parameters.

··· Le mercredi 4 juin 2014 23:24:48 UTC+2, Dylan Charleston a écrit : > > I have been deploying both Windows and Linux hosts with Foreman for a > while now using a network based installation. Recently, I started > deploying hosts in AWS using user-data scripts for both Windows and Linux. > The user data script simply downloads a powershell or shell script from > github to provision the hosts. We'll begin using images on our VMWare > clusters and will adopt a similar approach as AWS. I plan to just bake the > script which downloads the provision scripts from github into the images > and configure it to run on first boot. This way we can modify the > provision steps without have to recreate the image. This is a workaround > for Windows until Foreman can support winrm, but I'm not sure when or if > that will happen as I think most people use Foreman for nix systems. > > On Wednesday, June 4, 2014 5:39:27 AM UTC-7, Alexandre Barth wrote: >> >> Hello ! >> >> I'm using VmWare. With Foreman 1.5.0, we can now deploy hosts from >> templates, but it seems to be designed for linux hosts as we have to >> provide ssh information... I deploy my linux hosts using PXE and TFTP, and >> i was really waiting for this feature for windows hosts. >> I tried to deploy an windows host with the new feature, it works, leaving >> blank the ssh informations fields, but something is missing : the ability >> to choose a customization specification from vmware, which would replace >> the ssh part for linux hosts. >> >> Can this new feature be adapted for windows hosts plz ? >> >

I have elaborated a VMWare template based provisioning of Windows hosts
using Foreman.
It does not require any modifications of Foreman, or having WDS servers,
etc… - standard VMWare, VM template and Windows FINISH CMD script.

Will post an update here when all will be ready - maybe a day or so…

thx…

··· On Friday, November 7, 2014 4:39:17 PM UTC-8, Evgeny Vasilchenko wrote: > > I'm VERY interested in this feature too. > > On Wednesday, June 4, 2014 5:39:27 AM UTC-7, Alexandre Barth wrote: >> >> Hello ! >> >> I'm using VmWare. With Foreman 1.5.0, we can now deploy hosts from >> templates, but it seems to be designed for linux hosts as we have to >> provide ssh information... I deploy my linux hosts using PXE and TFTP, and >> i was really waiting for this feature for windows hosts. >> I tried to deploy an windows host with the new feature, it works, leaving >> blank the ssh informations fields, but something is missing : the ability >> to choose a customization specification from vmware, which would replace >> the ssh part for linux hosts. >> >> Can this new feature be adapted for windows hosts plz ? >> >

Thanks for replying. That is about what I expected. Did you happen to
mess with WinRM instead of ssh? Or is foreman too tied to ssh?

Also were you able to use the provisioning templates in vcenter to auto
assign IP/DNS and other capabilities? I think this is an important part
that is missing form the foreman/vcenter integration.

Corey

··· On Friday, February 6, 2015 at 12:21:45 PM UTC-8, Evgeny Vasilchenko wrote: > > Hi, > > I apologize for being silent - I did no have a chance to finalize the > solution ...I was quite busy last few months. > The solution I've tried worked fine ... up to some point. I'm pretty sure > someone will be able to finalize it. > > So, Foreman VM template provisioning and finish scripts were designed for > Linux/Unix systems with an SSH server starting by default. > Also Foreman uses Linux "scp" command to transfer ready finish script to a > new server - Cygwin has "scp" command and lucky it compatible with Foreman. > > > So, instead of changing Foreman code I decided to mimic a Linux > environment in a Windows Server VMWare template. > > The template Windows Server must have: > > 1) Cygwin installed - https://www.cygwin.com/ > > 2) Cygwin SSHD service configured - > http://www.noah.org/ssh/cygwin-sshd.html > > 2.1) SSHD server *must be *starting when Windows starts > > > 3) Puppet Agent For Windows must be installed > > Foreman server must have a finish shell script associated with Windows OS > or environment, etc... > This Foreman finish template for Windows should contain *Windows commands* > to configure all aspects of provisioning server - i.e. IP addresses, DNS > servers, gateways, etc... > > Sorry I've lost the Foreman finish template for Windows I've made - so you > will need to figure all necessary commands by yourself: > > ---- > *#!/bin/bash* > > *cmd.exe /c "command line 1 - change IP address..."* > > *cmd.exe /c "command line 2 - chage default gateway..."* > > *cmd.exe /c "command line 3 - change DNS servers..." * > *cmd.exe /c "command line 4 - change default gateway..."* > > *cmd.exe /c "command line 5 - configure Puppet Agent..."* > > *cmd.exe /c "command line 6 - do something else...."* > > *.....* > *.....* > > *# Disable (or delete) Cygwin SSH server - if you won't need it in the > future"* > *cmd.exe /c "sc config sshd start= disabled"* > > *# you can even schedule wiping out of Cygwin folder if you want....* > > # reboot new Windows server... > *cmd.exe /c "shutdown.exe /r /t 0" * > ---- > > > > > > > > > > > You have to program all > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Wednesday, June 4, 2014 at 5:39:27 AM UTC-7, Alexandre Barth wrote: >> >> Hello ! >> >> I'm using VmWare. With Foreman 1.5.0, we can now deploy hosts from >> templates, but it seems to be designed for linux hosts as we have to >> provide ssh information... I deploy my linux hosts using PXE and TFTP, and >> i was really waiting for this feature for windows hosts. >> I tried to deploy an windows host with the new feature, it works, leaving >> blank the ssh informations fields, but something is missing : the ability >> to choose a customization specification from vmware, which would replace >> the ssh part for linux hosts. >> >> Can this new feature be adapted for windows hosts plz ? >> >

Hello, any luck with passing customization spec? I have got few approaches
which I will be giving a try in next couple of days

Option I
Update the VMWare template to have cygwin ssh to allow ssh access from
Foreman and having the "finish" provisioning template calling powershell
automation/sysprep activities

Option II

  • Run sysprep and SCCM build during the first boot using the template
  • invoke puppet agent run once when registering with the puppet master
    (disadvantage is have to hard code the puppetmaster server url rather than
    having it as a configurable parameter during provisioning)
  • register with Foreman using the api call

I will be attempting the above methods in next few days and will post my
findings (might be helpful for other users of Foreman).

I was hoping if someone has already achieved any other way to get Windows
VM provisioning using Foreman and Puppet, then it would be a helpful
reference for us. Best option in my opinion would be to fetch the
customisation spec using Fog and get it integrated Foreman during the
provisioning process. I have seen the code for Fog and believe this is
doable but probably not in the timescales that I am currently working. If I
am able to get that working, I would surely attempt to contribute that
back.

any other feedback or pointer on this is always welcome.

Regards
Soumen

··· On Friday, June 6, 2014 10:42:05 AM UTC+1, Alexandre Barth wrote: > > Apparently vmware compute resource can't use user_data script, only a > finish script pushed via ssh. I just would like to be able to choose a > customizaton specification in foreman, instead of ssh parameters. > > Le mercredi 4 juin 2014 23:24:48 UTC+2, Dylan Charleston a écrit : >> >> I have been deploying both Windows and Linux hosts with Foreman for a >> while now using a network based installation. Recently, I started >> deploying hosts in AWS using user-data scripts for both Windows and Linux. >> The user data script simply downloads a powershell or shell script from >> github to provision the hosts. We'll begin using images on our VMWare >> clusters and will adopt a similar approach as AWS. I plan to just bake the >> script which downloads the provision scripts from github into the images >> and configure it to run on first boot. This way we can modify the >> provision steps without have to recreate the image. This is a workaround >> for Windows until Foreman can support winrm, but I'm not sure when or if >> that will happen as I think most people use Foreman for nix systems. >> >> On Wednesday, June 4, 2014 5:39:27 AM UTC-7, Alexandre Barth wrote: >>> >>> Hello ! >>> >>> I'm using VmWare. With Foreman 1.5.0, we can now deploy hosts from >>> templates, but it seems to be designed for linux hosts as we have to >>> provide ssh information... I deploy my linux hosts using PXE and TFTP, and >>> i was really waiting for this feature for windows hosts. >>> I tried to deploy an windows host with the new feature, it works, >>> leaving blank the ssh informations fields, but something is missing : the >>> ability to choose a customization specification from vmware, which would >>> replace the ssh part for linux hosts. >>> >>> Can this new feature be adapted for windows hosts plz ? >>> >>

Hello Evgeny,

I was hoping you could elaborate on the template based provisioning for
Windows hosts using Foreman. I have an ESXi 5.5 setup and would like to
provision single hosts that are not in a cluster. I was hoping to do this
without having to set up vSphere server. Is this possible?

Thanks!

··· On Tuesday, November 11, 2014 12:36:05 AM UTC-8, Evgeny Vasilchenko wrote: > > I have elaborated a VMWare template based provisioning of Windows hosts > using Foreman. > It does not require any modifications of Foreman, or having WDS servers, > etc... - standard VMWare, VM template and Windows FINISH CMD script. > > Will post an update here when all will be ready - maybe a day or so... > > thx... > > > On Friday, November 7, 2014 4:39:17 PM UTC-8, Evgeny Vasilchenko wrote: >> >> I'm VERY interested in this feature too. >> >> On Wednesday, June 4, 2014 5:39:27 AM UTC-7, Alexandre Barth wrote: >>> >>> Hello ! >>> >>> I'm using VmWare. With Foreman 1.5.0, we can now deploy hosts from >>> templates, but it seems to be designed for linux hosts as we have to >>> provide ssh information... I deploy my linux hosts using PXE and TFTP, and >>> i was really waiting for this feature for windows hosts. >>> I tried to deploy an windows host with the new feature, it works, >>> leaving blank the ssh informations fields, but something is missing : the >>> ability to choose a customization specification from vmware, which would >>> replace the ssh part for linux hosts. >>> >>> Can this new feature be adapted for windows hosts plz ? >>> >>

Hi Corey,

So far I know Foreman VMWare module does work with SSH only. It uses scp
over SSH to transfer a "finish" shell script to the target hosts. In case
of Windows VM templete Cygwin + SSH server, tricks Foreman into believing
that it deals with a Linux host. All Foreman cares is SCP connection to the
target host. It transfers and runs the finish script which then sets all
IP/DNS, Puppet stuff using series of CMD commands. I've never tried to use
VCenter provisioning templates, sorry. To be honest this scripted way works
as a charm -so, i did not have a reason for this.

Maybe modules for other computing enviroments supports WinRM but not the
VMWare one. Or I'm not aware of this.

Feel free to ask questions.

Evgeny

··· On Sunday, February 8, 2015, Corey Osman wrote:

Thanks for replying. That is about what I expected. Did you happen to
mess with WinRM instead of ssh? Or is foreman too tied to ssh?

Also were you able to use the provisioning templates in vcenter to auto
assign IP/DNS and other capabilities? I think this is an important part
that is missing form the foreman/vcenter integration.

Corey

On Friday, February 6, 2015 at 12:21:45 PM UTC-8, Evgeny Vasilchenko wrote:

Hi,

I apologize for being silent - I did no have a chance to finalize the
solution …I was quite busy last few months.
The solution I’ve tried worked fine … up to some point. I’m pretty sure
someone will be able to finalize it.

So, Foreman VM template provisioning and finish scripts were designed for
Linux/Unix systems with an SSH server starting by default.
Also Foreman uses Linux “scp” command to transfer ready finish script to
a new server - Cygwin has “scp” command and lucky it compatible with
Foreman.

So, instead of changing Foreman code I decided to mimic a Linux
environment in a Windows Server VMWare template.

The template Windows Server must have:

  1. Cygwin installed - https://www.cygwin.com/

  2. Cygwin SSHD service configured - http://www.noah.org/ssh/
    cygwin-sshd.html

2.1) SSHD server *must be *starting when Windows starts

  1. Puppet Agent For Windows must be installed

Foreman server must have a finish shell script associated with Windows OS
or environment, etc…
This Foreman finish template for Windows should contain Windows
commands
to configure all aspects of provisioning server - i.e. IP
addresses, DNS servers, gateways, etc…

Sorry I’ve lost the Foreman finish template for Windows I’ve made - so
you will need to figure all necessary commands by yourself:


#!/bin/bash

cmd.exe /c “command line 1 - change IP address…”

cmd.exe /c “command line 2 - chage default gateway…”

*cmd.exe /c “command line 3 - change DNS servers…” *
cmd.exe /c “command line 4 - change default gateway…”

cmd.exe /c “command line 5 - configure Puppet Agent…”

cmd.exe /c “command line 6 - do something else…”


# Disable (or delete) Cygwin SSH server - if you won’t need it in the
future"

cmd.exe /c “sc config sshd start= disabled”

# you can even schedule wiping out of Cygwin folder if you want…

reboot new Windows server…

*cmd.exe /c “shutdown.exe /r /t 0” *

You have to program all

On Wednesday, June 4, 2014 at 5:39:27 AM UTC-7, Alexandre Barth wrote:

Hello !

I’m using VmWare. With Foreman 1.5.0, we can now deploy hosts from
templates, but it seems to be designed for linux hosts as we have to
provide ssh information… I deploy my linux hosts using PXE and TFTP, and
i was really waiting for this feature for windows hosts.
I tried to deploy an windows host with the new feature, it works,
leaving blank the ssh informations fields, but something is missing : the
ability to choose a customization specification from vmware, which would
replace the ssh part for linux hosts.

Can this new feature be adapted for windows hosts plz ?


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/foreman-users/mjzYP0ZCO98/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com
<javascript:_e(%7B%7D,‘cvml’,‘foreman-users%2Bunsubscribe@googlegroups.com’);>
.
To post to this group, send email to foreman-users@googlegroups.com
<javascript:_e(%7B%7D,‘cvml’,‘foreman-users@googlegroups.com’);>.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Curious if there was any final resolution here. Looking to do the exact
same thing.

··· On Thursday, September 25, 2014 1:20:35 PM UTC-7, soumen trivedi wrote: > > Hello, any luck with passing customization spec? I have got few approaches > which I will be giving a try in next couple of days > > Option I > Update the VMWare template to have cygwin ssh to allow ssh access from > Foreman and having the "finish" provisioning template calling powershell > automation/sysprep activities > > Option II > - Run sysprep and SCCM build during the first boot using the template > - invoke puppet agent run once when registering with the puppet master > (disadvantage is have to hard code the puppetmaster server url rather than > having it as a configurable parameter during provisioning) > - register with Foreman using the api call > > > I will be attempting the above methods in next few days and will post my > findings (might be helpful for other users of Foreman). > > I was hoping if someone has already achieved any other way to get Windows > VM provisioning using Foreman and Puppet, then it would be a helpful > reference for us. Best option in my opinion would be to fetch the > customisation spec using Fog and get it integrated Foreman during the > provisioning process. I have seen the code for Fog and believe this is > doable but probably not in the timescales that I am currently working. If I > am able to get that working, I would surely attempt to contribute that > back. > > any other feedback or pointer on this is always welcome. > > Regards > Soumen > > On Friday, June 6, 2014 10:42:05 AM UTC+1, Alexandre Barth wrote: >> >> Apparently vmware compute resource can't use user_data script, only a >> finish script pushed via ssh. I just would like to be able to choose a >> customizaton specification in foreman, instead of ssh parameters. >> >> Le mercredi 4 juin 2014 23:24:48 UTC+2, Dylan Charleston a écrit : >>> >>> I have been deploying both Windows and Linux hosts with Foreman for a >>> while now using a network based installation. Recently, I started >>> deploying hosts in AWS using user-data scripts for both Windows and Linux. >>> The user data script simply downloads a powershell or shell script from >>> github to provision the hosts. We'll begin using images on our VMWare >>> clusters and will adopt a similar approach as AWS. I plan to just bake the >>> script which downloads the provision scripts from github into the images >>> and configure it to run on first boot. This way we can modify the >>> provision steps without have to recreate the image. This is a workaround >>> for Windows until Foreman can support winrm, but I'm not sure when or if >>> that will happen as I think most people use Foreman for nix systems. >>> >>> On Wednesday, June 4, 2014 5:39:27 AM UTC-7, Alexandre Barth wrote: >>>> >>>> Hello ! >>>> >>>> I'm using VmWare. With Foreman 1.5.0, we can now deploy hosts from >>>> templates, but it seems to be designed for linux hosts as we have to >>>> provide ssh information... I deploy my linux hosts using PXE and TFTP, and >>>> i was really waiting for this feature for windows hosts. >>>> I tried to deploy an windows host with the new feature, it works, >>>> leaving blank the ssh informations fields, but something is missing : the >>>> ability to choose a customization specification from vmware, which would >>>> replace the ssh part for linux hosts. >>>> >>>> Can this new feature be adapted for windows hosts plz ? >>>> >>>

Hi All,

I am wondering anybody has succeed with Windows provisioning using Foreman
templates. Please let me know if anyone created Windows finish script to
deploy Windows OS in Vmware Vcenter.

Regards,

Shankar

··· On Tuesday, November 11, 2014 at 7:51:56 PM UTC-8, matthew hopkins wrote: > > Hello Evgeny, > > I was hoping you could elaborate on the template based provisioning for > Windows hosts using Foreman. I have an ESXi 5.5 setup and would like to > provision single hosts that are not in a cluster. I was hoping to do this > without having to set up vSphere server. Is this possible? > > Thanks! > > On Tuesday, November 11, 2014 12:36:05 AM UTC-8, Evgeny Vasilchenko wrote: >> >> I have elaborated a VMWare template based provisioning of Windows hosts >> using Foreman. >> It does not require any modifications of Foreman, or having WDS servers, >> etc... - standard VMWare, VM template and Windows FINISH CMD script. >> >> Will post an update here when all will be ready - maybe a day or so... >> >> thx... >> >> >> On Friday, November 7, 2014 4:39:17 PM UTC-8, Evgeny Vasilchenko wrote: >>> >>> I'm VERY interested in this feature too. >>> >>> On Wednesday, June 4, 2014 5:39:27 AM UTC-7, Alexandre Barth wrote: >>>> >>>> Hello ! >>>> >>>> I'm using VmWare. With Foreman 1.5.0, we can now deploy hosts from >>>> templates, but it seems to be designed for linux hosts as we have to >>>> provide ssh information... I deploy my linux hosts using PXE and TFTP, and >>>> i was really waiting for this feature for windows hosts. >>>> I tried to deploy an windows host with the new feature, it works, >>>> leaving blank the ssh informations fields, but something is missing : the >>>> ability to choose a customization specification from vmware, which would >>>> replace the ssh part for linux hosts. >>>> >>>> Can this new feature be adapted for windows hosts plz ? >>>> >>>