Avatar of Mark Owens
Mark Owens
Flag for United States of America asked on

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!
Microsoft Server AppsVMwareWindows Server 2008

Avatar of undefined
Last Comment
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

8/22/2022 - Mon
Mark Owens

ASKER
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.
Mark Owens

ASKER
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.
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

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?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Mark Owens

ASKER
I'll check but can't be sure since I didn't realize I was deleting files. I'll get back with you later.
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

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.
Mark Owens

ASKER
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
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Mark Owens

ASKER
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
Mark Owens

ASKER
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.
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

that pdf screenshot shows a VM with snapshots.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Mark Owens

ASKER
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...
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

have you removed any snapshot files, if you have deleted any snapshot files the chain will not be complete.
Mark Owens

ASKER
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.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER CERTIFIED SOLUTION
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question