How to kill your Windows Server in EC2 with one click…and how to get it back

Disabling an ENI on EC2 in Windows Server (click to enlarge)
Disabling an ENI on EC2 in Windows Server (click to enlarge)

This is unlikely to be the most technical post I’ve written lately. But it might be among the most important.

Here’s a rule for you: don’t ever disable the only network adapter in a Windows Server machine running in the cloud. 

Most of you are now saying, “Well…yes” and “Duh.” Just for the record in case it isn’t immediately apparent to you what’ll happen, if you disable the sole adapter in an EC2 instance (or, really, any server running remotely), you won’t be able to connect to it. (As we say in Mass., “light dawns on Marblehead.”)

In Windows Server, as you can see from the screenshot nearby, a “helpful” shortcut that appears when you select a network adapter can easily disable it and cut you off at the knees. I accidentally did this in a sequence of rapid, anticipatory clicking. Instant click of death.

I then spent some time Googling whether or not it’s possible to customize ncpa.cpl (the Control Panel applet I was using) to remove those nasty shortcuts. Bottom line: if it can be done, I couldn’t find it. Also, I checked the local group policy object (which is a digital equivalent to finding a needle in a haystack) and didn’t see anything obvious that lets you turn off the clickable shortcuts globally.

But recovering an instance that you’ve just clicked to death is easy in AWS.

Depending on the instance type you are running, you can have up to eight (!) Elastic Network Interfaces (ENIs). All you need to do to recover an instance which has a disabled interface is temporarily add another. As you can see, it’s a simple matter of using the AWS console, as pictured below, to create an ENI and attach it to your instance. You can then RDP into the instance and re-enable the adapter you disabled. If you are using a VPC (and everyone should be by now), the AWS console will even pick an unused private address for you. When you are done, you can disable the temporary ENI in Windows (oddly circular, that), detach it from your instance and delete it from your AWS account. It’s even free!

Creating an AWS Elastic Network Interface (click to enlarge)
Creating an AWS Elastic Network Interface (click to enlarge)

Bonus learning: It’s tempting once you start using ENIs to think that if you add additional adapters you can aggregate bandwidth through them. But you can’t. AWS is way ahead of you on that. The ENI doc makes clear that

Attaching another network interface to an instance is not a method to increase or double the network bandwidth to or from the dual-homed instance.


Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *