VMware Cloud Community
Snowy662
Contributor
Contributor

linked clone in vCenter 4

vSphere Web Service SDK provides API to leverage linked clone in vCenter 4.

I know linked clone is actually from another product VMware view. My question is

1) After created VM by linked clone API, how can it be managed by vCenter?

2) Is it a reasonable idea to use linked clone in vCenter 4 without vmware view?

thanks,

0 Kudos
8 Replies
AndreTheGiant
Immortal
Immortal

1) After created VM by linked clone API, how can it be managed by vCenter?

You just see a VM, you can use it, but you cannot change the linked clone from the GUI

2) Is it a reasonable idea to use linked clone in vCenter 4 without vmware view?

Fro example in a lab to minimize the disk space, you can create a clean server, then multiple linked clone and then customize each clone.

Andre

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
0 Kudos
Snowy662
Contributor
Contributor

Thanks for the details.

Could you pls. more specific for "changing the linked clone from the GUI"? what kind of operations are you refering to?

thanks,

0 Kudos
AndreTheGiant
Immortal
Immortal

For example you cannot change the master image pointer to another.

But this is the same also in View, to change the "master image" you must work on View Manager and not on vCenter Server.

Andre

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
0 Kudos
lamw
Community Manager
Community Manager

1) You manage it like any other VM, each Linked Clone if deployed properly will be unique as if you created X number of VMs. What I mean by this, assuming you're cusotmizing each guest whether that's Linux/Windows such as providing/setting a unique IP/hostname for each guest or even joining your Widnows system to AD. In terms of the vCenter management, all things that vCenter provides still hold true such as DRS/HA ... some things that may not work are sVMotion since your Linked Clone has its own delta disk but also references the parent base disk and you want to keep all those within a datastore. Havind said this, I know that you can have your base sit on one datastor and create your linked clones on another datastore and they'll function perfectly fine. It all depends on the requirements and how you create/deploy your Linked Clones.

How you manage your individual Linked Clones and the base in terms of updating/re-deployment gets a little complicated because there's few ways of doing it and that is probably driven by your use case and what you need.

2) Yes, as of vSphere, there's been some new APIs introduced that allow you to officially create Linked Clones and you are not required to use View or Lab Manager to created Linked Clones. View does provide some added benefit for some higher level abstraction and some nice management features via the the GUI, but again majority of the features can be re-created using the vSphere APIs.

Here are some additional links that may be helpful including a vShpere SDK for Perl script that shows you how you can implement Linked Cloning, also VMware white paper on how to use the new API functions and some shell scripts that implements Linked Clones in ESX(i) 3.x.

Linked Clones on vSphere: http://planetvm.net/blog/?p=777

Here's another great read on how Linked Clones work in View and they can function simliar if you use the APIs to create, just depends on how you design the setup.

http://rodos.haywood.org/2008/12/storage-analysis-of-vmware-view.html

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

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 Comuunity

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

Snowy662
Contributor
Contributor

Appreicate all those details, William.

Actually I have more questions here

1) after create the 1st linked clone VM, will the parent VM become a linked clone VM using delta disk as well?

2) can I create 2nd linked clone VM from the same parent VM?

3) If I want to update my OS on the base disk, how can I do that?

4) also, do you know if I can create a linked clone vm from template through web interface API?

thanks,

0 Kudos
lamw
Community Manager
Community Manager

1) No, the parent is whatever the parent was either a standard image and I guess you can probably do a linked clone of a linked clone (probably don't recommend)

2) Yes, so long as the VM is either in a powered off state or snapshot is available to clone from.

3) You need to destroy all Linked Clones, update your base and redeploy. This is the same for View, the only difference is there is a replica that is actually cloned out fro your 'Golden Image' and the Linked Clones are generated from this replica. This allows your base to be independent of the LInked Clones, you update this image, re-deploy which clones out a new replica and then the LCs are attached to the replica.

4) No, you deploy VMs templates, you can't do any type of linkage.

I would recommend you go over all the documentation to help you understand how this works, here is an older doc comparison between standard clones and linked clones: http://www.vmware.com/support/ws5/doc/ws_clone_overview.html much of the concepts still apply. Another good way to understand this is to perhaps try View or my ghetto-linked-clone scripts (works only on 3.x) and once you get a better understanding, you can take a stab at using vSphere APIs to create your own Linked Clones.

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

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 Comuunity

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

Snowy662
Contributor
Contributor

Through web services API, I got linked VM created from snapshot without custimzation. But after I added customization logic, I got similar error on both Windows 2003 EE and RedHat 5.

On windows, "A specified parameter was not correct. spec.identity.userData.computerName"

on Linux, "A specified parameter was not correct. spec.identity.hostName"

Here is my Linux code,

CustomizationLinuxPrep cLinux = new CustomizationLinuxPrep();

+ cLinux.setDomain(globalDnsDomain);+

+ cLinux.setHostName(new CustomizationFixedName());+

+ ((CustomizationFixedName) cLinux.getHostName()).setName(clonedVMName);+

+ cs.setIdentity(cLinux);+

I do notice on vCenter console, when I try to do a normal clone from template and select customization option, it prompts "Error readind customization specification.".

Any idea?

0 Kudos
Snowy662
Contributor
Contributor

Never mind. It was caused by improper hostname which contains "_".

0 Kudos