VMware {code} Community
sahmed24
Contributor
Contributor
Jump to solution

how can i clone a vmware machine on ESXi?

Hi

i have ESXi server. I am using VSphere Client to connect to VCenter Server. I can see the clone option is available in VCenter Server.

I am using VIX API to crate snapshot, copy data into guest, run program in to guest etc. But the Clone operation is not supported in VIX API. My host machine has windows, and i am using C# to call VIX API.

How can i create linked clone since i can not use CLone function of VIX API? I want to create the clone from the development machine, where i am running my C# code. I am not interested in running scripts in VCenter directly.

//Rizwan

0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

If you're new to VMware API/SDKs, please take a look at this documentation -

There are various SDK's that bind to the vSphere API which is exposed as a standard web services. Depending on your requirement/comfort and language, you select the appropriate SDK. Again, all this is described in the getting started document, definitely recommend you spend some time reading the document before getting started.

You'll also find lots of resources on the Developer Forums - http://communities.vmware.com/community/developer

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

View solution in original post

0 Kudos
5 Replies
lamw
Community Manager
Community Manager
Jump to solution

Any type of cloning (full and linked) requires vCenter. These operations are not supported on a standalone host (esx or esxi)

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
sahmed24
Contributor
Contributor
Jump to solution

yes, i have VCenter, how can i do it then?

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

I'm sorry I should have been more clear, cloning operation is a feature of vCenter as you know and it'll require you to connect to vCenter and the operation will be passed down to the individual ESX(i) host.

Though with the VIX API and/or vmrun, cloning is NOT supported, even if you connect to vCenter. It's only supported when connecting to VMware Workstation.

Take a look at this reply by VMware engineer -

For cloning, I would recommend using the vSphere API, in which you can call clone function to clone VMs.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

sahmed24
Contributor
Contributor
Jump to solution

ok, so I need to connect to the VCenter with VSphere API and use Clone function, i hope i get it right by now.

but which VSphere API you are talking about, i can see

1. VSphere Web Services SDK

2. VSphere SNMP MIB

3. VSPhere Client plugin

and more

plus couple of automation tools i.e. VSphere CLI and VSphere powershell

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

If you're new to VMware API/SDKs, please take a look at this documentation -

There are various SDK's that bind to the vSphere API which is exposed as a standard web services. Depending on your requirement/comfort and language, you select the appropriate SDK. Again, all this is described in the getting started document, definitely recommend you spend some time reading the document before getting started.

You'll also find lots of resources on the Developer Forums - http://communities.vmware.com/community/developer

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos