0% found this document useful (0 votes)
22 views5 pages

EC2 Question and Answers

The document outlines various AWS instance types, including General Purpose, Compute Optimized, and Memory-Optimized, along with their pricing. It explains different purchase models such as On-Demand, Reserved, Dedicated, and Spot, and details the differences between them. Additionally, it covers topics like EBS volume management, encryption, and recovery methods for lost EC2 key pairs.

Uploaded by

lafawa3307
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views5 pages

EC2 Question and Answers

The document outlines various AWS instance types, including General Purpose, Compute Optimized, and Memory-Optimized, along with their pricing. It explains different purchase models such as On-Demand, Reserved, Dedicated, and Spot, and details the differences between them. Additionally, it covers topics like EBS volume management, encryption, and recovery methods for lost EC2 key pairs.

Uploaded by

lafawa3307
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1. what are different types of instance in AWS?

General Purpose Instances T3 large 0.0896 USD per hour

Compute Optimized Instances C5.xlarge 0.17 USD per hour

Memory-Optimized Instances R6a.4xlarge 128 /gb 0.572 USD per hour

Accelerated Computing Instances G4dn xlarge 16gb 0.579 USD per hour 4vCPU

Storage Optimized Instances H1 i3 xlarge 30.5 gb 0.354 USD per hour 4 vCPU

2. waht are the puraches model and saving plans in AWS?

On-Demand, Reserved Host, Dedicate and Spot

3. difference between on demond, reserved, dedicate and spot

OnDemand – Allows you to pay a fixed rate by hour (or by the second) with no commitment

Reserved – Provide you with a capacity reservation and offer a significant discount on the hourly charge

for an instance 1 Year to 3 Year terms.

Spot – Enable you to bid whatever price you want for instance capacity, providing for even greater

savings if your applications have flexible start and end times

Dedicated Hosts – Physical EC2 server is dedicated for your use. Dedicated Hosts can help you reduce

costs by allowing you to use your existing server-bound software licenses.

4. what is 2/2 check

Instance check and system check

5. is it possible to login if 2/2 check fails and how ?

(failed system status checks , incorrect networking or startup configuration, exhaused memory,
corrupted file system, incompatible kernel - reason for 2/2 check fail)

General error mounting filesystems (failed mount)


Stop the instance.

Detach the root volume.

Attach the root volume to a known working instance.

Run filesystem check (fsck –a /dev/...).

Fix any errors.

Detach the volume from the known working instance.


Attach the volume to the stopped instance.

Start the instance.

select the instance and go to action - monitor and troubleshoot - get system log

6. difference between AMI and Snapshot?

Snapshot is a point in time backup of specific volume while AMI is is backup of the entire EC2 instance
that might have multiple attached volumes, exactly like virtual machines.

7. how you will mount EBS volums permanently in your lenux machine?

create a volume and attach to an instance

login to the machine using putty

lsblk - to check the volumes in the machine

file -s /dev/xvdf -- to make sure is there any file system (data: no file system)

mkfs -t ext4 /dev/xvdf or mkfs -t xfs /dev/xvdf to create a file system

mkdir /newvolume creating a new directory in the name fo newvolume

umount /dev/xvdf/newvolume=====umount /(file system) /directory name

cat /etc/fstab

vi /etc/fstab

(patision address)/dev/xvdf /newvolume(directory) / file system(ext4) default 0 0

8. is it possible to migreat a volume from one account to anther? is yes how? if not why?

Log in to AWS console on the target account

Click on the top right corner Support > Support Center

Copy the AWS Account ID and paste it into your favorite notepad, we will need it later.

create snapshot from root volume of ec2 instance.and then select the snapshot choose action and click
modify permission.

choose private,and then give to AWS account number for which account need to copy the volume.After
that checking target aws account console ,go snapshot in filter private one, it will be shown.

9. how you will encript your volum?

Open the Amazon EC2 console .


From the navigation bar, select the Region.

From the navigation pane, select EC2 Dashboard.

In the upper-right corner of the page, choose Account Attributes, EBS encryption.

Choose Manage.

For Default encryption key, choose a symmetric customer managed encryption key.

Choose Update EBS encryption.

10. can you encript existing server(EBS) volume?

- Create a Snapshot from the unencryped volume

- create an encryped volume from the Snapshot

- detach unencryed volume from the EC2 instance and attach the encryped volume

11. if you lost your Ec2 key pair how you will recover your EC2 Machine?

Method 1: Enter user-data

1. Create a new key pair.

2. If you create the private key in the Amazon EC2 console, then retrieve the public key for the key pair.

3. Open the Amazon EC2 console.

4. Stop your instance.

5. Choose Actions, Instance settings, Edit user data.

6. Copy the following script into the Edit user data dialog box:

Content-Type: multipart/mixed; boundary="//"

MIME-Version: 1.0

--//

Content-Type: text/cloud-config; charset="us-ascii"

MIME-Version: 1.0

Content-Transfer-Encoding: 7bit

Content-Disposition: attachment; filename="cloud-config.txt"

#cloud-config

cloud_final_modules:
- [users-groups, once]

users:

- name: username

ssh-authorized-keys:

- PublicKeypair

Replace username with your user name, such as ec2-user. You can enter the default user name, or enter
a custom user name, if one was previously set up for the instance. For a list of default user names, see
General prerequisites for connecting to your instance.

Replace PublicKeypair with the public key retrieved in step 2. Be sure to enter the entire public key,
starting with ssh-rsa.

7. Choose Save.

8. Start your instance.

9. After the cloud-init phase is complete, validate that the public key was replaced.

Important: Because the script contains a key pair, remove the script from the User Data field.

10. Stop your instance.

11. Choose Actions, Instance Settings, Edit user data.

12. Delete all the text in the Edit user data dialog box, and then choose Save.

13. Start your instance.

Method 2

Detach volume from the Ec2 instance

Attach and mount the Volume to a New Ec2 instance

copy the Authorized keys from the new Ec2 instance to the mounted(old) volume

unmount from the New Ec2 instance and attach and mount to the old Ec2 instance

12.how you will make run httpd at the background?

Systemctl httpd

13.how you will automate AMI and Snapshot?

Lifecycle Manager - selectt policy type - target resources (volume) - policy status to be Enabled

configure schedule 1 ProdHourlyDLM


Cross-Region copy(enable) Select Target Region - Enalbe encryption for Snapshot copies

KMS key description : Default master key that protects my EBS volumes when no other keys is defined

Creating an Amazon EBS-backed AMI policy for Amazon EC2 instances

choose EBS-backed AMI policy under Create new lifecycle policy

Automating sharing and cross-account copy through Amazon DLM

14. how you will migrate a volume from one zone to another?

EBS consists of five volume types: -

o SSD, General Purpose - GP2 (Up to 10,000 IOPS)

o SSD, Provisioned IOPS -IO1 (More than 10,000 IOPS)

o HDD, Throughput Optimized - ST1 - Frequently accessed workloads

o HDD, Cold - SC1 - Less frequently accessed data

o HDD, Magnetic - Standard - cheap, infrequently accessed storag

You might also like