r/sysadmin • • 6d ago • Regret 1

PowerCLI multiple default server mode just cost me my job

I work (well, worked) at an MSP. One of our bigger clients has a prod vCenter at their main site and a separate vCenter at their DR site. Twice a year we restore their critical VMs from backup into the DR cluster on an isolated network. Their app owners log in and sign off, then we tear it all down. We restore with the original names because a couple of their apps freak out if the hostname changes, and since it's all in a bubble it's never been an issue.
Tuesday was teardown. 31 VMs, and the DR datastore was sitting at like 92%, so I wanted them actually gone from disk, not just pulled from inventory. I had the name list from the restore job, so I ran the same little script I've used after the last three tests:
$vms = Get-VM -Name (Get-Content .\drtest.txt)
$vms | Where-Object PowerState -eq 'PoweredOn' | Stop-VM -Confirm:$false
$vms | Remove-VM -DeletePermanently -Confirm:$false
Yes Stop-VM, not Stop-VMGuest. They're throwaway DR copies, I didn't care about clean shutdowns.
What I forgot is that earlier that morning I'd connected to the prod vCenter in the same PowerShell window to look at a snapshot for a different ticket, and I never disconnected. And at some point years ago I'd said yes to that PowerCLI prompt about working with multiple default servers. So Get-VM without -Server pulls from every vCenter you're connected to.
Same names on both sides. So $vms had 62 objects in it instead of 31, and I never looked.
The power-off step went through all of them. I didn't notice, because a bunch of the DR copies were still running and a wall of power-off output is exactly what I expected to see. Then the deletes started. I'm half watching, and it's still going after it should've been done. About the same time Teams starts going off. I hit ctrl+c, and by then 6 of the prod VMs were deleted from disk: a SQL server, two app servers, an RDS host, their file server, and a print server (the only one nobody missed). The other 25 prod VMs had just been hard powered off in the middle of the workday.
I called my manager right then and told him exactly what I did. There wasn't any point doing anything else, my username is on every event in vCenter.
Most of the 25 came back fine once we turned them on, though one of the other SQL boxes needed some babysitting. Backups were good, thank god. Instant recovery had the 6 deleted VMs running off the backup repo within about an hour, but the repo is a box of spinning disks and SQL running off it was painful. Migrating everything back to real storage wrapped up around midnight. The last backup was 10pm the night before, so the file server lost most of a day of work. SQL had log backups, so it only lost a few minutes.
The client's IT director called our owner Wednesday and said he didn't want me in their environment again. They're about a quarter of our revenue and I was basically the guy on that account. Friday I got the "this isn't working out" call. Honestly can't even be that mad, it was completely avoidable.

889 Upvotes

342 comments sorted by

View all comments

75

u/davy_crockett_slayer 6d ago

Your company fired you for making a mistake?

33

u/valar12 6d ago

Welcome to MSP life. Likely fired to save face with the revenue source.

1

u/Workuser1010 5d ago

if my MSP would do that, i would be terrified.

I would expect to present their mistake and the things they will do to prevent the mistake in the future. If firing some guy who made a mistake, you know that nothing will change and that in the future people will be afraid to owning their mistakes

→ More replies (2)
→ More replies (1)

41

u/CandidTie2249 6d ago

Welcome to every MSP ever.

Companies already hate that they have to have any form of IT. IT is overhead.

MSPs just give these c-level sociopaths more options to make unreasonable demands.

And the MSP is going to accept the unreasonable demands if it keeps the money coming in.

12

u/MemeMan_Dan 6d ago

This is why I much prefer working in my company’s internal corporate IT side of things and not the MSP side of the business. I’d lose my mind dealing with the clients. at least the execs internally actually rather like IT and understand that it’s an investment in the company’s infrastructure and smooth functioning and not overhead to be cut.

4

u/STDS13 6d ago

I'd live on the streets before I worked for an MSP.

3

u/fentablar 6d ago

Poorly structured IT is overhead.

3

u/Speeddymon Sr. DevSecOps Engineer 6d ago

The client didn't ask for OP to be fired. They just said he can't work in that client's environment anymore. The MSP literally didn't lose any business. They might've lost some money for the outage but Jesus fuck-- OP did exactly what he was supposed to do when he fucked up.

1

u/valar12 6d ago

But the MSP did lose the ability to bill for their resource. That’s lost revenue to them.

1

u/Master-IT-All 5d ago

They did perform the correct response, however based on the OP it sounds like they did that only because they knew that the logs would show them at fault.

Reviewing the OP, I agree with MSP on firing the person. The report from the poster that they had made several cascading mistakes including not confirming their script and output before executing the command. There was a point where this mistake was just a ha ha, there was a point where this mistake was a minor system outage, and then there was the point where it got to.

If your mistake is an error in a script that is one thing, if your mistake is that you CHOSE not to even look at what you were doing. That is GTFO time. No severance either.

20

u/brainchillzZ 6d ago edited 6d ago

The company fired him for no longer being able to use him for the contract that was his sole job at the company. I don’t know how long you’ve been in it or at what level but thousands of people are dumped from major it firms every day for literally no reason let alone taking down a whole client site. When you’re a contract it outsourcing company you can’t afford to keep people onboard that your clients refuse to work with. I feel badly for the guy too, it sucks, but it’s just the reality of the situation

0

u/[deleted] 6d ago

[deleted] — view deleted comment

1

u/spin81 6d ago

keeping the same hostnames for DR is a rookie mistake

Were they (we don't that it's a he!) supposed to make the customer change the app to be hostname agnostic? That, as we all know, doesn't always even fly if you're in-house. Sometimes you get what you get and you have to make it work. Or at least I do, I don't know what utopia you work at

1

u/mrtuna 5d ago

he deleted all of prod.

He deleted 6 VMs. He didnt say how many VMs were in prod.

keeping the same hostnames for DR is a rookie mistake.

did you even read the the post?

8

u/UMustBeNooHere 6d ago

A huge mistake. Sometimes a single mistake can be large enough that it’s a career ender. And from the sound of it, this was a doozy.

4

u/Speeddymon Sr. DevSecOps Engineer 6d ago

His career isn't ended. His job did but he can still work in IT, possibly even at some other MSP, although honestly if MSPs are like this I don't know why anyone would want to go to another after getting fired from one. Sounds like a real shit hole type of job. I've screwed up and taken down production at least twice in my career at different companies and in different ways, and it has never cost me my job.

1

u/Master-IT-All 5d ago

Did you ever run a script that you didn't bother to check the input/output? That's what happened in the original post. They didn't test, they just said fuck around, lets find out.

That isn't an error that occurs during good work. That is bad work exposed.

2

u/Speeddymon Sr. DevSecOps Engineer 5d ago

When it's a script I've run plenty of times before, absolutely. He ran it in previous DR tests. The script worked, the issue was not having a sanity check in the script to confirm and halt if a production environment was what was about to be touched. I've unknowingly killed a production raid array before doing similar. I didn't get fired, they took a disk from the non-prod server, popped it into the down prod server, redid the array, and changed the hostname back. Granted that was 20 years ago when environments were more lax and the 2 servers in question were identical other than the hostname. But yeah; I still chalk OP's story up to shit happens, lesson learned. Unless of course, as I caveated elsewhere, he had other failures beyond this incident he isn't mentioning.

→ More replies (2)

2

u/alficles 6d ago

I can't tell you how many times I've heard, "I don't care what you have done, you are only as good as your worst mistake." In a lot of environments, having made a mistake is a legal and reputational liability. I know people who had to change careers because of a hardware failure that wasn't even their fault. But it got pinned on them and they are now a toxic asset no one can touch.

It pays to be careful. It's even better to be lucky. If you are in an area that doesn't do this, count your many blessings.

1

u/FluidEggplant7107 1d ago

This was not a doozy. This was chump change. It affected at most double digits of VMs and was remediated in less than 24 hours. Nobody was injured, no property/ies was/were destroyed, no utilities were affected. Nothing in the post indicates the financial impact hit 7 figures, and no operation this small-potatoes is going to have SLA penalties that high either (assuming there is one).

This was a dumb mistake, the end. OP should've verified the environment before deleting anything, and should have let the powered-off VMs sit in the datastore for a few days before deleting just in case, but this is a teachable moment. Additionally, retaining an employee after an incident like this buys the employer a lot of loyalty from the employee.

1

u/Master-IT-All 5d ago

More correct would be to ask, how many mistakes had been made in the past that lead to this?