Steps to create a ZENworks Imaging DVD

  • 3001732
  • 02-Aug-2006
  • 30-Apr-2012

Environment

Novell ZENworks Desktop Management 6.5 Service Pack 2 - ZDM6.5sp2 Imaging
Novell ZENworks Desktop Management 7 - ZDM7 Imaging

Situation

Some desktop administrators need their ZENworks imaging solution to be accessible while disconnected from the network, or at least without access to a ZENworks imaging server.

Resolution

To create a bootable DVD that will automatically restore a ZENworks image, follow these steps:
A. Create the image file(s) to be restored
See the manual image creation documentation for steps on how to create the base image. See the addon image creation documentation for steps on how to create addon images.
B. Add the image(s) to the bootcd.iso
Using an ISO editor (like WinISO or UltraISO), copy the ZMG files to be restored to the root of the bootcd.iso (found in SYS:\PUBLIC\ZENWORKS\IMAGING).

Note: It may be necessary to use the full version of the ISO editor due to limitations of the free software being able to handle large ZMG files (for example, ZMG files greater than 500 MB).
C. (Optional) Modify the ZENworks imaging menu
Some administrators might choose to customize the ZENworks imaging menu that appears when booting off CD to only display the applicable options for their environment. To do this, the isolinux.cfg (found in the \boot\loader directory inside the bootcd.iso) will need to be modified with a text editor that can save in Unix format (such as TextPad or UltraEdit, or an editor in a Linux distribution).
Original text in isolinux.cfg:

default linux

label linux
kernel linux
append initrd=initrd ramdisk_size=65536 vga=0x0314 splash=silent mode=2 CDBOOT=YES showopts

label manual
kernel linux
append initrd=initrd ramdisk_size=65536 vga=0x0314 splash=silent mode=5 CDBOOT=YES showopts

label config
kernel linux
append initrd=initrd ramdisk_size=65536 vga=0x0314 splash=silent mode=7 CDBOOT=YES showopts

label install
kernel linux
append initrd=initrd ramdisk_size=65536 vga=0x0314 splash=silent mode=4 CDBOOT=YES showopts

label lilo
kernel linux
append initrd=initrd ramdisk_size=65536 vga=0x0314 splash=silent mode=3 CDBOOT=YES showopts

label disable
kernel linux
append initrd=initrd ramdisk_size=65536 vga=0x0314 splash=silent mode=3 DISABLEZEN=1 CDBOOT=YES showopts

label enable
kernel linux
append initrd=initrd ramdisk_size=65536 vga=0x0314 splash=silent mode=3 ENABLEZEN=1 CDBOOT=YES showopts

implicit1
gfxbootbootlogo
displaymessage
prompt1
timeout200
readinfo2
framebuffer1
Modified text for isolinux.cfg:

default boot

label boot
localboot 0x80

label restore
kernel linux
append initrd=initrd ramdisk_size=65536 vga=0x0314 splash=silent mode=2 CDBOOT=YES showopts

label prompt
kernel linux
append initrd=initrd ramdisk_size=65536 vga=0x0314 splash=silent mode=5 CDBOOT=YES showopts

implicit1
gfxbootbootlogo
displaymessage
prompt1
timeout50
readinfo2
framebuffer1
Notice that the number of menu items has decreased to the only 3 options needed in the environment, and renamed for ease of use. The localboot 0x80 was added so that the default option when leaving the DVD in the system is to boot to the locally installed operating system instead of reimaging the machine. Additional options and information can be found when searching the internet for isolinux.cfg.
D. Create an imaging script to restore the image(s)
In addition to basic ZENworks Imaging restore commands, imaging scripts can be used to do a myriad of tasks on the workstation, including setting up partitions, using logic to restore images based on current environment, and even reporting on successful or failed imaging operations. The below script is a simple image restore example, tailored to restoring from DVD. Keep in mind that the script file needs to be saved in Unix format when created, so you need to use an editor that has this capability, like TextPad, UltraEdit, or an editor on a Linux machine:
#!/bin/bash
cdrom.s
hdparm -d1 /dev/hdc
img rl /mnt/cdrom/myimage.zmg
umount /mnt/cdrom
The first line tells Linux which shell to use when executing this script
The second line calls the ZENworks Imaging script that mounts the CDROM device as /mnt/cdrom
The third line enables DMA, thus increasing the I/O rate (can only be used on IDE devices, so do not include this line if using SCSI)
The fourth line restores the image file stored at the root of the DVD
The fifth line unmounts the CDROM
Save this file as some script name (for this example, we'll call it myscript.s). Then, using an ISO editor, drop the myscript.s file in the bootcd.iso underneath /addfiles/bin. Any files dropped in here are automatically copied to the ram drives \bin directory on bootup, and are made executable.
E. Modify the settings.txt
There is a settings.txt file (found in the same directory as the bootcd.iso, SYS\PUBLIC\ZENWORKS\IMAGING) that needs to be configured and then placed in the root directory of the ISO. Specifically, two configuration options should be specified for a disconnectable DVD automatic imaging solution:

#Use this setting in a DHCP environment.
netsetup=dhcp

#Use the following 4 settings in a static IP address environment.
#netsetup=1
#HostIP=0.0.0.0
#netmask=255.255.255.0
#gateway=0.0.0.0
should be changed to

#Use this setting in a DHCP environment.
#netsetup=dhcp

#Use the following 4 settings in a static IP address environment.
netsetup=1
HostIP=
netmask=
so that DHCP is not queried for while disconnected, and static IP information is defined. Also, the IMGCMD variable needs to be set:
#export IMGCMD="bash -c cdrom.s; img rl /mnt/cdrom/linux.zmg"
should be changed to
export IMGCMD="/bin/myscript.s"
This means that when automatic imaging is chosen, the imaging.s script processed by ZENworks Imaging will see that IMGCMD is set and will process that variables commands instead of looking for work to do on the wire.
OPTIONAL - Some administrators will need the system rebooted after imaging operations, some will need to be at the bash prompt when finished. The MANUALREBOOT setting inside the settings.txt can be toggled to control whether or not the end of the imaging process goes to a prompt or reboots the system.
F. Burn the DVD
Before burning the DVD, ensure that the bootcd.iso contains your
a) \settings.txt
b) \boot\loader\isolinux.cfg
c) \myimage.zmg
d) \addfiles\bin\myscript.s
And, when burning the bootcd.iso to DVD, make sure you specify ISO 9660 format instead of using most DVD burning utilities' default of UDF. Otherwise, you'll have to grab the udf.ko from a SLES 9 install and drop it in the initrd and load it through the settings.txt.