permanent Windows session on Amazon EC2 - amazon-web-services

i'd like to have a remote PC where i could install Visual Studio & other softwares that it would be permanent
all i've tried for now is volatile so i can't reinstall everything every time i want to use the remote PC.
i've searched online but all solutions talked about EBS (Elastic Block Store)
i even went to http://aws.amazon.com/ebs/ but i can't find EBS in the AWS panel...
where can i get EBS? or is there another way to get a permanent Windows on EC2?
thanks
Jeff

When you launch an EC2 instance you get a root volume (c:) on EBS by default, it would only be transient if you are using instance storage. To check that, verify the "root device type" property of your Windows image (AMI).
Additional EBS or Instance Store volumes can be added in the "Add Storage" section of the launch wizard.
You can also create an image from the existing instance (Actions > Create Image) and then launch it as many times as you'd like.
Additionally, for persistent desktop sessions, check Amazon Workspaces.

Related

Google Cloud snapshot's boot issue

Hope all are safe and doing well.
I have few running servers on google cloud and for them, snapshots are scheduled on daily basis in an incremental way.
I am trying to create a new instance on a different VPC zone by using the same snapshots but it will be giving me an error.
For reference, I have added an attachment to this question.
Please help me to resolve this issue and thanks in advance.
Assuming that you have created a Snapshot with Application consistency(VSS) enabled:
When you create a VSS snapshot, Windows Server marks the volume in the
snapshot as read-only. Any disks that you create from the VSS
snapshot are also in read-only mode. So, the read-only flag on the new
boot disk prevents the VM instance from booting correctly.
You can follow this documentation to resolve your issue here.
If the disk you created from the VSS snapshot is a boot disk and you want to use it to boot a VM instance, you must temporarily attach the disk to a separate, existing VM instance. Once you complete the following steps, you can detach the disk from that existing VM instance and use it to boot a new VM instance.

What exactly is an AMI in AWS?

I'm bit confused about what purpose does the AMI serve.
Is AMI something which provides a platform with particular OS and other configurations to access the instance?
An Amazon Machine Image (AMI) is basically a copy of the disk that will be attached to a newly-launched instance. It is normally just the boot disk, but an AMI can actually contain multiple disk images.
The AMI is 'copied' to the disk of the newly launched instance. (Not quite accurate, but you can think of it that way.) Changes to the local disk do not impact the AMI.
AWS provides a number of AMIs with pre-loaded operating systems such as Windows, Amazon Linux and Ubuntu. Some of them contain additional software, such as Windows with SQL Server.
There are also community AMIs that are created by somebody other than AMI, but shared to all users. For example, a company might load a demo version of their software onto the AMI, so customers can simply launch an Amazon EC2 instance and it will have all software already loaded and configured.
An AMI is actually just a Snapshot, plus additional metadata. However, a Snapshot can only be restored to an Amazon EBS volume, whereas an AMI can be used to launch an instance. The Amazon EC2 service will then load the disk and attach it to the new instance.
It is pretty much what it's name implies - a machine image. There is, for example, a variety of Linux images. You can use an image to create a Linux instance. The AMI is not "used up" during the use - it can be used any number of times. There are also images that have an operating system such a Linux and software - for example a database server or a closed source server or pretty much anything you can imagine.
Think of the AMI as something you would use as the source for a copy machine. On the source paper there may be a little or a lot. The copier creates a new page that has whatever was on the source page. And you can make any number of copies.
Access to the instance varies on the AMI. A Linux one usually opens an ssh port while a Windows one usually uses some sort of remote desktop. The AWS console can guide you a bit but usually you'll need some documentation to know how to use the instance created from the AMI to know how to use it.

Advice for AWS storage setup (php/mysql with autoscaling)

I have a php/mysql website that I want to deploy on AWS. Ultimately, I'm going to want auto-scaling (but don't need it right away).
I'm looking at an EBS based AMI. I see that by default the "Root Device Volume" is deleted when an instance "terminates". I realize I can also attach other EBS devices/drives to an instance (that will persist after termination) but I'm going to save most user content in S3 so I dont think that's necessary. I'm not sure how often I'll start/stop vs when i would ever want to terminate. So that's a bit confusing.
I'm mostly confused with where changes to the system get saved. Say I run a YUM install or update. Does that get saved in the "root device volume"? If i stop/start the instance, the changes should be there? What about if I setup cron jobs?
How about if I upload files? I understand to an extent that it depends where I put the files and if I attached a second EBS. Say I just put them in the root folder "/" (unadvised, but for simplicity sake). I guess that they are technically saved in the "root device volume"? If I start/stop the instance, they should still be there?
However, if I terminate an instance, then those changes/uploads are lost. But if I set the "root device volume" to not delete on termination, then I can launch a new instance with the changes there?
In terms of auto-scaling. Someone said to leave the "root device volume" to default delete so that when new instances are spun up/shut down, they don't leave behind zombie EBS volumes that are no longer needed (and would require manual clean-up)?
Would something like this work: ?
Setup S3 bucket (for shared image uploads)
Setup Amazon RDS / mysql
Setup DynamoDB (for sharing php sessions)
Launch EBS-backed AMI (leave as default to delete "root device volume" on
termination). Make system updates using yum/etc. Upload via sftp
PHP/HTML/JS/CSS files (ex: /var/www/html). Validate site can save
images to S3, share sessions via DynamoDB, access mysql via RDS.
Make/clone your own AMI image from your currently running/configured
one. Save it with a name that indicates site version/date/etc.
Setup auto-scaling to launch the image created in #5
I'm mostly concerned with how to save my configuration so that 1) changes are saved in-case i ever need to terminate an instance (before using autoscale) and 2) that auto-scaling will have access to the changes when I'm ready for it. I also don't want something like the same cron-job running on all auto-scaling instances.
I guess I'm confused with "does creating my own AMI image in #4" basically replace the "saving EBS root device volume" on termination? I can't wrap my head around the image part of things vs the storage part of things.
I get even more confused when I read about people talking about if you use "Amazon Linux" then the way they deploy updates every 6 months makes it difficult to use because you are forced to use new versions of software. How does that affect my custom AMI (with my uploaded code)? Can I just keep running yum updates on my custom AMI (for security patches) and ignore any changes to amazon's standard AMIs? When does the yum approach put me at risk for being out-of-date?
I know there are a host of things I'm not covering (dns/static IPs/scaling metrics/etc). That instead of uploading files then creating an AMI image, some people have their machine set to pull files from git on startup (i dont mind my more manual approach for now). Or that i could technically put the php/html/css/js on S3 too.
Sorry for all of the random questions. I know my question might not even be totally clear, but I'm just looking for confirmation/advice in-general. There are so many concepts to tie-together.
Thanks and sorry for the long post!
Yes, if you install packages, upload files, set up cron jobs, etc. and then stop the EBS-based instance, everything will still be there when you restart it.
Consequently, if you create an AMI from that instance and then use it for your autoscaling group, all the instances of the autoscaling group will run the cron jobs.
Your steps look good. As you are creating an AMI, your changes will be saved in that AMI. If the instance is terminated, it can be recreated via the AMI. The modifications made on that instance since the AMI creation will not be saved though. You need to create an AMI or take a snapshot of the EBS volume if you want a backup.
If you make a change and want to apply it to all the instances in the autoscaling group, you need to create a new AMI and apply it to your autoscaling group.
Concerning the cron jobs, I guess you have 2 options:
Have 1 instance that is not part of the autoscaling group running them (and disable the cron jobs before creating the AMI for the autoscaling group)
Do something smart so only one instance of the autoscaling group runs them. Here is the first page I hit on Google: https://gist.github.com/kixorz/5209217 (not tested)
Yes, creating your own AMI image basically replaces the "saving EBS root device volume" on termination.
An EBS boot AMI is an EBS snapshot of the EBS root volume plus some
metadata like the architecture, kernel, AMI name, description, block
device mappings, and more.
(From: AWS Difference between a snapshot and AMI)
Yes, you can automatically run yum security updates. To be completely identical to the latest Amazon Linux AMI, you should run all yum updates (not only security). But I wouldn't run those automatically.
Let me know if I forgot to answer some of your questions or if some points are still unclear.

What data will be lost if aws t1.micro instance is rebooted?

I currently have a t1.micro (free) instance running in aws, with Windows 2008 R2. I was taking a trial, getting a grasp of how to work with amazon aws service with this instance.
Now, I want to migrate it to a higher config instance say m1.large.
While I was trying to create AMI of the instance, it said that the instance is going to be rebooted, What data will I loose if the instance is rebooted ? Will the applications installed (MySql, Crystal Reports and some other apps) be deleted ?
How to migrate it without loosing any data.
Thanks
If you have a standard t1.micro with a 8 GB root volume, nothing should be lost. You would only loose data if you use Instance Storage, but you are probably not using it, unless you added it yourself.
If you really don't want to take any risk, you can select the "No Reboot" option when creating an AMI. Then try launching a new, larger instance from that AMI (while leaving the other instance running) and see for yourself.

How can i check that EC2 AMI image is stored on EBS not ephemeral stoarge

I have just launched the micro instance with Centos AMI image. I have heard that if i stop the instance then my chnages will be lost. So i have read that if i use EBS then chnages will be saved.
But Its not clear to me how to do that. I want that if i stop or restart the machine then my chnages are still there.
DO i need to chnage my hard drive to EBS. How can i do that
My Root Device is comming as EBS with 10GB EBS volume. Is that ok
Yes, the micro instances always use EBS root, so you don't have to do anything special.
If you 'stop' your instance, and later start, it's moving your hard drive to another computer and rebooting.
If you terminate your instance, your EBS drive will be fine as long as "delete EBS drive on termination" is not set on your drive.
When you use other instances, you'll have to verify the AMI type. Not all AMIs are available in all combinations:
EBS vs ephemeral
64 bit vs 32bit
PVM vs HVM (Everything is PVM except the really high-end Compute Cluster)
When you first get started in the cloud, EBS is a big deal. But as you get to be a cloud expert, you'll prefer non-EBS instances. EBS will only be used on a few servers, like your database or your syslog server. Most of your app should be stateless. Your app servers should only store their data in the database, and only write their logs to a central logging server, and only get their code from github or a package repository. So so there is no need to 'backup' your app server boxes, since they can be re-created at any time from external sources using something like Puppet or Chef.
Only your 'stateful' boxes like databases need backing up, and EBS helps there.