Changing Root EBS volume from Volume created from EBS Snapshot - amazon-web-services

I created snapshot, from volume(Root volume).
After one day, I need to set my snapshot as root volume.
I followed these steps :
For that I created a volume from snapshot.
My working instance was stopped.
Detached root volume of my instance
Attached the volume generated from snapshot as /dev/sda1
and then instance started
I have a problem while starting my instance, it was not starting and no errors occurred.
Can you guys please check the process and let me know if anything else required

Related

EBS Snapshot; Restarting EC2 Instance before Snapshot complete

It is my understanding that when you create an EBS Snapshot, any data written to the volume up to the time that the snapshot was started, will be included. I.e, even if the snapshot is in the "pending" state, it is still safe to write to the EBS volume.
Is this still considered the case for taking EBS snapshots of root volumes? In the documentation, it is stated that when you create a snapshot for Amazon EBS volumes that serve as root devices, you should stop the instance before taking the snapshot.
Does this imply that we can stop the instance, begin the snapshot, and then restart the instance before the snapshot has completed? The reason I'm asking is because our snapshots are taking >15 minutes, which is timing out our Snapshot Management Lambda before it can restart the instance.
It should be safe, see https://serverfault.com/questions/548731/can-i-re-attach-my-ebs-while-a-snapshot-is-pending
You should stop the instance when creating a root volume snapshot because you can not unmount root volume beforehand, hence you would risk your snapshot would be corrupted.

How to decrease the AWS Windows EBS root volume?

I need to reduce my Windows EBS root volume.
We are able to increase the root volume by using AWS Console. So I have followed some document to decrease my Windows EBS root volume:
I created a new 30GB volume and attached it to my existing instance
I then used xcopy to copy the data from C:\ to D:\ which is newly attached volume
After completion of copying data, I then stopped the instance and detached both the EBS root volume and the newly added volume.
Then I reattached the newly created volume to the stopped EC2 instance as /dev/sda1
Now I am trying to start my Windows EC2 instance, but it fails to start. It is coming again and again to stopped state.
Note: I received error message like Sharing Violation after data copied.

Root Device and Block Devices difference

Can someone help me to understand the difference between Root device and Block devices for EC2 instance. You can see a snapshot i posted below.
What i tried to achieve is :
I created a snapshot of the attached volume of the EC2.
Detached the volume from instance.
Deleted the volume.
Created a new volume from the snapshot.
Reattached the newly created volume to the instance.
But it only attaches to the Block Devices but not to the root devices. And results in the failure to launch the instance.
My apologies if my question is wrong.
Awaiting your reply.
Thanks in advance.
The Root device is the EBS volume for the AMI in which your instance is based on. This will contain the operating system. If not configured then, AWS will use the default values of the AMI.
You can configure additional Block device entries optionally to mount additional volumes on the instance, besides the root volume. It can be empty or from a snapshot.

EC2 Instance starts and stops after attaching volume

I accidentally deleted the root volume and am trying to launch my instance. Upon creating a new volume I got an error saying: "Instance does not have a volume attached at root (/dev/sda1).
I attached a newly created volume to the instance with the volume id of /dev/sda1 and the instance successfully starts, is pending, and then stops, all with no system logs.
Any help is much appreciated.

EC2 Instance doesn't start after Reattaching the Volume

I'm trying to lunch an instance from backup snapshots.
I follow the procedure here :
Goto the snapshot section of the aws tools.
Create a volume from the snapshot.
Create an ec2 instance (make sure it's an EBS backed instance, if it's the same kind as the original snapshot you'll be fine)
Stop the instance
Detach the existing EBS volume from the instance
Attach the volume you just created, make sure you give it the same name as the instance that was attached.
Start the instance back up.
Not quite sure what is EBS backed instance.
Every thing works fine,But after I reattach the volume,The instance I created cant get start,when i press start,it pending for awhile then stopped again.
What maybe the problem?
Thanks in advance.
I also have done this before. It works. When you reattach the volume check the name, it should be identical to the original root volume name. If the root volume name is different it can't start.
This worked for me.
Basically the "Device" attachment information that is auto-populated wasn't right.
When I tried starting the EC2 instance the error read.
The error ,clearly states that volume isn't attached at(/dev/xvda)
Now, navigate back to volumes. Undo the previous attached volume.
Attach the volume again by providing the "Device" info as provided in the error message, /dev/xvda in this case.
Before detaching the volume, note down the volume id and device name which is actually mounted right now.
Then while reattaching another volume, you need to make above device name only otherwise it will not start.