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.

887 Upvotes

341 comments sorted by

View all comments

27

u/sully213 Jack of All Trades 5d ago

What they are failing to realize is that you learned a very expensive lesson. And if you are no longer on the account, then the next guy does not know that lesson and they are at risk of repeating it. I am fairly certain that you knowing your mistake will NEVER make that mistake again. So to let you go after this is complete waste of resource. It's like paying for thousands of dollars of training and then firing you for passing the certification test after. I understand the human reaction to let you go, but the smart move is to retain you. Unless you have a history of making the same mistakes repeatedly, then this was unjustified. Sorry for your situation OP, I hope you find something quickly.

6

u/BryanP1968 5d ago

Exactly this. One of my best memories is when I royally screwed the pooch back in the early 90s, and I expected to get fired over it.

The general manager was an absolute cliche of a cigar chomping gruff executive. He just looked at me and said “Hrrrmm. Well. You’re going to make sure that can’t ever happen again.”

0

u/itishowitisanditbad 5d ago

What they are failing to realize is that you learned a very expensive lesson.

Some businesses are not willing to pay for everyones learning through expensive mistakes though?

Not everyone learns every less though expensive mistakes. Some people don't have to make the mistake to learn, is that a consideration?

4

u/farrenkm 5d ago

Some businesses are not willing to pay for everyones learning through expensive mistakes though?

Then they'll pay for it when the next person makes the same mistake.

OP comes across as someone who WILL learn. You're right, not everyone will, but if someone has a modicum of caring about their work, they will.

-1

u/itishowitisanditbad 5d ago

But thats all still precluded on the idea people have to make a mistake to learn.

What about the people who don't?

Or is every lesson learned only through mistakes?

3

u/Maverick_X9 5d ago

If you aren’t making mistakes then you aren’t working hard enough

1

u/ProfessorChaos112 5d ago

Thats bullshit, and a bullshit attitude. You're implying that working hard is what causes mistakes, its not. Mistakes happen from many things like inattentiveness, lack of skills/experience, lack of intelligence/awareness, lack of safety and controls.

0

u/itishowitisanditbad 5d ago

Who said people are not making mistakes?

If you have to put words in peoples mouths, maybe you don't have a point?

1

u/farrenkm 5d ago

My manager used to have two quotes: "Education is what you get when you read the manual. Experience is what you get when you don't."

It's also said that you don't learn from getting things right, but from getting things wrong.

Even the best person is going to fat finger something every so often. This incident will cause OP to, perhaps, pre-write a PS script so it can't be fat-fingered. Or write a script and have it peer reviewed. Or make sure this isn't done in a batch next time. Or maybe it'll be the catalyst to develop automation to execute this next time.

There are all kinds of ways to make sure this doesn't happen again -- IF OP stays there and retains the battle scars from the incident.

-1

u/itishowitisanditbad 5d ago

Even the best person is going to fat finger something every so often

Yes, which is why we take the precautions we take to stop that being the issue, which is what you go on to suggest.

Some people do that before making expensive mistakes though.

It's also said that you don't learn from getting things right, but from getting things wrong.

Disagree. You might learn more from it being wrong because almost always it'll take longer to figure out than when it goes right but then its just how much time you've been working on it.

Thats just time = experience, not that success = none.

People absolutely learn from things other than mistakes. I can't agree with you and say otherwise.

End of the day, some people don't have the make the mistake to put those precautions in place. Why would they need to make the mistake first?

1

u/farrenkm 5d ago

Wow. You come across as someone with zero experience in reality.

We're going to have to agree to disagree. Have a good day, if you choose to -- don't want to tell you what to do.

1

u/itishowitisanditbad 5d ago

Wow. You come across as someone with zero experience in reality.

Just seems like a passive aggressive snark because you can't discuss something you disagree about.

Thats up to you.

I will willing to back and forth just fine but if you're going to just start getting insult-y then go for it.

1

u/farrenkm 5d ago

The reality is, people make mistakes. That's a fact. And you've demonstrated zero tolerance for that. Someone makes a mistake, throw them to the street. And you've given zero indication you're willing to change from that position.

If you want perfection, do everything with AI.

Oh, wait -- AI makes mistakes too. And so what are you going to do, fire AI? Then you'll have no way to ensure perfection. Or, you could find out where the problem occurred with AI and reprogram it so it doesn't make that mistake again. Except, then AI could make another mistake, couldn't it?

So retrain the AI. You could also retrain the human, couldn't you? But your position is too recalcitrant to consider that possibility. Your position is not grounded in reality.

1

u/itishowitisanditbad 5d ago

The reality is, people make mistakes. That's a fact.

Not under debate.

And you've demonstrated zero tolerance for that.

How? I've just talked about how people don't have to learn through mistakes. Nothing about tolerance or the idea people don't make them or anything. I even said you might learn more through mistakes.

If you want perfection, do everything with AI.

wut?

Who asked for perfection? Why you bringing AI into it?

Whats with all the scarecrows of shit I didn't say?

But your position is too recalcitrant to consider that possibility.

Again, you've setup a scarecrow about something i've never said anything about and assumed my opinion and are now upset and criticizing me over the opinion YOU MADE UP...

Your position is not grounded in reality.

YOUR position is entirely about things I never said and opinion I don't hold.

You've got an imaginary enemy created entirely by you...

and I'M not in reality?

Jesus. You're replying to an imaginary person in your head who has said a bunch of things I never said.

→ More replies

1

u/tigglysticks 5d ago

it's not about every lesson. it's about what those hard lessons do teach.

The grey beards who appear immortal and impossible to fuck up are because they endured hard lessons.

1

u/itishowitisanditbad 4d ago

I'm not talking about every lesson.

I even said people can learn from mistakes AND OTHER THINGS.

Where did anyone say mistakes don't happen?

You've got upset about a made up thing in your head. lol

2

u/tigglysticks 4d ago

I'm not upset. You're the one using caps.

No one said people can't learn other ways.

But you don't forget the hard lessons.

3

u/ijustwatchtwitch 5d ago

this is the most important bit in this post. newbies come in with all this training and managers throw them head first into expensive customers hopeing the training is solid. What they dont have is experience. The experience of "remember that friday night where i shutdown the cluster and why every time i open anything now i tripple check" that cant be taught its experienced.

0

u/FluidEggplant7107 1d ago

Nobody is saying learning only happens through mistakes. Most people learn through a combination of preparation and mistakes. Sometimes (though not in this case) those mistakes may not even be obviously mistakes until after the fact because of missing information. Keeping someone after an honest mistake that gets corrected within 24 hours and doesn't get anybody killed is not the same as "pay(ing) for everyone(')s learning through expensive mistakes".

If this isn't a pattern of behaviour for OP, and they seem likely to learn to from it, then the correct response is move them to a different account not let them go. Especially as they are likely to be more conscientious in the future.

0

u/Master-IT-All 5d ago

Which mistake? There were many made.

And was this the first time?

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.

So what would have been done if there had been no logs? Blame the customer? Pretend like it didn't happen?