vCO: Server Provisioning Workflow


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.

image

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.

image

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:

image

 

image

Advertisement

8 thoughts on “vCO: Server Provisioning Workflow

  1. 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

    1. 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;

  2. 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

  3. 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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s