Tuesday Oct 14, 2008

A little script to clone a VM with VMware ESX/ESXi (but no VirtualCenter)

I wanted to strike this one for my own records...

I was looking for an easy way to clone a VM without VirtualCenter and came across this, which worked like a charm, bits of which I had done before for other purposes...

http://hsukumar.wordpress.com/2008/05/14/esx-clone-without-virtual-center

So I came up with a little automation, good for when you have to "create a few"... Change according to your datastore!

Script: clone-system name-of-source-vm name-of-target-vm

SOURCEVM=$1
TARGETVM=$2
DATASTORE=/vmfs/volumes/MY-VM-STORE

mkdir $DATASTORE/"$2"

vmkfstools -i $DATASTORE/"$1"/"$1".vmdk $DATASTORE/"$2"/"$2".vmdk

About

A thin thinker down under

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today