VMware vSphere

 View Only
  • 1.  Copying only the vmdk file to create backup

    Posted Oct 23, 2009 04:51 PM

    I am totally new to VMware and ESX 4, but have decided to use ESX to host a web server on Windows 2008 Server vm, after about two weeks of reading and testing the VMware product. I have used other virtual machine products the last year or so for other projects.

    Why not just copy vmdk files to create backup vms? Will this cause any problems? I would not be running the clone at the same time as any other vm used to create or created from the copied vmdk file. I have tested this with an NT4 Workstation vm, because the files are small and can be copied and moved quickly, and I have not experienced any problems.

    I am using Vsphere Client to copy the vmdk file into a folder in the root of the datastore and then creating a vm, naming the vm the same as the folder. I have created one template of the w2008 vm using Vsphere Converter Standalone, but copying the vmdk is so much simpler and faster than rerunning the converter again on the template should I need it.

    I have created a Windows 2008 Server vm and want to go forward testing the installation of Tomcat and MySQL. Should the OS get messed up, I thought I could start over with just using the current vmdk file I copied. I don't yet trust using snapshots, etc. I have also created numerous Linux vms on the ESX server for further testing of using Tomcat on them. I also have an XP Pro vm as an emergency alternative. It is XP Pro on a workstation that is currently hosting the Tomcat/MySQL production web site - slowly.

    Thanks,

    Homerun



  • 2.  RE: Copying only the vmdk file to create backup

    Posted Oct 23, 2009 05:15 PM

    If you are only using it for testing - why not convert the VM to a template and then recreate the VM from the template and everytime you need to recreate it you can use the template as an exact copy of the original VM.

    This assumes you have VCenter if you don't and you don't trust snapshots - not sure why. It will have to be a manual copy of the VMDK file and create a new VM to the same configuration each time.



  • 3.  RE: Copying only the vmdk file to create backup

    Posted Oct 29, 2009 03:57 PM

    Thanks for the reply.

    I am using vSphere client without Vcenter. I have abondoned for now trying to get a problem free backup vm running from just a copied vmdk, though it is seems to work well for the NT 4 systems I tested.

    I have tried using the Converter Stand Alone Client with limited success. I am going to post separately about an issue I am having with Converter.

    I have been testing snapshots with success, but still want to create a clone or template of the system now and again as we prepare it for production. I have numerous additional vms (XP, Linux, 2003SBS, NT4W, NT4S, RHEL, SLES, openSUSE) on the same ESX server for practicing purposes. Very sweet product ESX. The SLES 11 and openSUSE 11.1 seem to have proper mouse without me having to install the VMware Tools, at least manually.

    What about copying all the files in a VM folder to another folder to create a backup/clone/template. I have already done this, but I don't know yet how well the system will function when needed. I notice the the Converter changes a VM using static ip to a copy using DHCP and changes the MAC address. I presume other things are also changed by the Converter that a straight copy will not do.

    Homerun



  • 4.  RE: Copying only the vmdk file to create backup
    Best Answer

    Posted Oct 29, 2009 04:47 PM

    Have a look at http://communities.vmware.com/docs/DOC-8760 for a script that can automate cloning of the Virtual Machine. When you start up a VM that has been cloned ESXi will prompt you "I copied it" or I moved it" etc. If this is a copy, you would respond with "I copied it" and ESXi would change MAC, UUID etc. The only files needed are the VMDK files and the VMX file. The others will be recreated as the machine is added to the inventory.

    As for tools I would install them. It also includes drivers to allow the ESXi host to communicate with the VM for things like graceful shutdown etc.



  • 5.  RE: Copying only the vmdk file to create backup

    Posted Oct 29, 2009 10:08 PM

    I recall getting a "I copied it" or I moved it" previously and think it may have occurred when I copied all the files from one vm folder to another. Just copying the VMDK files and the VMX file seems easier than anything else for my purposes. Thanks for letting me know that is workable.

    I'll read the ghettoVCB.sh document tomorrow.

    Homerun