Can't delete EC2 instance or ECS volume - amazon-ec2

I'm trying to remove an EC2 instance that was added by mistake while trying to figure out how to deploy my API code.
Every time I terminate it, another one appears.
I now have a list of terminated instances, and 1 too many running instances.
I also have an extra EBS instance which I need to remove but can't because the Delete option is disabled.
When I read the docs it says this should work, there is no mention of the delete option not being available.
I can detach the volume, but then another one appears.
This question is similar to another one. That one suggests the problem may be caused by a cluster, but I don't have any. I followed the instructions just in case but none are listed.

There is likely an autoscaling group that is recreating it. Open the EC2 console and click Auto Scaling Groups in the left-side menu. Delete the ASG and any remaining instances should automatically be terminated.

Related

EC2 creates new instance when I terminate previous

I can't seem to find the configuration setting but when I terminate a free tier instance a new one is created a few minutes later. I want to terminate it permanently and not have it restart. I created the instance using the eclipse tools originally if this makes any difference. I have tried stop and terminate and both will create a new instance and leave my other instances in the "terminated" or "stopped" state. Is there a setting that I can configure to leave it turned off?
I figured it out it is the application is configured in elasticbeanstalk. I had to delete the application in ebs and it terminated the application.

Installed Zone Alarm on Amazon EC2 Windows Instance and cannot access now. How do I fix this?

I messed up this.
Installed ZoneMinder and now I cannot connect to my VPS via Remote Desktop, it must probably have blocked connections. Didnt know it will start blocking right away and let me configure it before.
How can I solve this?
Note: My answer is under the assumption this is a Windows instance due to the use of 'Remote Desktop', even though ZoneMinder is primarily Linux-based.
Short answer is you probably can't and will likely be forced to terminate the instance.
But at the very least you can take a snapshot of the hard drive (EBS volume) attached to the machine, so you don't lose any data or configuration settings.
Without network connectivity your server can't be accessed at all, and unless you've installed other services on the machine that are still accessible (e.g. ssh, telnet) that could be used to reverse the firewall settings, you can't make any changes.
I would attempt the following in this order (although they're longshots):
Restart your instance using the AWS Console (maybe the firewall won't be enabled by default on reboot and you'll be able to connect).
If this doesn't work (which it shouldn't), you're going to need to stop your crippled instance, detach the volume, spin up another ec2 instance running Windows, and attach the old volume to the new instance.
Here's the procedure with screenshots of the exact steps, except your specific steps to disable the new firewall will be different.
After this is done, you need to find instructions on manually uninstalling your new firewall -
Take a snapshot of the EBS volume attached to it to preserve your data (essentially the C:), this appears on the EC2 console page under the 'volumes' menu item. This way you don't lose any data at least.
Start another Windows EC2 instance, and attach the EBS volume from the old one to this one. RDP into the new instance and attempt to manually uninstall the firewall.
At a minimum at this point you should be able to recover your files and service settings very easily into the new instance, which is the approach I would expect you to have more success with.

AWS seems to start another EC2 instance with same AMI automatically after termination

I have 6 ec2 instances and I want to terminate about 3 of them. I've tried terminating them from the command line using ec2-terminate-instances and also using the AWS mananagement console ( Right click on instance and click on terminate).
The instance stops and goes into terminated state. However after some time another instance is automatically started with the same image of the terminated instance. I can't figure out why this is happening.
When I tried to stop instances and then terminate them separately it seemed to workw fine

nothing happens on libcloud create_node

I use libcloud to create a new node instance Amazon EC2.
conn.create_node returns me a valid instance and printing node.dict shows the expected values.
however when I check my EC2 dashboard the new machine does not appear there.
do I need my python app to stay open so that the node is actually created?
found it: the instance was actually created but for some reason the amazon did not show it even after refresh. logging out and in solved it.

AWS console not showing all instances during volume attach

I do the following using AWS web console:
Attach EBS volume-A to instance-A. Make some changes to data on volume-A and detach it
Launch new instance-B (in the same zone as instance-A)
Try attach volume-A to the new instance-B. But the new instance does not appear in the instances list during attach volume process (dialog box).
If I try the same attach using command line EC2 API (volume-A and instance-B), it works fine!
Do you know if this is a bug in AWS web console or am I doing something wrong in the console? Tried page refresh in Step #3 but it still would not list the new instance.
In order to attach, both volumes has to be in the same zone. So if you are going to attach a volume into a instance check the zone of the instance's attached volume. If those are not matching create a new instance with the same zone as the zone of the volume that you need to attached.
The volume and the instance have to be in the same region AND the same zone.
If you have a volume in us-east-1a and the instance in us-east-1b, you would need to move the volume to us-east-1b to make it work.
Even I had faced this problem yesterday and a day before. It looks like Amazon problem with their cache. Not sure WHY.
To bring back the stuff as is, I had to sign-out and make sure things are good. But it's always good to work with CLI, works better.
Although the user interface may not list the instance ID, you can attempt to add the volume anyway. If it's genuinely impossible (rather than a cache issue) you will get an error message.
Paste in the instance ID (i-xxxxxxx) manually then type your mount point (e.g. /dev/sdf) and click Attach.
For the benefit of others: some instance types do not support encrypted volumes, which may be why the instance doesn't appear in the list. I get the following error:
Error attaching volume: 'vol-12341234' is encrypted and 't2.medium' does not support encrypted volumes.

Resources