K2000 - Peer to peer deployment


This is a proof of concept I test on few computers.


* A working bittorrent tracker and at least one computer seeding the wim image you want to deploy. You cant grab it in \\k2000\peinst\wim\<num>\C_C.wim
* An empty system image deployment. You can create one by capturing an empty partition in wim file.

The Kace side

I'm using aria2c to leech and seed the wim file. As long as the computer don't reboot it is continuing to seed. Here's how I did it :

start "" "%~dp0aria2c.exe" "%~dp0C_C.wim.torrent" --on-bt-download-complete="%~dp0echo.bat"  --summary-interval=0 --seed-ratio=0.0 --dir=c:\Kace --enable-dht=false --enable-dht6=false --file-allocation=none
@"%~dp0timeout.exe" /t 10 > nul
@IF NOT EXIST "%TEMP%\fini.txt" GOTO loop
imagex.exe /apply "c:\Kace\C_C.wim" 1 c:\
I'am using the start command to create a new process that will be up until the next reboot.

The aria2c options explained :

--on-bt-download-complete="%~dp0echo.bat" : action to execute at file download complete and still seeding
--summary-interval=0 : don't dispaly any summary
--seed-ratio=0.0 : no seed limit
--dir=c:\Kace : ooutput directory. I'm using the Kace one, in this way the file is automatically deleted at the en of the deployment process
--enable-dht=false --enable-dht6=false : disabling dht, this seed must stay private
--file-allocation=none : we don't need to pre allocate the file, the drive is empty

After aria2c is launch, every 10s I check if the file %TEMP%\fini.txt exist. This file is created at the end of the file download with the echo.bat script :

echo fini > "%TEMP%\fini.txt"

Then the image is deployed with imagex.

So I create a pre-install task with the files :

    Deploy.bat : the main script
    echo.bat : the deployment finish flag creator
    timeout.exe : this utility is not include in my KBE so I take it from windows.

And then the system image deployment based on an empty image :


That's it!

Additionally you can vote for my UserVoice request about  peer to peer deployment ;-) :


This post is locked

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ