I have created an instance m2.2xlarge which works fine.
I am trying to add this instance to a volume. Volume created fine and see in list of volumes.
The status of this volume shows up as "available".
In the "Action" - Attach volume and then select instance from drop down list- this above instance does not show up. I have another micro instance which shows up fine in the drop down list.
Why is the m2 large instance not showing up in the drop down list (for available instances)?
Is this the way to add a volume to a new instance?
Related
I'd like to specify the snapshot id which would be used to create a root device image for a EC2 instance created with cloudformation. How do I do that?
I could only find a way to make volume from a snapshot, but no way to use it in the instance.
If you want to use an EBS snapshot as the basis of the root disk (EBS volume) for an instance, you need to first register the snapshot as an AMI (e.g., using ec2-register).
Make sure to specify the correct architecture and kernel (AKI) when you register the snapshot as an AMI.
Alternatively, instead of taking a snapshot and registering it as separate steps, you could use the ec2-create-image command/API/console function to perform the snapshot and registration in a single step. This also takes care of picking the right architecture, kernel, and other parameters.
Once you have an AMI, you can tell CloudFormation to use that AMI when running a new instance.
I concur. This has nothing to do with cloudformation, but I just did this following a crippling 'do-release-upgrade'. It's just a matter of creating an image from the snapshot, and in my case making sure to change the virtualization type to "hardware assisted virtualization" (HVM). Then you can just launch the resulting image (AMI).
I changed the AWS key for SSH access to an EC2 instance by creating a new key from the console and then added the public key value to authorized_key file, which worked as expected.
However, in the AWS console it is still showing the old key name as key for that instance. Will it be problem in long run in any case? How can I change the old key name to the newly created key name?
You cannot change the initial key name of an Amazon EC2 instance as shown in the AWS Management Console.
However, as you've already explored, it is not a problem to add another key for every day usage and won't be a problem in the long run either; in fact, you could also delete the former key pair via the AWS Management Console with zero impact on your already created instances, please see Eric Hammond's answer to consequences of deleted key pair on ec2 instance for more details on the subject matter.
1) I had an instance and sudo commands were not working do to some mistakes on this instance
so i had to create a new instance.
2) I want to use old EBS volume with new instance and to stop old instance.
3) I created a new instance (New EBS Volume is created automatically with new instance)
4) I created snapshot of old volume and attached with new instance.
5) So two EBS volumes are attached with new instance.
6) When i login using SSH into new instance, i don't see old data anywhere.
7) I want every old data on new instance.
my question is.....
how i can use old volume with new instance?
please help me.. i am trying it from last 10 hours continuously :(..
What you need to do is mount the old volume on the new instance. Go to the Amazon EC2 control panel, and click "Volumes" (under Elastic Block Store). Look at the attachment information for the old EBS volume. This will be something like <instance id> (<instance name>):/dev/sdg
Make a note of the path given here, so that'd be /dev/sdg in the example above. Then use SSH and connect to your new instance, and type mkdir /mnt/oldvolume and then mount /dev/sdg /mnt/oldvolume (or whatever the path given in the control panel was). Your files should now be available under /mnt/oldvolume. If this does not solve your problem, please post again with the output of your df command after doing all of this.
So, to recap, to use an EBS volume on an instance, you need to attach it to that instance using the control panel (or API tools), and then mount it on the instance itself.
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.
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.