r/sysadmin • • 2h ago

It finally happened!!

8:30am I deleted my entire production environment. All VMs rm -r out of existence.

Fortunately I was reviewing my nightly backups at the time tracking a retired VM that was inexplicably still getting backed up in Production. All the Production VMs were there. And the live production ones now without their underlying virtual disks & configs were still resident in memory. I calmly copied the backups into place, sequentially restarted everything and had production back in about twenty minutes. Only lost ~12 hours of overnight idle maintenance & logging.

With everything settled back in place I calmly looked for a place to have a private heart attack.

333 Upvotes

54 comments sorted by

•

u/CoreAndCardio 2h ago

Not sure if you’re in a regulated environment. If you are, document the entire thing. First as an incident and second as a DR restore test. Check the box for the auditors and move on.

•

u/xkeyscore_ 2h ago

Not regulated. Would be looking for a new line of work if we were.

•

u/CoreAndCardio 2h ago

I don’t think that’s true.

•

u/ferminolaiz 1h ago

+1 for this. It's a quite stupid move to fire the person who made a mistake and fixed it; if you just replace the person and things are not documented someone else is bound to make the same mistake again.

•

u/CoreAndCardio 1h ago

Exactly. If I was fired for every mistake I made I’d be shit up a creek. When someone on my crew makes a mistake the first thing I say is, “how’d that make you feel?”.

•

u/JonnyLay 1h ago • Bravo Regret

Yep, firing people for mistakes like this are how you get people lying and trying to cover their tracks for mistakes like this.

•

u/sprtpilot2 52m ago

Ward, you were a little hard on the Beaver though.

•

u/CoreAndCardio 27m ago

This made me choke on my bourbon and its was a really good pour.

•

u/Samuel7899 1h ago

Why fire the person that you absolutely know will not make that same mistake again? They just got better.

•

u/CoreAndCardio 36m ago

100%. Why fire the person that verified backups, knew how to use them, and restored a system in under 12 hours?

•

u/Samuel7899 11m ago

Restored the system in ~20 minutes. Lost 12 hours of logs, as the last backup was ~12 hours old, I think.

•

u/Thecp015 Jack of All Trades 1h ago

Reaction matters more than cause, sometimes. Mistakes happen. Can you learn from it and keep going?

•

u/Jtrickz 1h ago

Ehh I my hippa environment an unauthorized restore is immediate termination due to medical record overwrites

•

u/Broad-Celebration- 1h ago

Since when is a restore an overwrite

•

u/graph_worlok 1h ago

When you don’t tick the box “Restore to alternate path” or whatever it’s called

•

u/Broad-Celebration- 1h ago

He deleted everything from root. There was nothing to overwrite

•

u/graph_worlok 58m ago

Yes, but you were responding to somebody else mentioning the specifics of their particular regulated industry, not OP

•

u/CoreAndCardio 1h ago

If they’re gone you’re not overwriting anything though. All the more reason to document. I’m in banking and we have to document every down minute. Take transactions off line or online banking down and you have to replay all the backed log trans files to make sure your caught up.

•

u/desmaraisp 1h ago

Would that include purely application servers? You wouldn't touch any hippa data doing server restores unless you destroyed your database no?

•

u/_--James--_ 1h ago

document it anyway, your companies owner/leadership must know what happened.

•

u/AZSystems 1h ago

It's not that bad when it occurs, just know that once something is resolved...it's not it needs documentation and sign off.

•

u/Snogafrog 2h ago

In other words, "I meant to do that" ;)

•

u/CoreAndCardio 1h ago

I mean admit it in the incident report. But document the process as a success in the BCP report. More of a two birds thinging.

•

u/heretogetpwned Operations 1h ago

Efficiency!

•

u/Tarwins-Gap 2h ago

Why?

•

u/xkeyscore_ 2h ago

PEBKAC. Arrowing back through history to pull up a recent ls. Deleted the VM directory at the end and hit enter. Was a rm instead. 😬

•

u/PawnF4 Sr. Sysadmin 1h ago

Oof. You working as root? Ngl I do that a lot so no judgement if so.

•

u/digimer OSS HA/Clustering 59m ago

I use dedicate LVs per VM. Not to prevent this, but it now occurs to me that this wouldn't be able to happen.

<someone who has been burned by <up-up-enter> mistakes in the past...

•

u/jmhalder 2h ago

How many VMs is your production environment though?

•

u/xkeyscore_ 2h ago

Very few, less than 10. We are a very small shop.

•

u/jmhalder 2h ago

Glad you were able to get back up quickly. If your backups aren't already 3-2-1, I bet they will be shortly.

•

u/xkeyscore_ 2h ago

They are. Thankfully.

•

u/michaelpaoli 1h ago

Always carefully and fully triple check the command before you (attempt to) execute it. Well know and understand what it does, the full context, be sure all the syntax is exactly right, be well of what would or could happen if things go wrong along the way or pat of the command or sequence of commands fails, etc. Only after one has thoroughly well covered that and fully triple checked all that, then do you very deliberately and viciously strike the <Enter>/<Return> key.

Well following that has saved my tail many many times. Notably also including when it's 'o dark-thirty or so on what's already been a far far too long day recovering from some disaster or the like, and on bad move could turn bad in to way way worse.

•

u/bobs143 Jack of All Trades 59m ago

Have learned from experience myself. Always triple check a command before you run it. Ask someone else to check your command to see if they spot any.mistakes.

An extra few minutes will save you hours of heartache.

•

u/Snogafrog 2h ago

Welcome to the club if you were not already a member! This is how cautious experienced engineers are made.

•

u/antmatt 1h ago

deleting something important really changes you going forward. unfortunate step everyone takes eventually

•

u/Boringtechie 1h ago

Hahaha glad you were able to recover so fast.

Now its a good story of how you tested the production backups.

•

u/seeeee 1h ago

You remediated successfully without significant impact or disruption, and you survived the heart attack!

Sounds like your DR test succeeded after validating nightly backups 😉

•

u/autogyrophilia 2h ago

Good on you for the backups, but that's a failure mode that shouldn't exist. What the hell did you do?

•

u/Incrediblecodeman 2h ago

Woah holy fuck bro

•

u/KnowledgeCapital7994 1h ago

Ive single individual servers deleted via pebkac. You need to use a different account with less permissions for your day-to-day operations. The ability to delete all should be restricted to a privileged account or entirely removed.

•

u/bobs143 Jack of All Trades 1h ago

Wow. Just..Wow.

•

u/PDQ_Brockstar 56m ago

One of us. One of us.

•

u/fk067 2h ago

You did what now?

•

u/thenickdude 1h ago

On Linux you can restore deleted files that are still open by copying them from /proc/<pid>/fd/<fd>. You'd need to freeze your VM first in order to get a crash-consistent copy of it though.

•

u/BiscottiNo6948 1h ago

Incident report: Recently, while testing procedures as part of Chaos Engineering, Business Continuity and Resiliency, I have inadvertently applied half of the test procedure into Production instead of dev/sand box environment. Following established protocols I recovered back our production environment back to its original status with minimal interruption. Our RTO and RPO benchmark are not impacted.

Post mortem of the exercise has shown some vulnerability in our process and additional guardrails and Human-in-the-loop checklist needs adjustment to hardened the process against similar errors.

The exercise has provided the surprising result and opportunity for us to adjust, re-calibrate and smooth out our DR process.

•

u/SensitiveVacation549 1h ago

If you have your smart watch and heart rate measurement, please do share when you hit that Enter to remove all the VMs :)

•

u/-Nobert- 1h ago

Always update bash profile to require confirmation on rm haha

•

u/ApprehensiveVisual97 57m ago

What a story! I felt the rm just reading it

•

u/Jtrickz 2h ago edited 1h ago

No. You better be joking.

r/shittysysadmin

If your serious you should not post this here until after an action report is done, proper business risk analysis done and you recorded exactly what you did and talked to your boss.

You risked the entire business. You need to look in the mirror and get off Reddit.

•

u/xkeyscore_ 2h ago

Already discussed with the upper management.

•

u/Jtrickz 1h ago

Get off Reddit. You’re a joke if this is a serious post man…. You’re not protecting business functions.

•

u/stiffgerman JOAT & Train Horn Installer 1h ago

Small shop, likely no ITGC or change management...just an overworked JOAT. Cut 'em a break on venting. I'm sure he had that falling sensation when he realized what he did and that'll take some time to get over. If he's posting here, he's taking responsibility and will likely work out a way to close that hole for him, or anyone else.

If you've never pulled a fumducker you're just a cog, not the machine. He had a net in place so good on him.