Wednesday, October 23, 2013

Apple OS X Server: Creating NetInstall and NetBoot images for deployment

Both NetBoot and NetInstall offer a variety of uses in their implementation. Learn how to create NetInstall and NetBoot images for deployment. 
netinstall-and-netboot.jpg

It can be argued that no job is more tedious, repetitive, or will be done throughout the career of enterprise-level IT than reinstalling the OS. The task will be completed thousands of times over the years! Seasoned IT admins will even be able to reinstall the OS (and necessary apps) blindfolded, drawing solely from recollection of previous installs. But what if installing (and reinstalling) didn’t have to be such a productivity killer? What if, instead of countless hours of OS and “sneakernet” application installs, a complete copy could be deployed out to the required machines with most (if not all) the necessary software already in place?

On the Windows side of the coin, this has existed for many years in many different flavors. Whether it’s referred to as cloning, imaging, or ghosting; “A rose by any other name would smell as sweet,” as said by William Shakespeare. A similar process also exists for Apple, and it's currently known as NetInstall.
Before diving directly into this one, I wish to stress the importance of planning. I've previously written about the basic underpinnings of OS X Server -- the foundations (if you will) that allow the server to be structured in such a way as to allow the rest of the services to function as intended. However, with certain services like this one (and certain others that will be covered in the future), a well thought out plan will go a long way to ensuring that the service functions do not bring about any unintended consequences on your network.
Here are some questions to consider before proceeding:
  • How many nodes will be imaged?
  • What is the available bandwidth?
  • Will the OS + apps be pushed out or just the OS?
  • Where are the nodes located (single vs. multi-site)?
These types of questions will help shape a deployment plan that can be executed during all times -- from the most ideal (with network usage being low) to emergency scenarios (whereby network use is at high capacity). With these types of questions in mind, consider the requirements below.

NetInstall deployment requirements

  • Computer with Apple OS X Server 10.7+
  • Wired Ethernet switched network
  • OS X 10.7+ Installation Media*
* Note: Install media for OS X must match OS X Server version. (i.e. On OS X Server 10.8, only 10.8 can be used. To create a 10.7 useable image, it must be created on OS X Server 10.7.)
  I.  Creating a NetInstall image
  1. Select the server to logon to using the Server.app application (Figure A).
    Figure A
    Figure A
  2. Use an administrative account to access the specific server console (Figure B).
    Figure B
    Figure B
  3. Click on NetInstall, and the first thing you’ll notice is the On/Off switch. By default, NetInstall is set to Off and will continue to be so until at least one NetBoot image has been created (Figure C).
    Figure C
    Figure C
  4. To create the NetInstall image, navigate to the path below and launch the System Image Utility.app (Figure D).
    /System/Library/CoreServices/System Image Utility.app
    

    Figure D
    Figure D
  5. Before you proceed, check the top left corner of the screen under Sources. There should be an install source already populated that's equivalent to the version of OS X you’re using to create the files. If not, you'll first need to download (or create a .DMG) version of OS X onto the computer and open it so it’s available from Disk Utility. The system will find the file automatically and incorporate it as a source. Once it’s listed as a source, proceed to the next step.
  6. Select the NetInstall Image radio button, and click Continue (Figure E).
    Figure E
    Figure E
  7. On the next screen, you'll be prompted to accept the default name or create a unique name and description for the network disk. If load balancing across more than one server, check the Image will be served from more than one server checkbox, and then click Continue (Figure F).
    Figure F
    Figure F
  8. Next, agree to the Apple Terms of Service (Figure G).
    Figure G
    Figure G
  9. The final step before creating the NetInstall file is to give the file a unique name, navigate it to the correct directory, and click Save.** By default, files used by the NetInstall service are stored at the path listed below (Figure H).
    /Library/NetBoot/NetBootSP0
    

    Figure H
    Figure H
  10. The creation process is relatively quick. However, it depends on the specifications of the device on which it’s being created (Figure I).
    Figure I
    Figure I
  11. Once complete, a confirmation message will be displayed and the file will be ready for use  (Figure J).
    Figure J
    Figure J
** Note: Between steps 9 and 10, you may be prompted to provide admin-level credentials in order to initiate the creation process. This is normal operating procedure and is only required to read the necessary system files in order to create a functional, NetInstall-compliant file.
  II.  Configuring NetInstall for deployment
  1. Now that the NetInstall file has been created, it's time to enable it for use with deployment (by default, all NetInstall and NetBoot images are disabled until manually enabled by the admin). Go back to the Server.app console and click on the Images tab in NetInstall (Figure K).
    Figure K
    Figure K
  2. Notice the red circle next to the newly created NetInstall image. This indicates that it's disabled (Figure L).
    Figure L
    Figure L
  3. To enable the newly created NetInstall image, click the image name to highlight it, and then click the Settings drop-down menu (cogwheel icon) to select Edit Image Settings… (Figure M).
    Figure M
    Figure M
  4. Under Availability, check the box next to Make available over HTTP, and then click Done***  (Figure N).
    Figure N
    Figure N
  5. By enabling access to the NetInstall file, the red circle should now be green, which indicates that it's available for deployment.
  6. Since multiple NetBoot/Install files can be created and managed, it's best to have at least one NetInstall image that's suitable for general use across your entire network. By creating this template image, it can be set to Default by highlighting the desired image, clicking the Settings drop-down menu, and selecting Use as Default Boot Image (Figure O).
    Figure O
    Figure 0
  7. Now, any node requesting an image will receive this one above all others, unless a specific image is pre-assigned to it by an administrator (Figure P).
    Figure P
    Figure P
*** Note: Access to any NetBoot/Install files can restricted based on a few factors, including HTTP or shared over NFS, specifying only certain model Apple computers or even restrictions based on MAC address whitelisting. These settings, when modified, can be used to allow certain nodes to access specific NetBoot/Install files to balance the load on the OS X Server or manage access across several OS X Servers at single or multiple locations.
  III.  Creating a NetBoot image
  1. Similar to NetInstall is NetBoot. NetBoot allows for booting of supported Intel-Macs over the network from an image stored on the server. Creation of a NetBoot image is virtually identical to that of a NetInstall image (outlined above), except in step #6, where you would select the NetBoot Image radio button, and then click Continue (Figure Q).
    Figure Q
    Figure Q
  2. For Image Settings, assign the image a unique name and description. You should also pre-configure the Administrator account for logging onto the NetBoot image once it’s loaded. Click Create to move on to the next step (Figure R).
    Figure R
    Figure R
  3. Next, you'll be prompted to save the NetBoot file to the same directory as the NetInstall image. Provide a unique name and click Save (Figure S).
    Figure S
    Figure S
  4. NetBoot image creation takes much longer than NetInstall, at least in my experience (NetBoot images are typically 3x larger than NetInstall). Your mileage may vary, as it depends on the reference computer used to create the image. However, once complete, you’ll receive a confirmation message (Figure T).
    Figure T
    Figure T
  5. Just like the NetInstall image, NetBoot will be disabled by default. Simply follow the steps outlined in section II to enable access to the NetBoot image for deployment.
While similar in use, both NetBoot and NetInstall offer a varied use in their implementation. NetBoot is used primarily to network boot Macs in a similar fashion to disk-less nodes running from a Terminal Server in Windows. Additional uses are for troubleshooting purposes, software deployments, and update rollouts. 
NetInstall, however, can be used to install OS X over the network -- eliminating the need for removable install media -- and since it can be deployed to multiple stations at once (also known as multicasting), it cuts down on the setup time. Other uses include being able to clone a reference system, and using the NetInstall image created from there to copy it across to all your Macs -- complete with applications installed, settings configured, and all the bells and whistles fully loaded! After the reboot, subsequent to the image being cast out, the Mac is ready for use with little to no additional modifications necessary. This is just another example of working smarter, not harder.

0 comments:

Post a Comment

Appreciate your concern ...