As a significant presence on our network, Apple Macintosh computers require the same efforts to deploy and redeploy as their Windows counterparts. The purpose of this solution was to create a comprehensive imaging solution to reduce labor effort, bandwidth utilization while increasing the quality control for deploying or redeploying Apple Macintosh computers in the enterprise.
In our efforts to support the Apple Mac OS X platform in our environment, we have utilized the Altiris Deployment Solution 6.9 agent and scripting to create a scripted imaging solution the satisfies the functional objectives below.
Functional Objectives:
-
To be able to schedule imaging jobs for Apple computers regardless of power state
-
Minimize bandwidth usage from the server to the target computers.
-
Work in environments with or without VLANs
-
Acknowledge completion or failure
-
Mimic unicast to multicast streaming
-
Allow multiple imaging streams
-
To be able to image a single computer or an entire building at a time.
-
To be able to store images on NFS, AFP or SMB shared storage.
Required Environment
To use this solution you must have:
-
A Deployment Solution 6.9 server
-
An Apple Mac OS X Server
-
An Apple Macintosh client computer
Working Assumptions
-
NetBoot services must be running on the Mac OS X Server. Your client must be able to contact the server and boot from this image. You may need to accommodate the network by adding helper addresses for the NetBoot service.
-
From this point forward the term "NetBoot image" will be called the "AUTOMATION IMAGE"
-
You have a properly created image to deliver that is stored in a location accessible on the network. This information can be found in KB 40410.
-
The Primary Lookup Key(s) include Serial Number within the Global Settings of the Deployment Solutions server.
-
You have at least one Mac OS X client created in the console with the computer name and serial number.
Prerequisite Setup on the Mac OS X Server
You will need to create folders on the Mac OS X Server. These folders will serve the image, act as a temp directory for ASR, and store the support files.
-
A folder will need to be created for the image storage location. For the purposes of this document, use "Images" as the share name. Ensure you have an account to access this share across the network.
-
A folder within the Images folder must be created called "Support"
-
A folder must be created within the Support folder called "Backgrounds"
-
Download and save the backgrounds in the Backgrounds directory. Ensure these files are accessible through the network.
Instructions
-
Download the referenced script to the desktop of the Deployment Solution server.
-
Within the Deployment Solution console, create an imaging job by right-clicking on the item System Jobs>Image Jobs and selecting New Job.
There are no conditions to this imaging job. The default condition will be used.
-
Add a "Run Script" step.
-
Copy the text in between the quotation marks:
"# Sleep 30
sleep 30"
-
Paste the text into the "Run this Script" field. Ensure Mac OS X is selected in the script operating system.
The first line will provide a text description in the console in the Details column. Once the computer restarts, it will wait for 30 seconds.
-
Click Next
-
Select "On the client computer" for Script Run Location
-
Select "Automation pre-boot environment" for Client Run Environment.
-
Click Next
-
Click Finish.
-
Add a "Run Script" step.
-
Open the downloaded script using Notepad on the Deployment Server.
-
Select All (ctrl+A)
-
Copy (ctrl+C)
-
Paste the selected text in the "Run this script" field.
THERE ARE ONLY 6 LINES OF THE SCRIPT THAT NEED TO BE MODIFIED. THEY ARE LINES 4-9. It is important that you set these variables to values that match your environment.
The variables are listed below. You will need to replace the text within the quotations with your own values.
SharedFolder - This is the name of the share where the delivered image is stored.
Example: SharedFolder="Images"
MountPoint - This is the name of the volume with the shared folder.
Example: MountPoint="/Volumes/"$SharedFolder
ImageFile - This is the filename with extension.
Example: ImageFile=$MountPoint/"imagename.dmg"
Server - This is the FQDN or IP of your Mac OS X Server running NetBoot
Example: Server="servername.yourcompany.com"
UserName - This is the account name able to mount the share where the image is being stored.
Example: UserName="technician"
Pass - This is the password used to access the share where the image is stored.
Example: Pass="password"
Once the above variables are populated:
-
Ensure Mac OS X is selected in the script operating system.
How it Works
-
Deployment Solution tells client machine to Netboot to local XServe
-
Client boots to Altiris Automation Image running 6.9 SP 4 (beta) agent
-
Client mounts share (AFP, NFS, SMB) where images are located
-
Client gets its own IP, and determines whether it is on a flat network (255.255.248.0) or on a VLAN (255.255.255.0). Note: Because our network only has two subnet masks, we assume that if the subnet is not 255.255.255.0 then it is 255.255.248.0
-
Client determines its resolution. Resolution is detected so that when a new background is applied to the computer, the background is not stretched, and appears at its native resolution. A background must exist in the Support folder for each supported resolution
-
Client checks to see that a folder exists for its specified subnet, and that a Log Archive folder exists within that subnet folder. If not, the folders are created.
-
Client checks to see if MCastMaster.txt file exists
A) File Exists
-
Client creates file with it's IP address in the MCastClients folder. We chose to create multiple files so that we wouldn't run into an issue where two machines tried to write to the same file at the same time
-
Client creates file with it's IP address in the root folder ("/")
-
Client redirects script output to file located at "/". This was done to accommodate QuickLook auto-refresh
-
Client sets its background to the slave background in the proper resolution. Client then displays the IPaddress.txt output located at "/" using quicklook (requires 10.6 for the quicklook view to auto-refresh the screen)
-
Client reads the IP address of the Master from the MCastMaster.txt file
-
Client sleeps for 10 seconds to give the Master time to start the server session
-
Client attaches to ASR session and restores "/dev/disk0s2"
-
Client removes its file from the MCastClients folder to signify it has completed the imaging.
-
Client moves its log file (IPAddress.txt) to the Log Archives folder
-
Client copies adlagent.conf file into restored image
B)
-
Client creates MCastMaster.txt file containing its IP address
-
Client outputs its IP address to the MCastMaster.txt file
-
Client creates file with it's IP address in the MCastClients folder.
-
Client creates file with it's IP address in the root folder ("/")
-
Client redirects script output to file located at "/".
-
Client sets background to the master background in the proper resolution
-
Client displays the contents of "/IPaddress.txt" using quicklook
-
Client creates asr.plist file
-
Client starts ASR server session using the asr.plist file and moves the process to the background
-
Client sleeps to allow the server session to start
-
Client attaches to ASR session and restores "/dev/disk0s2"
-
Client removes its file from the MCastClients folder to signify it has completed the imaging.
-
Client moves its log file (IPAddress.txt) to the Log Archives folder
-
Client copies adlagent.conf file into restored image
-
Client checks MCastClients folder to see if any other clients are connected. If there are other clients it sleeps for a minute and then checks again. If there are not any, then the client kills the asr server session.
-
Client removes MCastLMaster.txt file, asr.plist file, and MCastClientsFolder.
-
Client uses %NAME% to set its Computer Name.
-
Client unmounts the shared drive.
-
Client sets startup disk back to /dev/disk0s2
-
Client reboots