• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 595
  • Last Modified:

restore snapshot of vcenter...oops vcenter is gone

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
jumper14k
Asked:
jumper14k
  • 8
  • 5
1 Solution
 
jumper14kAuthor Commented:
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
 
jumper14kAuthor Commented:
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
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
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!

 
jumper14kAuthor Commented:
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
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
 
jumper14kAuthor Commented:
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
 
jumper14kAuthor Commented:
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
 
jumper14kAuthor Commented:
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
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
that pdf screenshot shows a VM with snapshots.
0
 
jumper14kAuthor Commented:
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
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
have you removed any snapshot files, if you have deleted any snapshot files the chain will not be complete.
0
 
jumper14kAuthor Commented:
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
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 8
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now