Giter VIP home page Giter VIP logo

wimaging's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wimaging's Issues

Statically defined deployment share

Do we really need to define %deploymentShare% in the init scripts?

You do this:

ping -n 1 %deploymentShare% > NUL

and then

echo Downloading Setup Script %deployRoot%\wget.vbs http://%foremanHost%/unattended/script %deployRoot%\peSetup.cmd

I'd rather check the network availability by pinging the %foremanHost%

and move all the logic responsible for mounting/interacting with the %deploymentShare% to foreman script.

This would help in situations where there are multiple locations or networks in our deployment that require %deploymentShare% to differ slightly.

Let me know what you think and I will work on this.

Windows 7 support

Hi Dmirty,

I need to add support for windows7, which I nearly got working on my end, but before I start submitting changes, a question to you is - do you have any preference as to what the $os variable should be?

You use $os = "server-2008r2" as an example.

ipxe / bootdisk

We have several static only vlans that we use Foreman bootdisk and ipxe for on Linux.
Have you guys ever done anything like this for Windows? Is there a way to make ipxe work with wimaging or wimboot? Do you know of an alternative for Foreman?

kudos

first kudos to you for this project.

I plan on modifying this to do a few things
I only really focus on 2012 deployments, so I have been trying to get everything into an image offline, without using a hyperv to instantiate and recapture.

  1. idempotent management around the wim. config file driven like you have.
  2. ease of use. feature injection simplification, ie $tftp=present for all the features
  3. include offlinewsus capability, with ease of use. devise a method to eliminate any intervention

pxelinux template issue with linux.c32

Hi,

I'm having the same problem as issue #28

I'm running foreman 1.10 on CentOS 7.
Test pxe client is on a VirtualBox VM with 8GB of ram and a hard disk VMDK with 250GB.

I was getting the "Kernel load failure (insufficient memory?)" error when using linux.c32 from syslinux4.05 that can be installed from the CentOS7 repos so I tried what @ishtartec mentioned on issue #28 and downloaded syslinux5.10 from:
https://www.kernel.org/pub/linux/utils/boot/syslinux/5.xx/
and used the linux.c32 file there with foreman tftp, but now I get an error that says "linux.c32: not a COM32R image".

Does anyone know what I could be missing?
Thanks.

Params.ps1 using constant instead of variable for DISM location

This caused a couple of hours of grief but thankfully I've sorted it.

Functions.ps1, Line 221 reads:

Invoke-Expression "& 'dism' /mount-wim /wimfile:$wim_file /mountdir:$mount_dir /name:'$wim_image_name'"

It should read:

Invoke-Expression "& '$dism' /mount-wim /wimfile:$wim_file /mountdir:$mount_dir /name:'$wim_image_name'"

token not getting generated for foreman_url(built)

Hi,

Is there any issue with current build I am not able to see token getting generated for built option.

Token generated for finish, provision and user_data
image

No token generated for built.

image

Below is the trace of prxoy.log

D, [2016-07-20T12:47:18.395768 #2618] DEBUG -- : Retrieving a template from http://sdin-swt-ct-04.sdcorp.global.com:8000//unattended/built?token=527dc2a4-ad34-4821-bdb1-b73f3f348498&url=http%3A%2F%2Fsdin-swt-ct-04.sdcorp.global.com%3A8000
D, [2016-07-20T12:47:18.395998 #2618] DEBUG -- : HTTP headers: {"X-Forwarded-For"=>"10.65.225.158, sdin-swt-ct-04.sdcorp.global.com", "ACCEPT_LANGUAGE"=>"en-US,en;q=0.8", "UPGRADE_INSECURE_REQUESTS"=>"1", "CONNECTION"=>"keep-alive", "ACCEPT_ENCODING"=>"gzip, deflate, sdch", "CACHE_CONTROL"=>"max-age=0", "USER_AGENT"=>"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36", "ACCEPT"=>"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8"}
E, [2016-07-20T12:47:18.482038 #2618] ERROR -- : Failed to retrieve built template for {"token"=>"527dc2a4-ad34-4821-bdb1-b73f3f348498", "kind"=>"built"}: Error retrieving built for {"token"=>"527dc2a4-ad34-4821-bdb1-b73f3f348498", :url=>"http://sdin-swt-ct-04.sdcorp.global.com:8000"} from sdin-swt-ct-04.sdcorp.global.com: Net::HTTPInternalServerError
D, [2016-07-20T12:47:18.482130 #2618] DEBUG -- : Error retrieving built for {"token"=>"527dc2a4-ad34-4821-bdb1-b73f3f348498", :url=>"http://sdin-swt-ct-04.sdcorp.global.com:8000"} from sdin-swt-ct-04.sdcorp.global.com: Net::HTTPInternalServerError (RuntimeError)
/usr/share/foreman-proxy/modules/templates/template_proxy_request.rb:24:in get_template' /usr/share/foreman-proxy/modules/templates/templates_api.rb:19:inGET /:kind'
/usr/share/foreman-proxy/lib/proxy/helpers.rb:14:in log_halt' /usr/share/foreman-proxy/modules/templates/templates_api.rb:18:inGET /:kind'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:863:in call' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:863:inroute'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:521:in instance_eval' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:521:inroute_eval'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:500:in route!' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:497:incatch'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:497:in route!' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:476:ineach'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:476:in route!' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:601:indispatch!'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:411:in call!' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:ininstance_eval'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:in invoke' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:incatch'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:in invoke' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:411:incall!'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:399:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:incall'
/usr/share/foreman-proxy/lib/proxy/log.rb:60:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:incall'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:979:in call' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:1005:insynchronize'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:979:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb:47:incall'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb:41:in each' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb:41:incall'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:77:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:incall'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:48:in service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:inservice'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:173:instart_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in start' /usr/lib/ruby/1.8/webrick/server.rb:162:instart_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/lib/ruby/1.8/webrick/server.rb:92:ineach'
/usr/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/lib/ruby/1.8/webrick/server.rb:23:instart'
/usr/lib/ruby/1.8/webrick/server.rb:82:in start' /usr/share/foreman-proxy/lib/launcher.rb:137:inlaunch'
/usr/share/foreman-proxy/lib/launcher.rb:137:in initialize' /usr/share/foreman-proxy/lib/launcher.rb:137:innew'
/usr/share/foreman-proxy/lib/launcher.rb:137:in `launch'
/usr/share/foreman-proxy/bin/smart-proxy:6
I, [2016-07-20T12:47:18.482402 #2618] INFO -- : 10.65.225.158 - - [20/Jul/2016 12:47:18] "GET /built?token=527dc2a4-ad34-4821-bdb1-b73f3f348498 HTTP/1.1" 500 320 0.0879

Finish Provision Template

@echo off
echo Activating administrator
net user administrator /active:yes
echo "10.65.168.18 sdin-swt-ct-04.sdcorp.global.com" > C:\Windows\System32\drivers\etc\hosts

set ctr=0
set nettimeout=10
set nwhost=sdin-swt-ct-04.sdcorp.global.com

(echo Updating time)
(sc config w32time start= auto)
sc start w32time
:ntp_testip
::ipconfig /renew
ping -n 1 %nwhost% > NUL
if %errorlevel% == 0 goto ntp_testip_ok
timeout /t 10 >NUL
set /a ctr=ctr+1
echo Retry network. Run %ctr% time(s)
if %ctr% GTR %nettimeout% (
echo Network error! Exiting.
exit 1
)
goto ntp_testip
:ntp_testip_ok

echo Ping to %nwhost% OK!

echo sync time
w32tm /resync
w32tm /resync

:: You can join your machine to the domain right here >

:: < You can join your machine to the domain right here

echo safely remove files
sdelete.exe -accepteula -p 2 -r c:\wimaging
sdelete.exe -accepteula -p 2 c:\Windows\Panther\unattend.xml
sdelete.exe -accepteula -p 2 C:\Windows\Setup\Scripts\SetupComplete.cmd
sdelete.exe -accepteula -p 2 -r c:\minint
sdelete.exe -accepteula -p 2 -r c:\wimaging

echo Running extra commands

@echo off
echo Installing puppet
start /w "" msiexec /qn /i C:\extras\puppet.msi PUPPET_AGENT_STARTUP_MODE=Manual PUPPET_MASTER_SERVER="sdin-swt-ct-04.sdcorp.global.com"
echo set puppet to auto start
sc config puppet start= auto
sc query puppet
echo cleaning up extras
sdelete.exe -accepteula -p 2 -r c:\extras

echo Tell foreman build mode has finished
wget.exe http://sdin-swt-ct-04.sdcorp.global.com:8000/unattended/built?token=527dc2a4-ad34-4821-bdb1-b73f3f348498

sdelete.exe -accepteula -p 2 -r c:\deploy

echo remove leftover directories
rmdir /s /q c:\wimaging
rmdir /s /q c:\minint
rmdir /s /q c:\deploy
rmdir /s /q c:\extras

echo rebooting...
shutdown /r /t 5

Let me know if you need more information.

Thanks
-Vishal Sarin

Windows booting into Recovery screen

I had the same issue mentioned earlier (issue #31 ), where i copied the "tell foreman" part to the instal script, which seems to have updated the tftp file to boot from disk on the foreman server, rather than keep getting stuck in the PXE/reimaging loop. However, when the VM boots again to book from from local disk, it ends up at the "Recovery Screen" for windows. I'm not sure if this is due to me not copying the "tell foreman" part correctly, or some other driver issue.

pxelinux template issue

Hi,
the issue is not with the template itself but with the PXE netboot:
Currently using foreman 1.9 and Ubuntu 14

  1. linux.c32 is not included by default in tftp, so I've copied the one from: /usr/lib/syslinux/linux.c32
  2. Using linux.c32 from syslinux 5 does not seem an option as booting complains about "not a COM32R" image, so I just keep the original from ubuntu.
  3. When using the "original template":
DEFAULT menu
LABEL menu
     COM32 linux.c32 boot/wimboot
     APPEND initrdfile=boot/windows-x64/bcd,boot/windows-x64/boot.sdi,boot/windows-x64/boot.wim

The netboot ends with Kernel load failure (insufficient memory?)

  1. Trying a adding boot/wimboot to append:
DEFAULT menu
LABEL menu
     COM32 linux.c32
     APPEND boot/wimboot initrdfile=boot/windows-x64/bcd,boot/windows-x64/boot.sdi,boot/windows-x64/boot.wim

This goes a bit better but errors in:

wimboot v2.5.1 -- Windows Imaging Format bootloader -- http://ipxe.org/wimboot

Command line: "BOOT_IMAGE=boot/wimboot initrdfile=boot/windows-x64/bcd,boot/windows-x64/boot.sdi,boot/windows-x64/boot.wim"
Emulating drive 0x81
FATAL: no bootmgr.exe
Press any key to reboot...

Any ideas?
Thanks for the great job!

Trouble with PXE boot

Environment: Foreman, VMWare and trying to build windows 2016 VMs using foreman.
Getting stuck in the wimboot process. The VM pxe boots, then downloads wimboot but then fails on boot.sdi and boot.wim.
Is there a good documentation or suggestion to make the pxeboot work with wimboot to provision windows VMs?

Regards,
Rangaa

Windows 7 installation

So I have been working on several types of Windows installations with Foreman and I could not figure out what was causing the dism error when installing Windows 7. After changing the default pesetup file so i could check out what was going wrong I found that the dism command to apply the image does not work with Windows 7.

To get this to work you need the imagex tool which can be found in WAIK for windows 7. I solved this by adding the imagex files to the extras directory on my repo. I changed the pesetup.cmd to download the extras directory before applying the image and than use the imagex tool to actually apply the image. I think editing the current pesetup.cmd to somthing like shown below would help. In addition to that some instruction could be made to notify people about the imagex requirement.

<% if @host.operatingsystem.minor.to_i > 1 -%> (windows nt version of windows 7 is 6.1 )
dism.exe /apply-image /ImageFile:C:\install.wim /Index:1 /ApplyDir:C:
<% else -%>
C:\Extras\imagex.exe /apply C:\install.wim 1 C:
<% end %>

Like I said i used the extras directory to add the imagex executable during the installation. There might be a more elegant way to do this for example by adding an other directory. If you want the dirty way :-) just put this after the wget that retrieves the install.wim.

echo Downloading extras
md C:\Extras
%WGET% -P c:\Extras -r -np -nH --cut-dirs=3 -R index.html -q --level=0 <%= @host.os.medium_uri(@host).to_s %>/extras/

I don't mind helping with adding this to the current code, but i'm kinda a nub at git(hub) so I don't want to mess things up.

And thanks for the scripts kireevco made everything a whole lot easier! :-)

PXE template does not work?

I am trying to figure out how the PXE template is working. So far, only hard coding the boot files works for me. Maybe you can help me with some insight.

Shouldn't the template download the files required from installation media? If so, can this work by using the ps - scripts; the boot wim is not pushed to right folder?

Warning!

There was an error rendering the WAIK default PXELinux template: undefined method 'arch' for Host::Managed::Jail (Host::Managed)

Replacing arch with some other host marco @host.architecture I got form here does no good either:

PXELinux template: undefined method 'bootfile' for Operatingsystem

Btw, I am running foreman 1.9.1

Bootloop

At first I would like to thank you for the work you have invested in this project.

I'm testing wimaging to deploy win7 ATM and wimaging_script_winpe_setup is finishing without errors but then a reboot occurs and, since we did not notify foreman that we have successfully installed the os, the machine is retrieving the images once again, resulting in a bootloop. So I moved the notify foreman part from the finishing scipt to the setup script, but then the finish script cannot run without error since its not allowed to download the provision script (error 405).Such a severe flaw cannot have been overlooked by you so I am wondering if I misconfigured anything?

Again thank you for your help..

2012 Server

Hello @kireevco ,

Do you plan to have the tool ready for 2012 server in a near futur?

Thanks,

Matthieu

Downloading Setup Script: ERROR 404 Not Found

Hello,

I am having a problem with WinPE that keeps trying to look for an /unattended/script file but it doesn't find it.

image

The templates WAIK peSetup, WAIK provision unattended.xml, WAIK PXE Linux, WAIK finish, WAIK local users, WAIK extra finish commands all came from this the git master wimaging. They all render without any issue reporting but for some reason it always craps out at the "Downloading Setup Script"
WinPE loads correctly, starts Networking, then it complains the subsystem needed to support the image type is not present. Then "ping to puppet.domain.com OK! Your IP Address. And then it errors out at the "Downloading Setup Script"

Can anybody help out? Also can anybody explain what part of the template is not working? Would I be correct to assume that the template that is not working is the WAIK peSetup and if so, that link" http://puppet.domain.com/unattended/script:
Where is that in the code for the WAIK peSetup template? Please help.

Thank You

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.