Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
joebrug Outstanding Contributor.
Outstanding Contributor.
5101 views

Imaging loop with ZCM

Something must've changed from ZFD vs ZCM imaging. I'm using the same script as before, but when the last step in the process is done, it seems that the PXE imaging process re-checks for work to do and starts the whole process all over again! No reboots, etc.. just keeps imaging and re-imaging..

I have a Non Registered Devices hardware rule set up for Ram < 0, so that all non-registered devices should recieve the image when booting from PXE. once the image process is done... in ZFD it used to reboot the PC, then load up windows and start sysprepping. in ZCM it doesnt reboot, but instead checks for more work, then starts imaging all over..

What am I missing?? Last step in this big imaging hurdle!

#novell on efnet
Labels (2)
0 Likes
11 Replies
joebrug Outstanding Contributor.
Outstanding Contributor.

Re: Imaging loop with ZCM

Annnnyone? 😉

#novell on efnet
0 Likes
martinusen Absent Member.
Absent Member.

Re: Imaging loop with ZCM

joebrug;1930421 wrote:
Annnnyone? 😉



Can you post your script?
0 Likes
joebrug Outstanding Contributor.
Outstanding Contributor.

Re: Imaging loop with ZCM

Absolutely.. thanks for looking, Martin

#Clear ZISD
zisedit -c
#Detect type of drive and set HDD variable
HDD=`img p | grep -E ^1 | awk '{print $2}'`
#Delete all partitions and create temp
if echo $HDD | grep hda ; then hdparm -d1 /dev/hda ; fi
img pdall
if echo $HDD | grep hda ; then hdparm -d1 /dev/hda ; fi
img pc1 fat16 10
if echo $HDD | grep hda ; then hdparm -d1 /dev/hda ; fi
if echo $HDD | grep hda ; then
sleep 30
echo w> /tmp/test
fdisk /dev/hda < /tmp/test
fi

mkfs.msdos $HDD

#Restore sysprep.inf template
img rp $PROXYADDR sysprep_template.zmg
mount $HDD /mnt/harddisk

#Search sysprep for MYNAME and replace with Service Tag
sed -i s/MYNAME/$(zhw -serial)/g /mnt/harddisk/sysprep/sysprep.inf
umount /mnt/harddisk

#Create image of sysprep changes in local temp location
img ml /tmp/$(zhw -serial).zmg

img pd1
img pc1 ntfs
img pa1

#Restore base image, Enable DMA if IDE hard drive
if echo $HDD | grep hda ; then hdparm -d1 /dev/hda ; fi
#img rp $PROXYADDR //$PROXYADDR/vol1/images/basexp.zmg
#img rp $PROXYADDR //$PROXYADDR/vol1/images/newxp745.zmg
img rp $PROXYADDR xpapps.zmg a1:p1

#Non-destructively restore sysprep.inf over one in base image
img rl /tmp/$(zhw -serial).zmg a1:p1

#Restore drivers for specific model computer
hwinfo --bios > /tmp/hwinfo.bios
if cat /tmp/hwinfo.bios | grep -i "Optiplex GX620" ; then
img rp $PROXYADDR addon-image/gx620driver.zmg
elif cat /tmp/hwinfo.bios | grep -i "OptiPlex 760" ; then
img rp $PROXYADDR addon-image/opti760driver.zmg
elif cat /tmp/hwinfo.bios | grep -i "Optiplex 745" ; then
img rp $PROXYADDR addon-image/gx745driver.zmg
elif cat /tmp/hwinfo.bios | grep -i "OptiPlex GX270" ; then
img rp $PROXYADDR addon-image/gx270driver.zmg
elif cat /tmp/hwinfo.bios | grep -i "Latitude D620" ; then
img rp $PROXYADDR addon-image/d620driver.zmg
elif cat /tmp/hwinfo.bios | grep -i "Latitude D610" ; then
img rp $PROXYADDR addon-image/d610driver.zmg
elif cat /tmp/hwinfo.bios | grep -i "Latitude D600" ; then
img rp $PROXYADDR addon-image/d600driver.zmg
elif cat /tmp/hwinfo.bios | grep -i "OptiPlex GX260" ; then
img rp $PROXYADDR addon-image/gx260driver.zmg
elif cat /tmp/hwinfo.bios | grep -i "OptiPlex GX280" ; then
img rp $PROXYADDR addon-image/gx280driver.zmg
elif cat /tmp/hwinfo.bios | grep -i "OptiPlex 755" ; then
img rp $PROXYADDR addon-image/gx755driver.zmg
fi

#Set computer name in ZISD as Service Tag
zisedit ComputerName=$(zhw -serial)

#novell on efnet
0 Likes
joebrug Outstanding Contributor.
Outstanding Contributor.

Re: Imaging loop with ZCM

Actually just figured this out...
I took out the "zisedit -c" at the start of the script, and it no longer loops. This worked fine in ZFD, but doesnt work in ZCM. I dont remember ZFD querying for work after the script was finished. ZCM queries again when done. Guess it sets the imaging flags before it runs the script

#novell on efnet
0 Likes
martinusen Absent Member.
Absent Member.

Re: Imaging loop with ZCM

joebrug;1930505 wrote:
Actually just figured this out...
I took out the "zisedit -c" at the start of the script, and it no longer loops. This worked fine in ZFD, but doesnt work in ZCM. I dont remember ZFD querying for work after the script was finished. ZCM queries again when done. Guess it sets the imaging flags before it runs the script



Just curious, but why would you clear ZENworks Image Safe Data (ZISD) with "zisedit -c"?

Is it only for new PCs or do you do it every time you re-image?
0 Likes
joebrug Outstanding Contributor.
Outstanding Contributor.

Re: Imaging loop with ZCM

Trying to restandardize the workstation naming around here. I can't remember my exact reasoning, as it was years ago when I created it, but there was issues with the information in zisd placing itself over the top of the windows settings. don't think I really need it in there any longer, just need to think about all the steps involved... i.e. how to handle a "new" workstation booting to pxe, along with existing ones. I only have a few users who are on ZCM at the moment ( in the middle of a rollout ).

#novell on efnet
0 Likes
martinusen Absent Member.
Absent Member.

Re: Imaging loop with ZCM

joebrug;1931022 wrote:
Trying to restandardize the workstation naming around here. I can't remember my exact reasoning, as it was years ago when I created it, but there was issues with the information in zisd placing itself over the top of the windows settings. don't think I really need it in there any longer, just need to think about all the steps involved... i.e. how to handle a "new" workstation booting to pxe, along with existing ones. I only have a few users who are on ZCM at the moment ( in the middle of a rollout ).



If you clear ZISD for a device allready in the zone, the device is not able to register again with the same name (you wil get a GUID like suffix). If you for some reason have to clear ZISD for a device (during reimaging) you must also delete the device in ZCC before the device is registret again... That also works the other way around. If you delete a device in ZCC during reimaging you also have to clear its ZISD.

ZCM keeps a list of deleted device GUIDs, assuming that if you delete a device, it is because you won't see it in the zone no more. That's not completely true. If you delete a device in ZCC, I think it's possible to reimport it with a zac command. But it requires the zone admins password...
0 Likes
gerwil1478
New Member.

Re: Imaging loop with ZCM

Just a bit extra

I was playing with multicast bundles and Preboot Services/Device Imaging Work Assignment. Set a rule based on the mac address to get a multicast imaging bundle sent to a 'new' workstation. Deleted the machine from the zone as I rebooted it. But it would not PXE boot, just went back into windows. Did a zisedit -c (cleared the just imaged flag I guess) and it then PXE booted. It applied the image with the multicast screen (set to only one wokstation) and automatically rebooted at the end. But then just PXE booted again. Checked the "just imaged flag" which was set to False!!

Did a manual reimage with zisedit -c to start and at the end the 'just imaged' flag was set to True.

So I guess that's a bug or I've missed a multicast setting somewhere.

Cheers
0 Likes
gerwil1478
New Member.

Re: Imaging loop with ZCM

And a bit more extra

Turns out that the reason it did not PXE boot was the Device GUID. So deleted that, 'just imaged' Flag set to false.

1. Down comes the image.
2. Auto reboot.
3. 'Just imaged' flag set to true.
4. Device GUID not yet set.

Now the part about 'if only I'd done it another way'. My image has the agent included in its unregistered state with scripts that work well to register etc.

Windows boots up but runs through a zen agent initialisation first then reboots.

5. The 'Just imaged' flag is now set to false.
6. There is still no Device GUID as the agent has not yet registered.
7. So back to the top again.

Don't ya just love it when you figure it out and have no where to go!

Cheers
0 Likes
martinusen Absent Member.
Absent Member.

Re: Imaging loop with ZCM

GERWIL;1934267 wrote:
And a bit more extra

Turns out that the reason it did not PXE boot was the Device GUID. So deleted that, 'just imaged' Flag set to false.

1. Down comes the image.
2. Auto reboot.
3. 'Just imaged' flag set to true.
4. Device GUID not yet set.

Now the part about 'if only I'd done it another way'. My image has the agent included in its unregistered state with scripts that work well to register etc.

Windows boots up but runs through a zen agent initialisation first then reboots.

5. The 'Just imaged' flag is now set to false.
6. There is still no Device GUID as the agent has not yet registered.
7. So back to the top again.

Don't ya just love it when you figure it out and have no where to go!

Cheers



GERWIL, I think you should look into BIOS setup. Make sure that devices does not PXE boot every time.

I have my HPs BIOS'es setup in this boot order:
1 Hard drive
2 Network Controller
Another setting is called "Remote Wakeup Boot Source". This is set to "Remote Server"

If I need to do imaging I either press F12 or send a WOL packet to the machine. Then it only boots into the PXE environment once.

I guess that this setting would give your device enough time to register?

/Anders
0 Likes
gerwil1478
New Member.

Re: Imaging loop with ZCM

"Remote Server" Nice setting if you've got it.

I have set all workstations to boot network card first, hard disk second and DVD third. I was hoping to be able to wake the device via a scheduled WOL packet, reimage the workstation and then shut down ready for the new day while I was tucked up asleep.

Having the network card boot first means I can assign the image to a device while on the phone to the client, ask them to reboot and tell them to go to lunch.

One other funny thing with the Acer BIOS is that if you hold the ctrl/alt keys from boot up it goes straight through the network card boot. If you F12 and specifically select to boot from the network card then ctrl/alt it PXE boots!

Anyway it's not a big issue for me as we only have about 250 devices and its unlikely I'll need to reimage overnight. Just that it would have .....

I may be able to get the agent to initialise and then reimage the device so that it does not need to reboot and gives the agent a chance to set the GUID. Would also be a nice enhancement if you could specify the 'Just imaged flag' and Device GUID existence in the rule construction in Device Imaging Work Assignment.

Thanks for the reply

Cheers
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.