I have created the server provisioning workflow in vCO and used it to create couple Windows 2008 servers, really nice and neat!
What it does is to Clone a template –> Sysprep it –> Configure it (IP address, hostname, admin password, join domain ….) –> Send an Email to notify the requester when the server is ready.
The key steps are:
1) Reduce the information that needs user to input. I only allow user to specify the following things, all others are hard coded in the attributes.
2) Create the following batch script in the template. Then create the Guest Customization workflow based on the ‘Run program in guest’.
@ECHO OFF
REM If there is a proxy
ECHO Setting IE proxy
REG IMPORT IE_Proxy.reg
ECHO ————————
ECHO Joining Domain
netdom join %COMPUTERNAME% /Domain:my.lab /UserD:user@my.lab /PasswordD:********
ECHO ————————
ECHO Activating Windows
cscript //B c:\windows\system32\slmgr.vbs /ipk XXXX-XXXX-XXXX-XXXX-XXXX
cscript //B c:\windows\system32\slmgr.vbs /ato
ECHO ————————
ECHO Restarting…
shutdown /r /t 0
3) Create the following batch script in the template as well. Then create the VM Ready workflow based on the ‘Run program in guest’.
@ECHO OFF
ECHO From: Service-VCO > C:\Windows\Scripts\VM_ready_log.txt
ECHO To: %1 >> C:\Windows\Scripts\VM_ready_log.txt
ECHO Subject: %COMPUTERNAME% is ready to use >> C:\Windows\Scripts\VM_ready_log.txt
SYSTEMINFO >> C:\Windows\Scripts\VM_ready_log.txt
ECHO. >> C:\Windows\Scripts\VM_ready_log.txt
C:\Windows\Scripts\sendmail.exe -t < C:\Windows\Scripts\VM_ready_log.txt
It looks like this when it works:
Hi,
nice workflow tutorial.
I’m relatively new to vCO and learning how to do workflow.
I’d like to try your workflow, could you share your workflow package, or detail more “Scripting Task” and the different parameters in the workflows elements ?
Thank you.
M. Zhang
Well, when building up a new VM you have to provide the guest name and the VM name that is referred by vCenter, which means user have to type the name twice. To simplify it , I use the following script to make them same.
name = clientName;
Chen.. Could you pls send me the work flow or instruction steps.
my id is arif024@gmail.com
Hi Jackie,
Good day!
In my case, I want to run my local bash script (e.g. /var/www/runTesh.sh) located in the vco server via workflow. Can you guide me how to do it? Sorry just new to vCO just started last month working exploring.
Thank you.
J Chiong
I assume your vCO server is a virtual appliance. If so just use the pre-defined workflow ‘ ‘Run program in guest’ into your workflow.
Is there a way to get a peek at the workflow please?
Hi Steve, it is pretty straightforward to create such a workflow. All the key steps and scripts are already listed in my post.
Hi Jackie,
I am new to VCO, trying to create workflow to create VM from template with guest customization.
Could you please send me the workflow please.
Thanks
Anka