Why my tmux session dies after ec2stop? - amazon-ec2

I have an EBS-backed EC2 instance. According to docs, it should be 'paused' if I stop (ec2stop) it. However, I noticed that server is indeed restarted after I start the instance back. Uptime counts from 0 after start, and tmux session is detached.
For comparison, everything above mentioned is really paused when I 'savestate' VirtualBox machine, so I can attach to existing tmux session after starting VBox machine back.
Could you please explain what is the difference? What really happens when I stop the EC2 instance?
Thanks,
Robusta

I entered your question into Google.
The first hits contained the answer to your question:
AWS FAQ
RightScale FAQ
Amazon says:
[...]The instance performs a normal shutdown and stops running (the
status goes to stopping and then stopped).[...]

Related

DC/OS (mesos/marathon) how set time to start killed instance of aplication

I have install DC/OS (3master and 7slave server - all Centos7)
I saw problem - when one of slave server shut down - mesos/marathon start killed instance of application after 5 minutes.
For example - I run in mesos/marathon 8 instance simple web application. When I shut down or deactivate network interface of one slave server marathon show that some instancje are killed. From this moment mesos/marathon wait 5 minutes and start killed instance to another online slave server.
My question is - how can I change this time? 5 minutes is to long. I read documentation of DC/OS but I can't find variable responsible for this.
I will be very thankful for your help.
You can have a at the Marathon command-line flags. Based on your description, I guess the default for either task_launch_timeout or scale_apps_interval could be responsible for this.
I'm unsure though if this can be configured on the fly, or during installation in DC/OS. I saw that there's a quite recent enhancement request to Make Marathon flags passable via environment variables.

GCE Highmem Instance Slow

I am connecting to a CentOS booted from a persistent disk created from here. The instance is a n1-standard instance but I'm having some serious performance issues.
I can SSH into the instance just fine, however commands take a long time to run. I tried to just run a simple ping command to google.com and it took 2 minutes and 36 seconds to start the command. The CPU usage is next to none as there isn't really anything going on within the instance except an Apache installation that isn't doing anything yet. My internet connection is just fine, and other instances work just fine. I've even deleted the instance and started over from scratch.
Is there something wrong with the image CentOS is being created from or is this just a problem I'm having? What steps can I take to narrow down the problems?

Creating AMI takes so long

I'm creating an AMI for a server with 100G files. It's been like an hour and it's still not finished. (The AMI still says pending) Is there something wrong with it? What should I do?
Just to let other people know, this process could take very, very long. My 100 GB AMI takes like 2.5 hours to create and the progress bar jumps from 0 to 100 directly after that. So don't worry.
This answer pertains to a retirement situation where there is potentially a hardware failure for an instance with a EBS root volume. In this situation, AWS recommends creating an AMI of the instance to be retired, and starting a new instance from this AMI. In my situation, the instance was not responding before starting the AMI creation process.
The AMI creation step failed to complete after >8 hours.
I next tried stopping the instance. This also failed to complete in >10 minutes, so I tried force stopping the instance (by issuing the stop command again). The force stop did complete after a few minutes. After the instance was stopped, the AMI creation succeeded in <10 minutes.
This AWS forum message seemed relevant to my case:
https://forums.aws.amazon.com/thread.jspa?messageID=372982&#372982
It fully depends on the disk size that is attached to the es2 instance.
But one can check the progress of the AMI backup job by checking the EBS snapshot, as it will also take a snapshot of the attached EBS. Once taking a snapshot is completed, it will show Available(100%), before that it will show Unavailable(X%). Once it's become Available(100%), AMI backup will complete.
Here are some image of the snapshot progress.
Snapshot progress

If i Stop an Amazon EC2 instance, is this saved?

If I stop an EC2 instance, rather than terminate, will this image be saved in my account and be available to be used at a later stage? ..as I noticed terminated instances eventually dissappear, would a stopped instance be available to boot up and start when ever?
Also regarding charging, I assume the cost for having a stopped instance would be charged per GB similar to a custom AMI?
Also another possibly simple question, if I shutdown a machine over SSH or via a script, does this initiate a termination or just a stop an instance (I assume it terminates the instance).
Thanks
If you terminate the EBS backed instance, it will remove it from the list of running instance, including it's allocated EBS volume. Unless you set the instance attribute not to delete the volume.
If you only stop, it will changed to stopped status and you can start it again later.
If you shutdown a machine, it default's to stop.
A good read to protect your instance see: http://alestic.com/2010/01/ec2-instance-locking
If you stop an instance based on EBS, then the instance will terminate automatically but you'll be charged for EBS storage until you delete the EBS.

Why is my Amazon EC2 instance "pending"?

I've been evaluating several cloud compute providers, Amazon EC2 among them. I started an instance with a Windows image, and ever since then it's been "pending", for more than 30 minutes now.
Is this a typical amount of wait for an instance to start? This would be highly undesirable for my purpose. Perhaps I started it incorrectly? I couldn't find any info on what "pending" means on Amazon - does anyone here know?
Pending means the instance is being created, if it has been like that for 30 minutes something went wrong, typicaly I wait for 3 minutes.
I would just create another instance and when the pending one is over, terminate it.
you would probably waste 12.5 cents tho...
I recently faced the same issue. After reaching out to AWS support, they provided a workaround which worked well.
You can use the AWS CLI to stop the instance, instead of AWS console. Although an instance stack in Pending state cannot be managed through AWS console, using the AWS CLI allows you to stop it and start it again. The following command should allow you to stop the instance and force it move to the "Stopped" state:
aws ec2 stop-instances --instance-ids <You instance Id>
You can find more information about how to install and use AWS CLI here:
https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html

Resources