1 / 30

Gestion de parcs hétérogènes - Bpbatch

Gestion de parcs hétérogènes - Bpbatch. Olivier Pagé/Gérard Milhaud ESM2/ESIL - Université de la Méditerranée olivier.page@esm2.imt-mrs.fr gerard.milhaud@esil.univ-mrs.fr. Présentation générale. Gratuit. Non libre. Ne nécessite aucun OS spécifique. Fournit un interpréteur de commandes.

barb
Télécharger la présentation

Gestion de parcs hétérogènes - Bpbatch

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Gestion de parcs hétérogènes - Bpbatch Olivier Pagé/Gérard Milhaud ESM2/ESIL - Université de la Méditerranée olivier.page@esm2.imt-mrs.fr gerard.milhaud@esil.univ-mrs.fr

  2. Présentation générale • Gratuit. Non libre. • Ne nécessite aucun OS spécifique. • Fournit un interpréteur de commandes. • Simple, extrêmement paramétrable. • Permet le déploiement de parcs W9x / Linux. • Facilite la maintenance, mise à jour. • Peut être couplé à d ’autres solutions payantes (parc WNT/2k) • http://www.bpbatch.org

  3. Mise en œuvre . Pré-requis • Une machine modèle a été installée, paramètrée. • L ’image de cette machine a été crée et déposée sur le serveur TFTP. • Le serveur DHCP est paramétré. • La machine cliente dispose d ’une carte réseau bootable (PXE).

  4. Fonctionnement général du client. Serveur DHCP / TFTP DHCP Paramètres réseaux + nom fichier de boot + nom script TFTP fichier script.bpb TFTP fichier Bpbatch DHCP-request TFTP-request bpbatch TFTP-request nom_script.bpb Client Bpbatch

  5. Création d ’une image Linux • L ’utilitaire se nomme mrzip. • Exemple de script : mkimg.mrz • showlog • set FragmentSize="30 MB" • filter -"tmp/" • filter -"var/log" • filter -"/image" • fullzip "/" "/image/linux.imz" • commande : mrzip -b mkimg • n fichiers linux.im* de 30 Mo

  6. Création d ’une image Linux utilisation de NFS • Le script s'écrit alors: • showlog • set FragmentSize=«30 MB» • filter -«tmp/» • filter -«var/log»  • fullzip «/» «/tftpboot/linux.imz» • sur le client: • mount serveur:/tftpboot /tftpboot • cd /tftpboot;./mrzip -b mkimage

  7. Réinstallation inconditionnelle d ’une machine Linux • Créer le script linux.bpb • hidelog • setpartition«linux-ext2:2000 linux-swap:256» • setbootpart 1 • fullunzip «linux.imz» 1 • clean 2 • linuxboot«{:1}/boot/vmlinuz»«root=/dev/hda1» • C ’est tout pour bpbatch !!!!

  8. Fonctionnement général du client. Comparaison CRC cache/TFTP Serveur DHCP / TFTP DHCP Paramètres réseaux + nom fichier de boot + nom script TFTP fichier linux.imz TFTP fichier linux.im1 etc ... TFTP fichier script.bpb TFTP fichier Bpbatch TFTP-request linux.im1 DHCP-request TFTP-request bpbatch TFTP-request nom_script.bpb TFTP-request linux.imz Client Bpbatch hidelog Setpartition … Setbootpart 1 Fullunzip « linux.imz » 1

  9. Configuration serveur DHCP • Paramétrage d ’un serveur DHCP ISC 2.0 • filename «bpbatch»; • option option-135 «linux»; • option dhcp-class-identifier«PXEClient»; • option vendor-encapsulated-options 01:04:00:00:00:00:ff; • bpbatch est l ’interpréteur de commandes • option-135 : nom du script • 2 lignes pour gérer les cartes PXE.

  10. Serveur TFTP • Vérifier /etc/inetd.conf, tcp_wrapper, etc … • A noter l ’existence de serveur TFTP « enhanced »: • Linux enhanced TFTP server. • Security TFTP server. • Broadcast TFTP server. • Renommer le nom de l’interpréteur selon le type de serveur.

  11. Gestion des différences matérielles - Linux • Généralement très peu de fichiers diffèrent. • Rajouter au script linux.bpb : • if « BOOTP-Option-133 »==« matrox » copy "XF86Config.matrox" "{:1}/etc/X11/XF86Config» • if "BOOTP-Option-133"=="nvidia" copy "XF86Config.nvidia" "{:1}/etc/X11/XF86Config» • if "BOOTP-Option-134"=="maestro3" copy "modules.maestro3" "{:1}/etc/modules" • if "BOOTP-Option-134"=="ess" copy "modules.ess" "{:1}/etc/modules " • Les option-133 et option-134 sont tout simplement des options transmises au travers de DHCP.

  12. Définition de « profils » • 3 profils de machines: • machines libre accès • boot local impossible / réinstallation systèmatique. • machines personnelles • boot réseau systématique • choix réinstallation ou démarrage normal • machines exceptionnelles ou déploiement ponctuel • boot réseau possible • choix réinstallation ou démarrage normal • 3 profils <=> 1 option DHCP / 3 valeurs

  13. Empêcher le boot local • Supprimer le noyau de l ’image • Supprimer la ligne • setbootpart 1 • remplacer la ligne • linuxboot«{:1}/boot/vmlinuz»«root=/dev/hda1» • par • linuxboot«vmlinuz»«root=/dev/hda1»

  14. Interface utilisateur • hidelog • initgraph "800x600" • Drawgif "gifs/logo.gif" • :Tryagain • At 17,30 Print " (1)boot (2)reinstall :" • Waitforkey 60 goto boot • Getkey choice • if "$choice"== "1" goto boot • if "$choice"== "2" goto install • goto Tryagain • :install • setpartitions "linux-ext2:2000 linux-swap:256" • fullunzip "linux.imz" 1 • clean 2 • :boot • linuxboot "vmlinuz" "root=/dev/hda1"

  15. Saisie password • At 15,30 Print «Entrez password admin ou taper sur <enter>:» • waitforkey 60 goto install • GetPasswd userpass 8 • if «$userpass» Match-Passwd «dyOu6TzvoiF.I» goto boot • goto install • copier-coller un passwd DES.

  16. Plusieurs partitions Linux • Script de création: • fullzip « {:2} » « /tftpboot/usr.imz » • et non • fullzip « /usr » « /tftpboot/usr.imz » • Script d ’installation: • setpartitions « linux-ext2:2000 linux-ext2:2000 linux-swap:256 » • fullunzip « linux.imz » 1 • fullunzip « usr.imz » 2 • clean 3

  17. Squelette de script: • initgraph "800x600" • hidelog • Drawgif "gifs/esm2_big.gif" • if "$BOOTP-Option-129"=="multiboot" include "include/multiboot.inc" • if "$BOOTP-Option-129"=="nopass" include "include/nopass.inc" • if "$BOOTP-Option-129"=="passwd" include "include/passwd.inc" • goto $choix • :install • if "$BOOTP-Option-130" == "w98" include "include/w98.inc" • if "$BOOTP-Option-130" == "debwin" include "include/debwin.inc" • if "$BOOTP-Option-130" == "deb" include "include/deb.inc" • :boot • if "$BOOTP-Option-130"{0} == "w98" goto windows • include "include/kernel.inc" • linuxboot "{:1}/boot/$kernel" "root=/dev/hda1" • :windows • hidebootprom • if "$BOOTP-Option-129"=="multiboot" hdboot :3 • hdboot :1

  18. Conclusion - Linux • Très facile • Permet d ’organiser des formations d ’administration sans risques… • en production depuis 2 ans sur plusieurs sites • Possibilité de créer l ’image d ’une partition vide pour zone de scratch (mp3 !!!)

  19. Création d ’une image W9x • L ’utilitaire se nomme mrzip.exe • Exemple de script : mkimgw.mrz • showlog • filter -"windows/schedlog.txt" • filter -"windows/msimgsiz.dat" • filter -"*/index.dat" • filter -"*.swp" • filter -"*.tmp" • filter -"temp/*" • set FragmentSize="30 MB" • fullzip "c:/" "h:/w98/w98.imz" • commande : mrzip.exe -b mkimgw • n fichiers linux.im* de 30 Mo

  20. Création d ’une image W9x utilisation de SMB/CIFS • Utiliser Samba ou autre serveur de fichiers • s ’assurer que mrzip.exe existe • Connecter un lecteur réseau en h: • h:\mrzip -b mkimgw

  21. Réinstallation inconditionnelle d ’une machine W9x • Attention script incomplet ! • Créer le script w98.bpb • hidelog • setpartition«bigdos:1024» • setbootpart 1 • fullunzip «w98/w98.imz» 1 • hidebootprom • hdboot :1 • W9x ne sait pas configurer le hostname/Netbios au travers de DHCP !!!

  22. Résolution problème hostname • Le hostname est dans 3 clefs de registre. • On va donc créer à la volée un fichier c:\temp\patch.reg qui sera lancé par l ’autoexec.bat • regedit /L:c:\windows\system.dat /R:c:\windows\user.dat c:\temp\patch.reg

  23. Résolution problème hostnameSuite • Créer un modèle sur le serveur ex:patch.reg • REGEDIT4 • [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\VNETSUP] • "ComputerName"="${BOOTP-Host-Name}" • [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP] • "HostName"="${BOOTP-Host-Name}" • [HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\ComputerName\ComputerName] • "ComputerName"="${BOOTP-Host-Name} » • ${BootP-Host-Name} sera remplacé par sa valeur grace à la directive patch

  24. Résolution problème hostnameFin • Le script devient: • hidelog • setpartition«bigdos:1024» • setbootpart 1 • fullunzip «w98/w98.imz» 1 • patch «patch.reg» «{:1}temp/patch.reg» • hidebootprom • hdboot :1

  25. Gestion des différences matérielles • Les éviter !!!!! • Astuce: • Copier le répertoire WIN98 du CD dans une partition • Copier les drivers supplémentaire dans cette partition • Copier les *.inf dans c:\windows\inf • Faire l ’image de cette partition (~150 Mo) • La restaurer sur tous les PC

  26. Gestion des différences matérielles - suite • Rajouter dans le script mkimgw.mrz la ligne • fullzip «d:/» «h:/win98/cd.imz» • Modifier w98.bpb • setpartitions «bigdos:1024 bigdos:300» • … • fullunzip «w98/cd.imz» 2 • …

  27. Gestion des différences matérielles - Fin !!!! • Lorsque W9x détecte un nouveau matériel, il demande à rebooter, donc: • Re bpbatch !!!! ===> Réinstallation etc ... • Astuce: • créer en fin d’installation un fichier bidon sur la machine • Tester l ’existence de ce fichier dans bpbatch • si le fichier existe démarrer normalement • effacer ce fichier au premier démarrage (Runonce)

  28. Conclusion - W9x • Délicat à mettre en œuvre (la première fois) • Règle les problèmes de virus et MAJ • Limite les installations « sauvages » • « Vous devez redémarrer votre machine » ;-) 

  29. Couplage à d’autres softs • Problème des W2k/NT : • Utilisation d ’autres solutions de déploiement • Imagecast par exemple • Déploiement et réinstallation automatique au travers de bpbatch: • bpbatch lance une image de disquette imagecast

  30. Conclusion - Limitations • Pas sous GPL • Vieux (plus trop maintenu) • pas de support NTFS • Somme(partitions) < 8Go • pas de MTFTP • pas d ’incrémental • Passer à Rembo (commercial) • Systemimager, Kdeploy, Partition image, g4u, replicator ... • SafetyCard d ’Inetech

More Related