This is a proof of concept I test on few computers.
Pre-requisites
* 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=noneI'am using the start command to create a new process that will be up until the next reboot.
:loop
@"%~dp0timeout.exe" /t 10 > nul
@IF NOT EXIST "%TEMP%\fini.txt" GOTO loop
imagex.exe /apply "c:\Kace\C_C.wim" 1 c:\
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 :
aria2c.exe
C_C.wim.torrent
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 ;-) :
https://kace.uservoice.com/forums/82717-k2000/suggestions/11682960-peer-to-peer-deployment
Comments