Solved

Is it possible to use a VM Snapshot to create multiple systems?

Posted on 2008-10-09
1
1,242 Views
Last Modified: 2012-05-05
I'm not finding anything online with a clear cut answer to reusing VM snapshots to create more guest clients.  When i create a snapshot it resides in the snapshot manager of the VM I created it  under.  If I create another VM I'd like to be able to use a previous snapshot of another functioning VM so I'm not having to recreate the whole thing.  At the moment I'm using VM Converter to point to an ISO off of a windows share and create the VM or Clone it by point VM Converter to an existing VM and duplicating it but this takes such a long time; any advice?
0
Comment
Question by:user5500
1 Comment
 
LVL 6

Accepted Solution

by:
xfreddie earned 500 total points
Comment Utility
one way to hot clone is using snapshots and vmkfstools, creating a snapshot will prevent any writes to the VMs original vmdk file as all subsequent writes are written to the delta.vmdk files that the snapshot creates. You can also use this procedure to cold clone a VM if you do not have VirtualCenter. To cold clone power off your source VM first and there is not need to create a snapshot, you can omit steps 3 and 9 below.
1) Login to the Service Console
2) Switch to your VMs directory, ie. cd /vmfs/volumes/MyVolume/MyVM1
3) To create a snapshot type through the command line you can use vmware-cmd, the syntax is: vmware-cmd <path & name.vmx file> createsnapshot <name> <description> <quiesce> <memory> ie. vmware-cmd MyVM1.vmx createsnapshot MyVM1 Snapshot Clone snapshot 1 0. Setting memory to 0 prevents the snapshotting of the VMs memory which we do not want for the clone. It will return createsnapshot(MyVM1 Clone snapshot 1 0) = 1 when it successfully creates the snapshot. Optionally you can create the snapshot using the Snapshot Manager in the VI Client.
4) Next create a new VM (for this example we will call it MyVM2) on the ESX host using the VI Client. Its best to assign the NIC for this VM to an Internal Only vswitch (no physical NICs assigned to the vswitch) so it does not conflict with the existing VM. When it comes to the hard drive you can accept the 4GB default or make it smaller since you will be deleting it anyway. Do not power this new VM on.
5) Switch to your new VMs directory and delete the vmdk files it created. Ie. cd /vmfs/volumes/MyVolume/MyVM2 and then rm *.vmdk, you will be prompted for deletion confirmation of the two vmdk files for the VM.
6) Switch back to your original VMs directory, ie. cd /vmfs/volumes/MyVolume/MyVM1
7) Use vmkfstools to copy your original disk to the new VMs directory, the format is vmkfstools i <source vmdk file> <destination vmdk file> ie. vmkfstools i MyVM1.vmdk /vmfs/volumes/MyVM2/MyVM2.vmdk
8) Once the copy completes power on your new VM, you might run chkdsk on it once it boots since you effectively powered off the VM while running and powered it back on.
9) You can now delete the original snapshot by typing vmware-cmd <path & name.vmx file> removesnapshots which will remove all snapshots for the VM. Optionally you can remove the snapshot using Snapshot Manager in the VI Client.

Step by step Information found : http://vmware-land.com/Vmware_Tips.html#VM14

Goodluck,
Xfreddie
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
Teach the user how to install log collectors and how to configure ESXi 5.5 for remote logging Open console session and mount vCenter Server installer: Install vSphere Core Dump Collector: Install vSphere Syslog Collector: Open vSphere Client: Config…
This video shows you how easy it is to boot from ISO images for virtual machines with the ISO images stored on a local datastore on the ESXi host.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now