VMware Cloud Community
Joe_Watts
Contributor
Contributor
Jump to solution

How to detecting status of the template deployment process?

I am using powershell and the VI-Toolkit to to deploy a XPSP3 template. I need to be able to detect programaticly when Sysprep and the VMware customizations that follow have completed, so that I can launch additional installations via the powershell script.

I am running VMware ESX Server 3i, 3.5.0, 153875, and I am using the VI Toolkit 1.5.

I started out polling the VM to see if the VM was powered on, this works great. Then I started trying to look into the VM using the Invoke-VMScript command to try and see what is going on, this hasn't worked so great, mostly because I'm not sure what I should be looking for. I also spent a significant amount of time trolling through the VI-Toolkit cmdlets, to see if there were any tools for detecting the staus, I am thinking that I overlooked somthing.

Any help with this would be appreciated.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

I use the CloneVM_Task method from the SDK for deploying guests from templates.

Did you have a look at Rob's script in .

That script also uses the CloneVM_Task method and has an option for running post-install scripts.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

Welcome to the club Smiley Wink

There is no way, afaik, you can directly find the status of the sysprep process in the guest.

The only way that I was able to use is the following:

*) as part of your sysprep process place an eye-catcher (file or registry entry) on the guest

*) use Invoke-VMScript to check for the presence of this eye-catcher on the guest

But the method has flaws, the placement of the eye-catcher is not at the end of the sysprep (iow just before the final reboot).

So you could still try to access the guest too soon.

In the end I inserted a sleep cmdlet in the deployment script, but the duration of that sleep is based on what the average guests require.

It's not a fool-proof method but it works for now.

On my list of possible alternatives I also have monitoring snmp traps coming from the guest on a management server.

But that project is still in a very early stage.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Joe_Watts
Contributor
Contributor
Jump to solution

I have attempted what you have outlined as well, and was hoping for more.:)

When implementing the process you outlined, I have run into issues with the RunOnce command. I have only attempted to congifured the RunOnce from withinCustomization Specification. I have found that it doesn't work, and if haven't delved into it sysprep enough, at this point, to come up with a work around.

Suggestions?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I use the CloneVM_Task method from the SDK for deploying guests from templates.

Did you have a look at Rob's script in .

That script also uses the CloneVM_Task method and has an option for running post-install scripts.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Joe_Watts
Contributor
Contributor
Jump to solution

Not yet, but now I am going too.

Thanks!!!!

Joe

0 Kudos