Script Template Vm’s Creation on Esxi V5 (cloning)

This script does the following:

  • List of the current machine’s name based/stored on the target destination.
  • Ask for the name of the new machine.
  • Type of machines (Windows 2003 / Centos / etc…)
  • Create the image based on the template’s machines.
  • Register the vm into the Vsphere inventory.
  • Asking you if you wish to start or not once created.

To use this one on your Esx(i), edit the file and replace some variables:

  • Datastore source (where the template’s machines are available and stored)

datasource=”/vmfs/volumes/datastore_1″

  • Datastore as target (where the target ‘s vm would be created).

datatarget=”/vmfs/volumes/Datastore_2″

  • Source image name (templates) Folder’s name of your template.

source_vm_centos=”centos-r”
source_vm_w2k3=”win2003-template”
source_vm_w2008=”win2008-64″
source_vm_wxp=”winXP-T”
source_vm_w7=”win7-T”

– Memory set of the vms (ie: I have set 1GB for any type of vm created.)

VMMEMSIZE=”1024″

Download the script.

I have recently found this Howto from the vmware’s community, this might help to review my script and add the choice with Datastore to wish to generate the clone.

communities.vmware.com/docs/DOC-9321

 

Leave a Reply