WDS avec Syslinux et install ESXi
Je vais ajouter Syslinux à WDS pour me permettre de faire du déploiement Windows mais également le déploiement de mes esxi
Je me suis basé sur l’article suivant : https://www.veeam.com/blog/windows-deployment-service-guide.html
Dans cet article tous sera scripté car dans mon cas ce WDS sera installé sur beaucoup de sites distants.
Téléchargement de Syslinux
Il faudra télécharger les sources de syslinux depuis : http://www.kernel.org/pub/linux/utils/boot/syslinux/
On utilisera la version 3.86, les versions ultérieures semblent ne pas fonctionner (à confirmer)
On gardera uniquement les fichiers suivants :
- syslinux-3.86\core\pxeLinux.0
- syslinux-3.86\com32\menu\vesamenu.c32
- syslinux-3.86\com32\modules\chain.c32
Installation de WDS
Installation et initialisation de WDS
1 2 3 4 5 |
Install-WindowsFeature wds-deployment -includemanagementtools write-host 'wdsutil /initialize-server' $wdsUtilResults = wdsutil /initialize-server /remInst:"c:\RemoteInstall" $wdsUtilResults | select -last 1 write-host ' ' |
Ajout des fichiers de boot
1 2 3 4 5 6 7 |
$CurrentPath = split-path $SCRIPT:MyInvocation.MyCommand.Path -parent write-host 'Add Boot Image to WDS' Get-WdsBootImage | Remove-WdsBootImage Import-WdsBootImage -Path "$CurrentPath\boot.wim" -NewImageName "LANDESK 32 Bits" Import-WdsBootImage -Path "$CurrentPath\boot_x64.wim" -NewImageName "LANDESK 64 Bits" Net start WDSServer write-host ' ' |
Configuration de WDS
1 2 3 4 5 6 7 8 9 10 11 12 |
write-host 'wdsutil /Set-Server /AnswerClients:All' $wdsUtilResults = wdsutil /Set-Server /AnswerClients:All $wdsUtilResults | select -last 1 write-host ' ' write-host 'wdsutil /Set-Server /PxepromptPolicy /New:Noprompt' $wdsUtilResults = wdsutil /Set-Server /PxepromptPolicy /New:Noprompt $wdsUtilResults | select -last 1 write-host ' ' write-host 'wdsutil /Set-Server /PxepromptPolicy /Known:Noprompt' $wdsUtilResults = wdsutil /Set-Server /PxepromptPolicy /Known:Noprompt $wdsUtilResults | select -last 1 write-host ' ' |
Ajout de SYSLINUX dans WDS
Copie des fichiers Syslinux
1 2 3 4 5 6 7 8 9 10 11 12 |
write-host 'Copy Syslinux' copy-item -path "$CurrentPath\syslinux-3.86\core\pxeLinux.0" -Destination "c:\RemoteInstall\Boot\x64\pxeLinux.com" -Force copy-item -path "$CurrentPath\syslinux-3.86\com32\menu\vesamenu.c32" -Destination "c:\RemoteInstall\Boot\x64\vesamenu.c32" -Force copy-item -path "$CurrentPath\syslinux-3.86\com32\modules\chain.c32" -Destination "c:\RemoteInstall\Boot\x64\chain.c32" -Force copy-item -path "$CurrentPath\syslinux-3.86\core\pxeLinux.0" -Destination "c:\RemoteInstall\Boot\x86\pxeLinux.com" -Force copy-item -path "$CurrentPath\syslinux-3.86\com32\menu\vesamenu.c32" -Destination "c:\RemoteInstall\Boot\x86\vesamenu.c32" -Force copy-item -path "$CurrentPath\syslinux-3.86\com32\modules\chain.c32" -Destination "c:\RemoteInstall\Boot\x86\chain.c32" -Force copy-item -path "c:\RemoteInstall\Boot\x86\pxeboot.n12" -Destination "c:\RemoteInstall\Boot\x86\pxeboot.0" -Force remove-item -path "c:\RemoteInstall\Boot\x86\pxeboot.n12" -Force -Recurse copy-item -path "c:\RemoteInstall\Boot\x64\pxeboot.n12" -Destination "c:\RemoteInstall\Boot\x64\pxeboot.0" -Force remove-item -path "c:\RemoteInstall\Boot\x64\pxeboot.n12" -Force -Recurse write-host ' ' |
Ajout de syslinux dans WDS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
write-host 'wdsutil /set-server /bootprogram:boot\x86\pxeLinux.com /architecture:x86' $wdsUtilResults = wdsutil /set-server /bootprogram:boot\x86\pxeLinux.com /architecture:x86 $wdsUtilResults | select -last 1 write-host ' ' write-host 'wdsutil /set-server /N12bootprogram:boot\x86\pxeLinux.com /architecture:x86' $wdsUtilResults = wdsutil /set-server /N12bootprogram:boot\x86\pxeLinux.com /architecture:x86 $wdsUtilResults | select -last 1 write-host ' ' write-host 'wdsutil /set-server /bootprogram:boot\x64\pxeLinux.com /architecture:x64' $wdsUtilResults = wdsutil /set-server /bootprogram:boot\x64\pxeLinux.com /architecture:x64 $wdsUtilResults | select -last 1 write-host ' ' write-host 'wdsutil /set-server /N12bootprogram:boot\x64\pxeLinux.com /architecture:x64' $wdsUtilResults = wdsutil /set-server /N12bootprogram:boot\x64\pxeLinux.com /architecture:x64 $wdsUtilResults | select -last 1 write-host ' ' |
Création du menu Syslinux (celui qui sera affiché apres le F12)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
write-host 'Create Default menu' If (!(test-path c:\RemoteInstall\Boot\x64\pxeLinux.cfg)) {New-Item -ItemType directory -Path c:\RemoteInstall\Boot\x64\pxeLinux.cfg} If (!(test-path c:\RemoteInstall\Boot\x86\pxeLinux.cfg)) {New-Item -ItemType directory -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg} If (test-path c:\RemoteInstall\Boot\x64\pxeLinux.cfg\default) {remove-Item -Path c:\RemoteInstall\Boot\x64\pxeLinux.cfg\default -Force -Recurse} If (test-path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default) {remove-Item -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Force -Recurse} Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'DEFAULT vesamenu.c32' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'PROMPT 0' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'NOESCAPE 0' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'ALLOWOPTIONS 1' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'TIMEOUT 0' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'MENU MARGIN 0' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'MENU ROWS 16' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'MENU TABMSGROW 21' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'MENU TIMEOUTROW 26' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'MENU COLOR BORDER 30;44 #20ffffff #00000000 none' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'MENU COLOR SCROLLBAR 30;44 #20ffffff #00000000 none' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'MENU COLOR TITLE 0 #ffffffff #00000000 none' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'MENU COLOR SEL 30;47 #40000000 #20ffffff' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'MENU BACKGROUND flow.jpg' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'MENU TITLE PXE Boot Menu' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value '#---' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'LABEL wds' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'MENU LABEL ^1 - LANDESK' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'MENU DEFAULT' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'KERNEL pxeboot.0' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value '#---' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'LABEL scripted-ESXi55-HP_STORE' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'KERNEL ESXi55-HP\mboot.c32' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'APPEND -c ESXi55-HP\boot.cfg ofi= srv=' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value 'MENU LABEL ^2 - ESXi HP STORE Scripted Installer' Add-Content -Path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Value copy-item -path c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default -Destination c:\RemoteInstall\Boot\x64\pxeLinux.cfg\default -Force write-host ' ' |

Sources Esxi
Télécharger l’ISO Esxi , puis copier son contenu dans :
- c:\RemoteInstall\Boot\x86\Esxi67
- c:\RemoteInstall\Boot\x64\Esxi67
On va ensuite modifier le fichier
- c:\RemoteInstall\Boot\x86\Esxi67\BOOT.CFG
- c:\RemoteInstall\Boot\x64\Esxi67\BOOT.CFG
Pour supprimer tous les /
Avant

Aprés

Utilisation de IIS pour le fichier de réponse
IIS va nous servir à héberger le fichier de réponse de l’installation de VMware
Installation et configuration de IIS
1 2 3 4 |
Install-WindowsFeature Web-Server -includemanagementtools if (!(test-path "c:\Toolsesxi")) { New-Item -Path "c:\Toolsesxi" -ItemType Directory } New-WebVirtualDirectory -Site "Default Web Site" -Name "Toolsesxi" -PhysicalPath "c:\Toolsesxi" add-webconfigurationproperty //staticContent -name collection -value @{fileExtension='.cfg'; mimeType='application/octet-stream'} |
Création d’un fichier de réponse simple
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
If (test-path "c:\Toolsesxi\esxi67.cfg") {remove-Item -Path "c:\Toolsesxi\esxi67.cfg" -Force -Recurse} Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "## General Settings (mandatory) ##" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "vmaccepteula" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "rootpw Leblogosd@59" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "## Disk settings (mandatory) ##" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "install --firstdisk --overwritevmfs" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "## General Parameters (optional) ##" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "keyboard French" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "# enable & start remote ESXi Shell (SSH)" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "vim-cmd hostsvc/enable_ssh" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "vim-cmd hostsvc/start_ssh" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "#network configuration" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "network --bootproto=dhcp --device=vmnic0" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "# enable et start ESXi Shell (TSM)" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "vim-cmd hostsvc/enable_esx_shell" Add-Content -Path "c:\Toolsesxi\esxi67.cfg" -Value "vim-cmd hostsvc/start_esx_shell" |
Ajout du choix esxi dans le WDS (syslinux)
On va éditer les fichiers :
- c:\RemoteInstall\Boot\x86\pxeLinux.cfg\default
- c:\RemoteInstall\Boot\x64\pxeLinux.cfg\default
Pour ajouter noter menu
KS= utilisation du fichier de réponse pour esxi
1 2 3 4 5 |
#--- LABEL scripted-ESXi67 KERNEL Esxi67\mboot.c32 APPEND -c Esxi67\boot.cfg ks=http://172.17.0.10/Toolsesxi/esxi67.cfg MENU LABEL ^2 - ESXi 6.7 |
Voici le fichier au complet



Laisser un commentaire