VMware Horizon Community
liorb
Contributor
Contributor

Post synchronization scripts not running - approaching hair-pulling border

To anyone who can help on this one, it will be highly apriciated!

I've been trying to get the post-synchronization scripts to work for the past two days and am no closer then before. At first i thought it was related to the fact that the computers were failing to join the domain, but i worked that one out (btw, VMware, some documentation on that would have been nice. i mean, having the original base image be a part of the domain for it to work is not the first thing i would have thought of).

Anyway, now they're joining the domain, but the post-sync script is still not running, i'm getting nothing that seems related on the logs (machine, composer/vcenter, or view) or event logs, and i know for a certainty it doesn't even start running the script (i've added some internal logging to the script to know if it ever starts running, and... nope - it doesn't).

Anyway, i've searched the intertubes, the discussions groups (search feature + about one month back manually), and tried everything i encountered (having one batch called the other, double check permissions, recreate the pool, some others), and still no joy. I'm at the point of breaking stuff so i though it was about time to ask for some professional help.

If anyone has encountered, managed to solve, or has the remotest idea for me to try and get this running, i'll worship you as a god.

Thanks,

Lior

Reply
0 Kudos
15 Replies
patten_aaron
Enthusiast
Enthusiast

Lior,

Any luck on this yet? If not, can you post what is in your script, location, etc? You should have a batch file that calls your script for execution (only .bat files supported it seems). Give it a path with no spaces, like "c:\callscpt.bat" or something that actully calls the script.

~Aaron Patten

Please award points for helpful answers. I got kids to feed Smiley Happy

~Aaron Patten Please award points for helpful answers. I got kids to feed 🙂
Reply
0 Kudos
liorb
Contributor
Contributor

Nope, it still doesn't work. I've tried having a script that calls another but it just doesn't run.

Currently the script i'm running is located at c:\temp\runme.bat and it contains the following lines (no blank or special fancy stuff, notes on the side in bold):

ping 1.1.1.1 -n 10 -w 6000 >> c:\temp\log.txt | pings nowhere in order to create a short delay

ping 10.x.x.x >>c:\temp\log.txt | pings a local subnet server to check for connectivity

dir "
fileserver\"
>>c:\temp\log.txt | outputs the content of a network directory to check for access/permissions

"
fileserver\installationfile.exe" | runs
an automated installer file

None of this, of course, ever runs. The script works perfectly when i manually run it (same user, same permissions, built in domain administrator for the curious). When i set it as the post-sync script, it never actually runs (the logging to c:\temp\log.txt never occurs at any point). I've tried re-creating the pools, the base image, the script, and what have you - no joy!

Anyone had any luck getting this script to work, or am i drawing dead here?

Reply
0 Kudos
admin
Immortal
Immortal

Have you read this: http://www.thatsmyview.net/2009/04/16/post-syncronization-scripts/

Regards,

Christoph

Don't forget to award the points if this answer was helpful for you.

Blog:

http://communities.vmware.com/blogs/dommermuth |

Reply
0 Kudos
liorb
Contributor
Contributor

Yeah, i've pretty much ran all over documentation, but as i've said - the script doesn't even seem to be triggered.

Reply
0 Kudos
liorb
Contributor
Contributor

Anyone using this feature at all? sucessfully?

Reply
0 Kudos
admin
Immortal
Immortal

Try to call the script that way: c:\system32\cmd.exe /c

c:\dir\file.bat

If it fails pls. configure the debug logs on the agent and/or the View Composer.

Check my article for more information: http://www.thatsmyview.net/faq/logging/

Regards,

Christoph

Don't forget to award the points if this answer was helpful for you.

Blog:

http://communities.vmware.com/blogs/dommermuth |

Reply
0 Kudos
liorb
Contributor
Contributor

You mean have a batch file (callscript.bat) with that command calling my batch file (script.bat)?

And to configure the post configuration script as callscript.bat?

Reply
0 Kudos
admin
Immortal
Immortal

Yes, I would try that.

write a batch file C:\test.bat and use the command ...cmd.exe scripname.bat to call it.

If it fails please enable debug logging.

Regards,

Christoph

Don't forget to award the points if this answer was helpful for you.

Blog:

http://communities.vmware.com/blogs/dommermuth |

Reply
0 Kudos
daleallenc
Contributor
Contributor

Same issue here, at least I think it is.

- I've got "C:\postsync.bat" listed as the QuickPrep post-synchronization script.

- postsync.bat is in the Parent VM and has only a single line in it "cmd /c sqlscriptnames.bat"

- sqlscriptnames.bat is also in the Parent VM, and points to a SQL Server 2005 script to match the SQL Server name to the %COMPUTERNAME%, and restarts the SQL Server services

- I've tested these files on the Parent VM and they all work, together, or independently.

- At logon to the vClone, the SQL Server name has not been changed.

I've come to the conclusion that the script is not running OR that it has run, but before customization has taken place. Do we know at which point in the provisioning process that a script is actually run?

I also have a workaround, but I don't like it. Just before shutting down the Parent VM in preparation for cloning, I can add a pointer to the RunOnce registry key for one of the batch files. The reason I don't like it is that it requires user logon before it implements.

Reply
0 Kudos
Gamer1971
Contributor
Contributor

I too have had this same issue and worked on it for days. Little did I realize that I kept thinking "post synchronization" was something that was supposed to run after the parent created a new linked clone. I've come to realize this is not the case - at least it's never run a single thing on my systems. I've read the documentation, even the suggested documentation in this post, and nothing even comes close to providing enough real information for a system admin to use. It's a lot of fluff and not nearly enough substance. I have also never seen this used in a demo by any of the VMware presenters ... a lot of talk but no true show. I've opted to bail on even using a post-creation script and opted to set all my other software agents that look at the system hostname for some reason as installed, but rip out any GUIDs and let them automatically create on next power on. Too frustrating to waste days on troubleshooting something VMware hasn't documented well.

Reply
0 Kudos
admin
Immortal
Immortal

What verison of VMware View are you running?

I believe there may have been an issue with this in View 3.0.0 that was corrected in View 3.1.0.

Reply
0 Kudos
liorb
Contributor
Contributor

Well, i'll concentrate new information here.

I've tried the script calling another script (as suggested), but still nothing, it just never attempts to run it. I've tried setting the debug logs, but i'm still baffled at what am i supposed to find there, there seems to be no mention of the script ever triggering at all. As someone here already said, i'm starting to think that this feature is either completely borke, or just poorly documented.

I'm using version 3.1 (someone here asked), and had no luck getting this to work. Seems like a complete waste of time though, i'll just push something into the "startup" routine before i close the image, not elegant, but i can't afford to waste more time on this.

Lior

Reply
0 Kudos
Gamer1971
Contributor
Contributor

I'm up to version 3.1.1 now and nothing happens with the post-synch script. I tried changes to the registry before capturing the snapshot so scripts run on startup - and the "autoadminlogon" gets reset back to 0. I can set it perfectly and just restart the master and everything works perfectly, but when Composer takes over and creates the new systems it only runs when someone logs on the first time. Since 98% of my users don't have admin rights it kind of puts that out of the question. Wish they would put some more documentation out there.

Reply
0 Kudos
liorb
Contributor
Contributor

Yeah, i know what you mean, i'm doing some combo self-destructing script running with CPAU (runas on steroids, combo with elevation power tools for vista), I tested it before and it seemed to work, i just need to finish it up for my needs. again, not my preferred choice, but at least it works.

Reply
0 Kudos
admin
Immortal
Immortal

For those that have tested with 3.1.x and still can not get their post synchronization scripts running, can you open a ticket with VMware Support to make sure this gets resolved?

If you have opened an SR, can you please post the SR # and I will bring this to the attention of engineering.

Thanks.

Reply
0 Kudos