restore snapshot of vcenter...oops vcenter is gone

Posted on 2012-12-29
Last Modified: 2013-01-01
So...while on holiday shutdown and after installing some network infrastructure I decided while home and bored I'd move my vcenter and sql servers from local drives to network drives with hopes of enabling HA and what not.  My first attempts were to 'migrate' but the problem with that is the VM needs to be powered off and the VM's to be migrated are vCenter and SQL server so if they're off I can't exactly migrate them since I have no vCenter. Thus I tried cloning which worked but I did something I didn't want to do so I killed it and started over and then thought I should just 'move to another data store' except that this copies everything including all snapshots which was taking forever so in the process I thought hey just kill it, delete what's on the nfs share and go back to cloning. Catch my mistake??? I wind up deleting what was already moved which turns out was the .vmx file so when I went to add it into inventory there was no .vmx file to use. Of course I immediately realized I 'moved' files and already deleted them. I'm left with intact snapshots (I think) and an intact vmdk thus I need the simplest way to get the vCenter back online. Still have a few days left of holiday shutdown so I"m good. H E L P !!!! Thanks!
Question by:jumper14k
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5

Author Comment

ID: 38729738
Since my DB is external would it be simpler to install another windows server...and then restore the system data...If that's easier what would be the steps. in other words, 1.) install MS server, 1a) does the hostname have to be the same? 2) install backup client, 3) install vcenter app and SQL DSN, 4) restore system state. I'm guessing the above steps so if anyone knows the process it would be helpful.

Another thought can you manually rebuild a .vmx file. My sql and vcenter servers are exactly the same build but different apps, add it to inventory and it grabs the vmdk file with no issues. Yeah, I hoping for something this simple.

Author Comment

ID: 38729920
Hmmm, it's Saturday with little activity. I found out how to recreate the vmx file. Still an issue as it turns out the move files to another data store is still working (thought I canceled it) and  yet files were deleted earlier. I'll have to just wait to see what happens with that. I'm looking at the vmdk files and I think I deleted the original. There is a 67GB snapshot so I think I'm back to the beginning where I need to figure out how to initiate a restore of that...

All suggestions still welcome.
LVL 121
ID: 38729994
see my EE article about snapshots

HOW TO: VMware Snapshots :- Be Patient

do you have all the virtual machine files (parent and snapshot files)?

can you screenshot the datastore of all the files?
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.


Author Comment

ID: 38730214
I'll check but can't be sure since I didn't realize I was deleting files. I'll get back with you later.
LVL 121
ID: 38730226
the easiest way out of this mess, would be to create a new virtual disk for vCenter server, by merging the snapshot files with the parent, and create a new clone virtual disk.

This can then be added to a new virtual machine, e.g. new VM created and this disk added.

the command is:-

vmkfstools -i <most recent snapshot file name> /vmfs/volumes/<temp folder name>/<newfilename.vmdk>

if you screenshot the datastore, I can give you the exact command to use, and providing you have all the files available, and the snapshot chain is entact,. you will be able to create a new cloned vmdk.

Author Comment

ID: 38731478
I thought I sent this earlier something didn't work. Anyway since the files were moved the snapshots have the same date however the 67GB is from 12-14-12.


Author Comment

ID: 38732501
Hey one more thing...I'm going to refer to your solution as scenario A and my frazzled thought process as scenario B.

In scenario B, I've installed Windows 2008 server, reinstalled vCenter, have given it the same host-name of the vcenter server in question and will clone it and run through different scenarios with it while I wait your update of the 'exact syntax to restore my snapshot'.

In scenario A however, I have a question...what happens to all the changes that occurred after 12-14 if the snapshot restore is successful? There were many changes made to 10+ hosts with respect to upgrading esxi hosts, adding new VM's etc.?

In scenario B I've already reconnected to the DB, launched my vshpere client, connecting to vcenter. I see all my hosts although they show disconnected yet at least I can add the users, groups back and start the vCenter from scratch.  

Yet, if I restore my original back to 12-14 and everything gets 'magically' updated from each host that would obviously be the better route.

Please advise...and thanks

Author Comment

ID: 38732576
okay one more...I've read through your articles and some others and first let me say that this was built as simply a central mgmt function with 'Hope' of implementing the higher functions of resource pools, HA, etc. Which is exactly how I put myself in this mess. After reading the article on snapshots and having several of them contrary to what the article says it may be fact that I can't get back to the way things were. That said would it be wise to use the original DB and a new vcenter (I've noticed with each host I re-register my license count decrements from where it was originally, i.e. I had 150, at time of crash/and time of new vcenter reconnect it shows 57, so I'll run out of licenses if I proceed like this. Thus should I re-create DB, vCenter, add licenses and go from there....Ugh this is quite ugly.
LVL 121
ID: 38732984
that pdf screenshot shows a VM with snapshots.

Author Comment

ID: 38733443
okay, but you said you'd give me the exact syntax to use and you also refer to 'All' snapshots in the chain to be there. I can't assure you that all snapshots are there.

I defer to you...
LVL 121
ID: 38733520
have you removed any snapshot files, if you have deleted any snapshot files the chain will not be complete.

Author Comment

ID: 38733590
exactly. I can't thank you enough and your reference to other articles leaves me with some studying for best practices. I had this up and running for a year and it was in haste to cancel/killing  the move (thinking it was a copy) and that has been more than costly.
LVL 121

Accepted Solution

Andrew Hancock (VMware vExpert / EE MVE^2) earned 500 total points
ID: 38733817


You have only got the snapshots!

Cannot merge snapshots with parent, if parent does not exist! I'm afraid you will have to restore the VM.

there should be a lwr-ec-vcenter5.flat.vmdk and lwr-ec-vcenter5vmdk

okay, we will use the command

vmkfstools -i <most recent snapshot file name> /vmfs/volumes/<temp folder name>/<newfilename.vmdk>

which will create a new cloned virtual machine disk from existing snapshot files and parent virtual machine disk.

can you type the following at the server console if you have access or via ssh (remotely).

vmkfstools -i <most recent snapshot file name> /vmfs/volumes/<temp folder name>/<newfilename.vmdk>

I can clearly see that a snapshot file number three is missing.

vmkfstools -i lwr-ec-vcenter5-000011.vmdk  /vmfs/volumes/lwr-ec-vcenter5/vcenter5.vmdk

this command will take the last snapshot disk (11), and try to merge all the chain with the parent disk!

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When converting a physical machine to a virtual machine using VMware vCenter Converter Standalone or vCenter Converter Enterprise, if an adapter type is not selected during the initial customization the resulting virtual machine may contain an IDE d…
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

695 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