VMware {code} Community
tbrouwer
Hot Shot
Hot Shot

Help Cloning VMs with vmclone.pl + customize guest .xml and .xsd

Alright, all I want to do is clone either a VM or a template into another VM and be able to customize like I can through VC (deploy VM from template function). I need to be able to change the name of the XP vm and join it to the domain.

I am using vmclone.pl and can successfully clone a VM, but cannot customize the VM.

Here is the command im running:

vmclone.pl --url https://servername:443/sdk/webService username myusernamepassword mypassword--operation clone --vmname

Sales5 --vmhost esx4.mydomain.com --vmname_destination salestest --filename myconfig.xml

I created the xml with the example in the vmclone.pl documentation. The vm does not customize anything after cloning

I've searched and searched, but cannot find a good explanation of how to do this with .xml files and .xsd (??) files.

Also, the VM always goes onto the same ESX host and same datastore; how do I change that.

Thanks!

Reply
0 Kudos
6 Replies
tbrouwer
Hot Shot
Hot Shot

Anybody have any sort of advice on using .xml and .xsd files with vmclone.pl ??

Reply
0 Kudos
SaranshG
Enthusiast
Enthusiast

Try using following sample xml and xsd

/sdk/vimService --username xxx --password yyy --vmname Test --vmname_destination Demo --customize_vm yes --filename ..\sampledata\vmclone.xml --schema ..\schema\vmclone.xsd --operation clone

Reply
0 Kudos
tbrouwer
Hot Shot
Hot Shot

Thank you!

I have successfully cloned a VM with those examples, however, I have 2 issues.

It will not pass the local admin password for the XP running on the VM. It prompts me for that while running through sysprep

How can I force the VM to startup after the clone is complete?

Any advice?

Message was edited by:

tbrouwer

Reply
0 Kudos
tbrouwer
Hot Shot
Hot Shot

eck, I just realized I was using the older version of vmclone.pl (from the beta)

I upgraded to the current release, and some things are different, but it looks ok. Still have the same above problems though.

Message was edited by:

tbrouwer

Reply
0 Kudos
hrobinson
VMware Employee
VMware Employee

The first question is easy.

You could edit the file and force a power on or better to simply invoke.

to put the two scripts together, you can use

set VI_SERVER=

and these environment variables will be inherited for both scripts. If you use the SERVER argument, you don't have to include https:// ... /sdk in the string.

H

vmcontrol.pl --vmname xxx --operation poweron

Reply
0 Kudos
tbrouwer
Hot Shot
Hot Shot

Great, thanks!

Now the only other hurdle I have is passing the admin user/pass that should be set when XP is running through the sysprep after cloning. I can pass the license key, domain credentials, pc name, etc with the xml file, but cannot figure out how to pass what the administrator password should be set to.

Reply
0 Kudos