Move Amazon AMI to another account [closed] - amazon-web-services

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have some machines created with my account. Some of them uses S3 storage, some EBS.
Now I need to move these machines to my company account to let it pay for.
As I know I can start each machine as my company user and create an image.
I wonder if there is a way to simple copy these machines?

You can copy an EBS boot AMI from one EC2 account to another using the technique I wrote about here:
Copying EBS Boot AMIs Between EC2 Regions
http://alestic.com/2010/10/ec2-ami-copy
The commands I list are for copying an EBS boot AMI from one region to another, but if you simply use the right commands with different accounts instead of different regions, you can accomplish your goal. Note that you'll have to upload your personal ssh key to both accounts following these instructions:
Uploading Personal ssh Keys to Amazon EC2
http://alestic.com/2010/10/ec2-ssh-keys
Copying S3 based AMIs from one account to another is a bit convoluted and involves commands like:
ec2-download-bundle
ec2-unbundle
(switch accounts)
ec2-bundle-vol
ec2-upload-bundle
ec2-register
Alternatively, you hopefully documented the exact steps you took to create the original AMIs. Simply follow these instructions to create the AMIs in the new account.

You can also share the AMIs with your other account. Then launch instances on the new account and create AMIs that will then be associated with the new account.

Related

Unable to delete Amazon EBS snapshot [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I am unable to delete an Amazon EBS snapshot because the console says that:
The snapshot snap-xyz is currently in use by ami-1234
I made the snapshot with the intention of moving the server between accounts, which I have done, but now do not wish to keep the snapshot (incurring charges in this account).
The documentation I can find indicates that to remove the snapshot the server must be no longer required.
Is there a way to separate the two, keep the server and delete the snapshot?
If you are done with moving the server across accounts, then it means that you no longer need the AMI also. You need to deregister the AMI and then you can delete the snapshot. Details are mentioned here.
Before you attempt to delete an EBS snapshot, make sure that the AMI
isn’t currently in use. AMIs can be used with a variety of AWS
services, such as Amazon Elastic Compute Cloud (Amazon EC2), AWS Auto
Scaling, AWS CloudFormation, and more. If you delete an AMI that’s
used by another service or application, the function of that service
or application might be affected.
If you no longer need the EBS snapshot or its associated AMI,
deregister the AMI. Then, delete the EBS snapshot in the Amazon EC2
console.

Why do people use AWS over Docker Containers? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
AWS provides services like Elasticache, redis, databases and all are charged on hourly basis. But these services are also available in form of docker containers in docker hub. All the AWS services liste above use an instance. Meaning, an independent instance for databases and all. But what if one starts using an ec2 instance, and start downloading all the images for all the dependancies on databases. That would save them a lot of money right?
I have used docker before and it has almost all the images for the services aws provides.
EC2 is not free. You can run, for example, MySQL on an EC2 instance. It will be cheaper than using RDS, but you still need to pay for the compute and storage resources it consumes. Even if you run a database on a larger shared EC2 instance you need to account for its storage and CPU cycles, and you might need more or larger instances to run more tasks there.
(As of right now, in the us-east-1 region, a MySQL db.m5.large instance is US$0.171 per hour or US$895 per year paid up front, plus US$0.115 per GB of capacity per month; the same m5.large EC2 instance is US$0.096 per hour or US$501 per year, and storage is US$0.10 per GB per month. [Assuming 1-year, all-up-front, non-convertible reserved instances.])
There are good reasons to run databases not-in-Docker. Particularly in a microservice environment, application Docker containers are stateless, replicated, update their images routinely, can be freely deleted, and can be moved across hosts (by deleting and recreating them somewhere else). (In Kubernetes/EKS, look at how a Deployment object works.) None of these are true of databases, which are all about keeping state, cannot be deleted, cannot be moved (the data has to come with), and must be backed up.
RDS has some useful features. You can change the size of your database instance with some downtime, but no data loss. AWS will keep managed snapshots for you, and it's straightforward (if slow) to create a new database from a snapshot of your existing database. Patch updates to the database are automatically applied for you. You can pay Amazon for these features, in effect, or pay your own DBA to do the same tasks for a database running on an EC2 instance.
None of this is to say you have to use RDS, you do in fact save on AWS by running the same software on EC2, and it may or may not be in Docker. RDS is a reasonable choice in an otherwise all-Docker world though. The same basic tradeoffs apply to other services like Elasticache (for Redis).

When I train neural network using EC2 instance, where I need to store train dataset? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I have over 100 GB image datasets.
Should they generally be stored in "storage of EC2 instance" or "S3 storage"?
When I store train dataset in EC2 instance, will dataset stay in that instance as long as I don't terminate the instance (I should "stop" instance to preserve uploaded dataset in EC2 instance)?
When I should store dataset in S3, then I need to mount S3?
Thanks.
have you considered using Amazon SageMaker? Store your data in S3, train and deploy on fully-managed infrastructure. A lot of customers find that it's quite easier than managing your own EC2 instances :)
https://aws.amazon.com/sagemaker/
I'd love to hear your feedback and answer any questions.
S3 is the cheapest option for data storage that you have on AWS so I would suggest you to store the training data there.
You can't really store data in an EC2 instance, you can store them in the underlying volume storage. That can be either EBS volumes or Instance-store volumes.
If you are using EBS volumes, then you can configure how they will behave once you terminate the instance, so you can specify whether to delete them or not, which means that even if you terminate the EC2 instance, you can still keep the volumes if you choose so.
This is not possible in case of Instance-store volumes. Those are automatically deleted when you terminate the EC2 instance and if you are running instance-stored backed EC2 instance (EC2 instance with instance-instance store root volume), then you can't stop it, and if any failure happens, then all the data on ephemeral instance-store volumes are lost.
If you care only about the result of the operation, then you can upload the result to S3 and terminate instance.
Yes, you can mount S3 bucket to your EC2 instance or you can just send the data using S3 API.
So my suggestion is, store the data in S3. When you are ready to process it, spin up EC2 instance, pull data from S3 (if your S3 and EC2 instance are sitting in the same region, this data transfer is for free). Process the data and store the result back to S3. Terminate the instance (or stop it if you need the same setup for the next task, or create an AMI of it).
Another thing to consider here is the type of volumes that you choose (SSD vs. HDD). It may be more reasonable to go with throughput-optimized volumes than general SSD (and of course the type of the instance but that you need to measure how your selected instance is performing and whether to scale it up a bit or change the type).
I think you can use EBS volume as well and then mount it then if the instance stops your volume will need to be mounted again. S3 File system will give you the same functionality. I would not store 100 GB of data in S3 and use S3 SDK as the GET requests on many small files can get very expensive.

What are the problems when switch region on the Amazon web server? [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 days ago.
Improve this question
Currently, I have a Amazon hosting at EU but I want to switch to Singapore. What are the problems when switching the region on Amazon web server?
It sounds like your situation is:
You are currently running an Amazon EC2 instance in either the Frankfurt or Ireland regions
You wish to use a different region
There's two answers to this question, and it depends on whether you want to "move" an instance to another region, or just "use" another region.
Using another region
If you wish to launch an Amazon EC2 instance in a different region, simply select the desired region from the pull-down list in the AWS Management Console, then launch a new instance. Easy!
Moving an EC2 instance to another region
It is not possible to "move" an instance, but you can copy the disk to another region and then launch a new instance using that disk image.
The steps are:
Select your existing instance, and choose Actions/Image/Create Image
Click AMIs in the console to view the AMI
Select Actions/Copy and select a destination region
Once the AMI has been copied, switch the console to the destination region
Select the AMI that was copied, then choose Actions/Launch to launch a new instance from this disk image

clone/transfer EC2 instance (AMI) between AWS accounts [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I am trying to clone/transfer an EC2 instance from one AWS account to another by creating an AMI on the first account and sharing it with the second account. Then I can use that AMI to start another EC2 instance (w/ the same data/setup/EBS volumes/etc.) on the second account.
I am having trouble locating the AMI image on the second account. I tried creating another AMI and listing it publicly, still can't find it from the second account.
How would I transfer or clone an EBS-based EC2 instance from one AWS account to another?
I think you can only share the image. The files are encrypted with your private account key, so you can't just move the files.
You could try migrating an AMI to the same region to see if it creates a new one: (but I doubt it)
http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ApiReference-cmd-MigrateImage.html
The big picture: You should NOT be manually creating AMIs. Use something like Chef, Puppet or Ansible to build your servers. This new breed of tools is declarative, so it's much easier than building with raw shell scripts. And it would make "rebuild under a different account" trivial.
I like to say:
Level 1: check your source code into version control
Level 2: check your server build script into version control
Level 3: check your "launch/manage my infrastructure" script into version control
Not sure its still actual... But you have to add destination's account number to the AMI permissions and than, if you check "Shared with me" checkbox, you should be able to create instance from that shared AMI image.
This might be bit late but you can achieve this by,
Give launch permissions for Account A for Account B's AMIs
Create you EC2 Client by using Account A credentials
Now, call DescribeImages method by filtering with ExecutableUsers parameter with self
This way you will be able to find the AMI images shared with your account by Account B. Keep in mind the AMI-Id will be different from Account B's AMI Id. Check the other Tag names to ensure the correctness of the image.
The process to clone/transfer/move an EC2 to another account includes:
Create a new AMI (Amazon Machine Image) from the source EC2 instance using the CLI command create-image in the source region.
Optional: Copy the AMI image to the target region using the copy-image CLI command. This process will take a while so check that copy was completed before you share the new AMI image or the process will fail. Depending on how close regions are and the size of an EC2 instance can take from 10 minutes to hours.
Share the AMI image with the AWS target account. AMIs are a regional resource, so to make an AMI image available in a different region, copy the AMI to the region and then share it. To share the AMI image, we need to use the modify-image-attribute CLI command.
Launch a new EC2 instance from the shared AMI image, using the run-instances CLI command.
The whole process is a little more complicated and involves up to 16 steps if you want to clone security groups, tag the instances and delete temporary AMIs.
I wrote a blog explaining all these steps in detail at https://medium.com/#gmusumeci/how-to-move-an-ec2-instance-to-another-aws-account-e5a8f04cef21
Guillermo
Create an AMI of the ec2 instance
Share the AMI with the accountid
In the 2nd aws account
-create instance, choose AMI (shared with me) you should be able to see the
shared AMI
-Launch instance