VjAtFuGen
Contributor
Contributor

Clone from a SnapShot?

Hi,

I am new to the Virtualization technology, so this may be a dumb question - Is it possible to create a clone of VM using a snapshot of the machine rather than the current running version?

When we checked the Perl Toolkit there was a script called "clone.pl". But it appearst that this script supports cloning from a currently running version. If we can clone from a snapshot, how does one identify a snapshot and clone as a new VM?

Thanks for your responses,

Vijay

Tags (2)
0 Kudos
9 Replies
admin
Immortal
Immortal

Yes it is but it requires using the command line.

Add a snapshot to the VM you want to clone, then log into the command line and use

vmkfstools -i /vmfs/volumes/yourvol/yourvm/yourvm.vmdk /vmfs/volumes/yourvol/yourclone/yourclone.vmdk.

Then create a new VM and select use an existing disk and point to yourclone.vmdk. You can remove the snapshot from the original VM when the vmkfstools operation is complete.

Have a read of this article for more details: http://vmetc.com/2008/05/26/cloning-a-running-virtual-machine-using-the-service-console/

VjAtFuGen
Contributor
Contributor

Hi,

Thanks much for the helpful post and pointing us to the article on cloning using Service Console. However, I do have a basic question - how does one login to the Service Console of the host? I tried SSH / Telnet using Putty but get a Connection Refused error from the VmHost.

Thanks once again,

Vijay

0 Kudos
Chris_Howard
Hot Shot
Hot Shot

I presume you are using an ESX host, not vmware server etc.

If so, by default the root account cannot log on remotely via ssh.

You will need to log in locally on the console first, or use ilo or similar to do this.

- you may then change the ssh config by editing the file /etc/ssh/sshd_config, and setting the line that says PermitRootLogin to Yes, and then restarting the sshd service (service restart sshd).

If you found this helpful please consider the use of the Helpful /Correct buttons to award points. Thanks !!

If you found this helpful please consider the use of the Helpful /Correct buttons to award points. Thanks !!
VjAtFuGen
Contributor
Contributor

Hi,

Thanks for the response, it has been helpful. However, when we access the console from physical attachment of a terminal to the server, I still don't see a way to getting to the command prompt to make the suggested changes. When we login, all we see is a set of Menu options that allows us to change management network IP addresses and view logs. Perhaps there is a key combination that we are missing that can show us the command prompt?

We are using VmWare ESX 3i v3.5 - build 67921.

Vijay

0 Kudos
Troy_Clavell
Immortal
Immortal

you can import the RCLI Appliance. See link below for instructions.

0 Kudos
VjAtFuGen
Contributor
Contributor

Wonderful, this was it. Once we installed the RCLI as an appliance and powered it on, we can access the command line console, didn't realize that this is the console for the VmHost.

Thanks to everyone for helping!

Vijay

0 Kudos
Troy_Clavell
Immortal
Immortal

glad I could help!

please consider awarding points for helpful/correct answers

0 Kudos
Chris_Howard
Hot Shot
Hot Shot

Ah - I see you're running ESXi. the main architectural difference between ESXi and ESX is they have removed the service console component (in fact they've actually replaced it with a stripped down linux console called busybox), which means you can no longer ssh in.

Service console functionality is now provided through the remote cli, as Troy pointed out.

If you found this helpful please consider the use of the Helpful /Correct buttons to award points. Thanks !!

If you found this helpful please consider the use of the Helpful /Correct buttons to award points. Thanks !!
0 Kudos
VjAtFuGen
Contributor
Contributor

OK, now that we figured out how to run the RCLI command console as well the VI Perl toolkit I have run into some additional questions -

1. By using the snapshotmanager.pl script we can get a listing of all existing snapshot of a Virtual Machine. I am listing a sample output from our environment -

C:\Program Files\VMware\VMware VI Perl Toolkit\Perl\apps\vm>perl snapshotmanager.pl --vmname VM-Win2k302-161 --url --username root --operation list

Enter password:

Snapshots for Virtual Machine VM-Win2k302-161 under host vmhost101.localdomain

Name Date State Quiesced

BaseWin2K3-SP2 Image 2008-01-18T20:03 poweredOff N

Image-OnApr4-Phase1 2008-04-17T01:23 poweredOn N

Image-OnJun6-Phase2 2008-06-11T00:01 poweredOff N

Question is how do we know which ".vmdk" is associated with what version of the snapshot in order to use the vmkfstools command line? We need to clone from a previous version of the snapshot - in this case snapshot from April 4th.

Thanks for your kind response,

Vijay

0 Kudos