Issue
The date and time that are set on a workstation can affect the build process.
If the date and time are not valid then the following symptoms may be displayed:
- LDAP errors
- Negative time displayed in setup window and build timer counting down instead of up
- AD registration issues
- ZCM registration issues
Requirements
- Imaging Toolkit
- ZCM Environment with imaging configured to use Zim
- SLES/SLED 11/SLES 12 machines (ZCM imaging can use both SLES 11 and SLES 12 kernels, depending on circumstance, so this TID captures both)
-
ntp/sntp
time source
Solution
Update the time on the machine prior to Zim loading
This can be done by adding a copy of the sntp
utility (http://www.eecis.udel.edu/~mills/ntp/html/sntp.html) from a SLES machine into tftp/zimfiles.
The zimget.s
script is then modified to tftp this file down to the imaging environment, set the system time from a configured time source and synchronise the new system time with the hardware clock
Procedure
Done |
Task |
||
---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
-
Extract
sntp
utility from SLES/SLED 11- Login to SLES/SLED 11
- Copy the file
sntp
from/usr/sbin/sntp
, rename it to sntp-s and copy it to thezimfiles
folder- Linux:
/srv/tftp/zimfiles
- Windows:
%ZENWORKS_HOME%\share\tftp\zimfiles
- Linux:
- Login to SLES/SLED 11
-
Extract
sntp
utility from SLES 12- Login to SLES 12
- Copy the file
sntp
from/usr/sbin
, rename it to sntp-4 and copy it to thezimfiles
fiolder- Linux:
/srv/tftp/zimfiles
- Windows:
%ZENWORKS_HOME%\share\tftp\zimfiles
- Linux:
- Login to SLES 12
-
Update
zimget.s
script file- Open the
zimget.s
file with a text editor
- Update the
zimget.s
file with the following information:
Editzimget.s
file to add the changes shown in green
and configure an appropriatentp/sntp
time source (highlighted in red)#!/bin/bash # Created: September 13, 2017 13:11:25 ZIMDIR=/zimbin export ZIMDIR # Determining drive type... # Identify local fixed disk(Non-USB) FIXED_DRIVE="" for _device in /sys/block/{nvme,sd,hd}*/removable; do if [ -a $_device ]; then if echo $(readlink -f $_device)|egrep -v -q "usb"; then _disk=`echo $_device | cut -f4 -d/` # First fixed disk to be identified will be used. FIXED_DRIVE="$_disk" break fi fi done export HDTYPE=$FIXED_DRIVE echo Downloading ENGL Zim files... kernel=$(uname -r|cut -c 1) tftp $PROXYADDR << _END_ > /dev/null verbose on bin get zimfiles/ldapsdk.tar $ZIMDIR/ldapsdk.tar get zimfiles/zim.tgz /zimbin/zim.tgz get zimfiles/engl.lic $ZIMDIR/engl.lic get zimfiles/zim.cfg $ZIMDIR/zim.cfg get zimfiles/images.ini $ZIMDIR/images.ini get zimfiles/projects.ini $ZIMDIR/projects.ini get zimfiles/zimrun.s $ZIMDIR/zimrun.s get zimfiles/sntp-$kernel $ZIMDIR/sntp quit _END_ echo Unpacking Zim libraries... tar xf $ZIMDIR/ldapsdk.tar -C / > /dev/null /bin/rm -f $ZIMDIR/ldapsdk.tar tar zxf $ZIMDIR/zim.tgz -C $ZIMDIR > /dev/null /bin/rm -f $ZIMDIR/zim.tgz crlf.s $ZIMDIR/zimrun.s > /dev/null 2>&1 chmod +x $ZIMDIR/zim chmod +x $ZIMDIR/zimrun.s chmod +x $ZIMDIR/sntp echo Checking time configuration... if [ $kernel = 3 ]; then echo setting time using SLES 11 sntp /$ZIMDIR/sntp -P no -r uk.pool.ntp.org else echo setting time using SLES 12 sntp /$ZIMDIR/sntp uk.pool.ntp.org fi echo Updating Hardware Clock hwclock --systohc quit _END_
- Save changes to
zimget.s
and update file on the server.
- Open the
-
Test
- PXE boot a machine to ZENworks imaging/ZIM environment
- Select Maintanence Menu - Exit to Prompt
At the bash prompt:
- type
hwclock
- This will tell you what the Hardware clock is set to. - type
date
- This will tell you what the System clock is set to.
- type
- The Hardware clock and the System clock should be in sync with the time source configured in the script