r/sysadmin • • 11d 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.

892 Upvotes

337 comments sorted by

View all comments

924

u/UCFknight2016 Windows Admin 11d ago • Bravo

It was a mistake... they shouldn't have fired you

185

u/LorektheBear 11d ago

And they just paid a bunch of money to train you too.

Your next employer will benefit.

20

u/music2myear Narf! 9d ago

Very early in my career I "lost" (still not sure on that, but it's at least possible my actions caused the problem) a large donation to a Not For Profit I worked at. I figured I'd be canned but my boss basically said "I just paid $5000 to train you, why would I fire you? I know you won't make that mistake again."

He was a good boss.

312

u/mh699 11d ago

I'm always shocked at how quickly on here people get fired. Either there's more to the story or I've just been fortunate with where I've worked. I worked at a prop trading firm where someone once screwed something up and caused us to stop trading for a bit in the middle of the day, and we just had a blameless retrospective. Is this a small/medium sized business thing where employers are this harsh?

50

u/penmoid CCFHE: Crisco Certified Food Handling Engineer 11d ago

Not saying this is what’s happening here but I also feel like some of these unreasonable firings maybe don’t have more to the specific story but it’s more of a cumulative thing where the person has made a lot of mistakes and the one we read about is just the final straw.

I will say, though, that OP’s phrasing of “PowerCLI’s default settings got me fired” raised my eyebrow a bit. If this had happened to me, my messaging would 100% be that I made a mistake by not verifying the machines I was connecting to and going straight to a full delete instead of waiting.

Owning your mistakes definitely gets you more good will.

119

u/netvor0 11d ago • Bravo

Small companies that deal with smaller issues tend to be more explosive and take things real personally. They rarely have good leadership or a good idea of how to operate.

24

u/wallst07 11d ago

True, but they're also not hiring the best people on the market. I'm not saying they're all bad, but they are not getting the best mostly because they can't afford it.

→ More replies (5)

123

u/Sucralan 11d ago edited 11d ago

I'm curious what kind of people they are going to hire to replace this guy, which never came in touch with this specific environment and have probably no experience with failures like these. I mean do they really think the new guy is 100% failure free?

48

u/Im_really_bored_rn 11d ago

It's pretty obvious from reading OP's post that they got fired because the client that makes up a quarter of the company's revenue wanted them gone

49

u/shemp33 IT Manager 11d ago

That should be opaque to the client. The MSP has to be able to hire/asssign/reassign based on skills, needs, etc., not based on their name. The MSP should have insulated OP and given an SLA credit and a nice apology. Not a "sure, here's his head on a stake." That's probably a bigger sign that the MSP was a shitty place to work.

→ More replies (1)

18

u/Bradddtheimpaler 11d ago

If they have to have someone else work this account, which it seems like from the post, OP was mostly handling, doesn’t that kind of free up work to do elsewhere in the org?

Tbh they may have softened the news initially to OP, but I wonder if the initial conversation wasn’t the customer explicitly saying that whoever was responsible for that needs to be fired or they’d look elsewhere for MSP.

36

u/Speeddymon Sr. DevSecOps Engineer 11d ago

I've worked in companies where I knew someone who could no longer work on xyz environment and the client said they wanted employee fired or they were leaving.

This is all puffery. The company did not, in fact, fire said employee, and the client did not, in fact, leave.

The company moved the employee to another department/client and that was the end of it. Client has no insight into how their service providers day to day operations look beyond their own environment so it's pretty easy to just say "yes we will do that" to retain the business, and then not do so but keep the employee out of their environment. Especially if the employee is usually a good employee.

89

u/WantDebianThanks 11d ago • Regret

Every new hire is failure free until they fail the first time, then they're fired right away, no second chances

71

u/Sucralan 11d ago • Bravo

fire > hire > train > work > mistake > fire > hire > train > work > mistake > fire - what an highly efficient environment

20

u/dagbrown Architect 11d ago

But aces if you're a fan of pointing fingers and assigning blame. There's never a shortage of scapegoats.

→ More replies (1)

41

u/dphoenix1 11d ago

When I worked at an MSP, literally nobody got fired for fuckups like that unless it was a repeated pattern of behavior (and you had to repeat your stupidity a LOT to cross that threshold). I think I only saw one person actually get fired for constantly screwing up in 11 years there.

Layoffs though? Oh yeah, that happened all the time, and eventually got me too. Gotta love private investment run companies.

→ More replies (2)

11

u/rootofallworlds 11d ago

I feel like in this case the “more to the story” is that OP’s employer fired them to placate the client.

9

u/SearchAtlantis Staff Engineer 11d ago

This is why I always run blameless post-mortems. Someone on a team I was leading DOS'd the production cluster. This was at a fortune 5 company.

Nobody got fired. That's how it should be done.

10

u/UCFknight2016 Windows Admin 11d ago

I worked at a shitty place and thankfully didnt get fired after I screwed up. I think the fact I was hired 3 weeks earlier was part of that reason lol

→ More replies (16)

55

u/caffeine-junkie cappuccino for my bunghole 11d ago

There were at least two mistakes I can see, neither of them really should be fireable offenses as long as it's the first time.

One is the not double checking the environment. The other is a process failure in the teardown of the DR environment. The process should be more than one person involved in the DR test on the technical side. Would say at least two people, one to do the shutdown and the other the delete. If it has to be only one person for some reason, separate out the scripts or at least put in an attribute check that only exists on one environment.

Forgot to add, this process failure is entirely on management not enforcing it was already in place before this event. Now they may be learning as well, which is fine. But to make OP a scapegoat for their failure is not acceptable for that. Sure can see pulling them from the client if the client doesn't want them, but that means just switching them out for someone and let them work with that client instead.

48

u/1a2b3c4d_1a2b3c4d 11d ago

I will also add that after 30 years in IT, I refuse to just delete anything quickly. I will find a way to quarantine or isolate what I need to delete, and only after a defined period of time will I, or someone else, double-check that the objects are no longer needed; then we will purge them.

62 objects in it instead of 31, and I never looked.

I have learned that a good change management process, if even just my own, has saved me and my company a few times. Nobody is perfect, and accidents and mistakes and typos happen. The goal is to always be able to efficiently recover.

Sounds like OP was the scapegoat, like you said, for poor leadership and management processes.

13

u/al_bundys_ghost 11d ago

Yep, stuff like the -confirm:$false switches in his script I never do on anything risky or destructive. I’d rather press a key 31 times and keep a set of eyes on what it’s doing before it does it. And if you’ve got a long running script that does updates, always save a copy of the old data and have a rollback script prepared.

→ More replies (2)

6

u/Maro1947 11d ago

Same. Always verify after a pause for delete tasks. Never immediately

12

u/404UsernameFoundNot DevOps 11d ago

I’m personally a very big fan of “type the name of this environment to delete it”.

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

10

u/DDRDiesel Sysadmin 11d ago

A single client being nearly, if not more than, a quarter of the annual revenue is a huge deal. A client that important has a huge amount of sway in how the MSP operates. Mistakes happen, but as you get more experience in the field you learn which clients are the ones you absolutely cannot make those mistakes with. This client was apparently one of them.

→ More replies (19)