VMware

This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
3 Replies Last post: Nov 4, 2009 6:11 AM by LucD  

Is It possible to run a Customscript after a Machine is Created? posted: Nov 3, 2009 12:38 AM

Click to view shatztal's profile Enthusiast 102 posts since
Feb 4, 2008

We Deploy From Templates lots of vm's . and i wrote a VI Powershell Script that is adding some Details to the VM that in the VI client we can see like "Description" "Owner" "Domain"
it is for Order Purpose only .
i want that after i Deploy a Machine it will run the script on my Guest PC so that i can input the details as it says.
is it possible ? have you any idea maybe on an other way?

Edited:

have created in vShpere CLI a script that is ps1 extended.

i want it to run after the Sysprep finishes when the user logons to the computer but just one.

in the Customization Wizard we can put in thing for "Run Once"

hwo can i put in a script like that? don't forget that is not a Powersheel script it is the VM powershell so it is more diffecult to run the script automatic.

the only ways is from direct vShpere cli Shell but i want to make it automatic withour user interupts.


Click to view LucD's profile Champion 2,431 posts since
Oct 31, 2005
See my answer in your other thread.
Click to view LucD's profile Champion 2,431 posts since
Oct 31, 2005
You can create an Alarm for Virtual Machines that looks for specific events and that is triggered by the event "VM Created".
In the action "Run a command" you can then start a PowerShell script.

Have a look at Carter's blog entry How to run PowerCLI scripts from vCenter Alarms for an example.

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities