vbsd2013

582 views
480 views

Published on

How to automate installations of PC-BSD & FreeBSD

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
582
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

vbsd2013

  1. 1. Automating the deployment of FreeBSD & PC-BSD® systems VBSDCon 2013 Kris Moore PC-BSD / iXsystems kris@pcbsd.org
  2. 2. The problem: You want to (quickly) deploy multiple FreeBSD or PC-BSD systems. You want a variety of scripted installs
  3. 3. There are currently two ways to accomplish this:
  4. 4. Solution #1 ● ● ● Write your own installation scripts Configure network booting by hand Maintain as necessary
  5. 5. ● ● When to consider Solution #1: You have a very unique installation You are a FreeBSD God – Congrats!
  6. 6. ● ● When to not consider Solution #1: Manual disk partitioning isn't your thing You work for a living
  7. 7. Solution #2 ● Use the pc-thinclient utility included with PC-BSD & TrueOS
  8. 8. ● What you will need: A system with a network interface (2)? Running PC-BSD > 9.1 or ● ● ● Port: sysutils/pcbsd-utils A few GB of disk space
  9. 9. Getting Started
  10. 10. Getting Started
  11. 11. Getting Started ● ● Install server Or desktop “Thin-Client” server
  12. 12. Short Detour
  13. 13. What is Remote Desktop? ● ● ● The thin-client utility can operate both install server or desktop server Allows diskless clients to boot via PXE Brings up GDM login on client
  14. 14. Why would you run Remote Desktop? ● ● You have a bunch of low-end clients You want to simplify backup, security and management
  15. 15. Why should you not run Remote Desktop? ● ● You don't have a server with horsepower You need sound support on the clients
  16. 16. Back to your previously scheduled presentation
  17. 17. Getting Started ● ● Will run DHCPD Be careful which interface you plug into
  18. 18. Getting Started
  19. 19. Getting started ● ● You may now connect a client system To PXE boot, you may need to check BIOS on client first
  20. 20. Customizing the install ● ● Of course you will want your own installation options / archives, etc It is possible to adjust entirely on server side
  21. 21. ● ● ● ● The two key directories: /home/thinclient/installscripts /home/thinclient/installarchive Client mounted as: /installscripts /installarchive
  22. 22. ● pc-sysinstall.example can be used as a template for other installations Example #1 Changing to ZFS
  23. 23. Example disk layout: disk0-part=UFS+SUJ 1000 / disk0-part=SWAP 2000 none disk0-part=UFS+SUJ 0 /usr commitDiskLabel Converted to ZFS becomes: disk0-part=ZFS 0 /,/root,/tmp,/usr,/var commitDiskLabel
  24. 24. Slightly more complex ZFS layout: disk0-part=ZFS 0 /(atime=off), /root(compress=lz4), /tmp,/usr(canmount=off),/usr/local(compress=lz4), /var, /var/log(compress=gzip) commitDiskLabel
  25. 25. Example #2 Changing installation archive
  26. 26. Example install archive: installMedium=local localPath=/installarchive packageType=tar installFile=fbsd-release.txz Changed to custom archive: installMedium=local localPath=/installarchive packageType=tar installFile=fbsd-8.4-amd64.txz
  27. 27. Example local install installMedium=local localPath=/installarchive packageType=tar installFile=fbsd-8.4-amd64.txz Changed to remote: installMedium=ftp ftpPath=ftp://example.org/installfiles packageType=tar installFile=fbsd-8.4-amd64.txz
  28. 28. Example #3 User Management
  29. 29. # Root Password rootPass=root # User Setup userName=kris userComment=Kris Moore userPass=kris userShell=/bin/csh userHome=/home/kris userGroups=wheel,operator commitUser
  30. 30. Example #4 Advanced Commands
  31. 31. # Run command inside installed system runCommand=sh /root/initme.sh # Run command outside installed system runExtCommand=mount -t devfs devfs ${FSMNT}/dev
  32. 32. Example #5 Packages, oh my!
  33. 33. installPackages=apache22 mysql55-server Can use short package names, or full versions.
  34. 34. ● ● PKGNG support Checks package format before install Will “boot-strap” PKGNG if necessary
  35. 35. Example #6 FreeBSD dist files
  36. 36. # Install from vanilla FreeBSD dist files installMedium=local localPath=/distfiles/9.1-Release/amd64/dist packageType=dist distFiles=base doc games kernel lib32
  37. 37. Putting the Automated in “Fully Automated” File: /home/thinclient/installscripts/unattended.cfg ● ● ● ● If config exists, the client will boot and begin installation after 30 seconds System will shutdown when finished MAC address can be used as well USE WITH CAUTION!!
  38. 38. Its Demo time!
  39. 39. Scalability ● ● ● All CPU instructions are run on the client Server is in essence a large “File Server” Will be mostly disk IO / network speed dependent
  40. 40. Scalability ● ● Default DHCP server is configured for 99 clients To adjust edit the file: ● ● /usr/local/etc/dhcpd.conf range 192.168.2.100 192.168.2.199;
  41. 41. Tips and Tricks ● ● ● The PC-BSD GUI installer is your friend Every install is a scripted install After installation a copy of the pcsysinstall.cfg file is saved to: ● /root/pc-sysinstallcfg
  42. 42. Tips and Tricks ● To greatly speed up installations, use ZFS mirrored drives, SSD, or even TMPFS
  43. 43. ● What's next? Improvements to pc-sysinstall ● ● ● ● ● GRUB Support! ZFS 4K BlockSize enable / disable ZFS Pool Naming Install from ZFS replication Faster setup of initial thin-client environment
  44. 44. ● What's next? Web interface to config file management ● ● ● Allow editing configs Creating MAC entries → Config File Text-based front-end to PC-BSD ● ● Basic at first Will allow install / prototyping via CLI
  45. 45. What's next? ● Enhanced Desktop Server Support ● ● ● ThinClient → ThickClient Sound Support Much more scalable
  46. 46. Questions? Comments? wiki.pcbsd.org lists.pcbsd.org forums.pcbsd.org
  47. 47. Thank you! slideshare.net/krispcbsd/vbsd2013

×