Tags

, ,


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

Advertisements