Solved

restore snapshot of vcenter...oops vcenter is gone

Posted on 2012-12-29
13
578 Views
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!
0
Comment
Question by:jumper14k
  • 8
  • 5
13 Comments
 

Author Comment

by:jumper14k
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.
0
 

Author Comment

by:jumper14k
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.
0
 
LVL 117
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?
0
 

Author Comment

by:jumper14k
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.
0
 
LVL 117
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.
0
 

Author Comment

by:jumper14k
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.

Thanks
datastore-snapshot.pdf
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:jumper14k
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
0
 

Author Comment

by:jumper14k
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.
0
 
LVL 117
ID: 38732984
that pdf screenshot shows a VM with snapshots.
0
 

Author Comment

by:jumper14k
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...
0
 
LVL 117
ID: 38733520
have you removed any snapshot files, if you have deleted any snapshot files the chain will not be complete.
0
 

Author Comment

by:jumper14k
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.
0
 
LVL 117

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE) earned 500 total points
ID: 38733817
EDIT
: IMPORTANT

There is NO PARENT DISK!

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!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This is an issue that we can get adding / removing permissions in the vCSA 6.0. We can also have issues searching for users / groups in the AD (using your identify sources). This is how one of the ways to handle this issues and fix it.
HOW TO: Connect to the VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere (HTML5 Web) Host Client 6.5, and perform a simple configuration task of adding a new VMFS 6 datastore.
Advanced tutorial on how to run the esxtop command to capture a batch file in csv format in order to export the file and use it for performance analysis. He demonstrates how to download the file using a vSphere web client (or vSphere client) and exp…
This video shows you how to use a vSphere client to connect to your ESX host as the root user. Demonstrates the basic connection of bypassing certification set up. Demonstrates how to access the traditional view to begin managing your virtual mac…

708 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

12 Experts available now in Live!

Get 1:1 Help Now