Friday, July 3, 2020

Q48 & 49

  1. Question 48. What Is A Placement Group In Ec2 ?

    Answer :

    AWS provides an option of creating a Placement Group in EC2 to logically group the instances within as single Availability Zone.

    We get the benefits of low network latency and high network throughput by using a Placement Group.

    Placement Group is a free option as of now. When we stop an instance, it will run in same Placement Group in restart at a later point of time.

    The biggest limitation of Placement Group is that we cannot add Instances from multiple availability zones to one Placement Group.

  2. Question 49. What Types Of Issues Do You Face While Connecting To An Ec2 Instance ?

    Answer :

    Some of the possible connection issues with EC2 instance are:

    • Connection time out
    • Permission denied due to host key not found
    • Unprotected private key file
    • Permission denied due to user key not recognized by server
    • No supported authentication method available
    • Server refused the key AWS Video Training

Q47

Question 47. What Are The Main Features Of Application Load Balancer (alb) In Amazon Ec2 ?

Answer :

Main features of Application Load Balancer (ALB) are as follows:

  • Content-Based Routing: In ALB, we can make use of content in the request to decide the routing of a request to a specific service.
  • HTTP/2: ALB supports the new version of HTTP protocol. In this protocol, we can send multiple requests on same connection. It also supports TLS and header compression.
  • WebSockets: ALB supports WebSockets in EC2. With WebSockets, a server can exchange real-time messages with the end-users.
  • Layer-7 Load Balancing: ALB can also load balance HTTP/HTTPS application with layer-7 specific features.
  • Delete Protection: ALB also provides Delete Protection option by which we can prevent it from getting deleted by mistake.
  • Containerized Application Support: We can use ALB to load balance multiple containers across multiple ports on same EC2 instance.

Q46

Question 46. What Are The Main Features Of Classic Load Balancer In Ec2 ?

Answer :

Some of the main features of Classic Load Balancer (CLB) in Amazon EC2 are as follows:

Health Check: Based on the result of Health Check, Classic Load Balancer can decide to route the traffic. If any instance has unhealthy results, CLB will not route the traffic to that instance.

Security: We can create security groups for CLB in Virtual Private Cloud (VPC). With these features, it is easy to implement secure load balancing within a network.

High Availability: With CLB, we can distribute traffic among EC2 instances in single or multiple Availability Zones. This helps in providing very high scale of availability for the incoming traffic.

Sticky Sessions: CLB also supports sticky session by using cookies. The sticky sessions make sure that the traffic from a user is always routed to the same instance so that user gets seamless experience.

IPv6: CLB also support Internet Protocol version 6.

Operational Monitoring: We can also perform operational monitoring CLB and collect statistics on request count, latency etc. These metrics can be monitored in CloudWatch.

Q45

Question 45. What Is The Difference Between A Spot Instance And A Demand Instance On Ec2 ?

Answer :

“On-Demand” instances allow the user to use the compute by hour without requiring long term commitment. There are no guarantees that the user will always be able to launch specific instance types in an availability zone, though AWS tries it’s best to meet the needs. This service is preferable for POCs and they do not suffer an interruption of the service(by AWS) like Spot instances.

“Spot” instances are a bid_for_low_price version of On-Demand instances, but could be shut down by AWS anytime the Spot instance price goes higher than bid price. Spot price fluctuates based on the supply and demand of the capacity. It’s essentially the leftover capacity of AWS to be used. There is no difference in the performance compared to On-Demand instances and is usually cheaper than On-demand instances as there is no guarantee provided over the availability. The user can choose a start time and end time for the instances or can make a persistent request(no end time specified) for this service. This service is preferable for computing needs which are not tied to any deadlines, computing needs are large and the interruption of service is acceptable.

Q43 & 44

  1. Question 43. What Is The Underlying Hypervisor For Ec2 ?

    Answer :

    Xen

  2. Question 44. What Are Spot Instances In Amazon Ec2 ?

    Answer :

    In Amazon EC2, we can even bid for getting a computing instance. Any instance procured by bidding is a Spot Instance. Multiple users bid for an EC2 Instance. Once the bid price exceeds the Spot price, the user with the highest bid gets it. As long as their bid price remains higher than the Spot price, they can keep using it.

    Spot price varies with the supply and demand. Once Spot price exceeds Bid price, the instance will be taken back from the user.

Q42

Question 42. How You Will Change The Root Ebs Device Of My Amazon Ec2 Instance ?

Answer :

  • Stop the instance.
  • Detach the root EBS volume.
  • Attach the alternate EBS volume (as the root e.g. /dev/sda1)
  • Start the instance.
  • This presupposes that your alternate EBS volume is bootable, of course – it has to contain the bootable OS image.

Q41

Question 41. Explain What Happens When I Reboot An Ec2 Instance ?

Answer :

Rebooting an instance is like rebooting a PC. The hard disk isn’t affected. You don’t return to the image’s original state, but the contents of the hard disks are those before the reboot.

Rebooting isn’t associated with billing. Billing starts when you instantiate an image and stops when you terminate it. Rebooting in between hasn’t any effect.

Q40

Question 40. If You Want To Launch Amazon Elastic Compute Cloud (ec2) Instances And Assign Each Instance A Predetermined Private Ip Address You Should ?

Answer :

The best way of connecting to your cloud resources (for ex- ec2 instances) from your own data center (for eg- private cloud) is a VPC. Once you connect your datacenter to the VPC in which your instances are present, each instance is assigned a private IP address which can be accessed from your datacenter. Hence, you can access your public cloud resources, as if they were on your own network.

Q39

Question 39. Can S3 Be Used With Ec2 Instances, If Yes, How ?

Answer :

Yes, it can be used for instances with root devices backed by local instance storage. By using Amazon S3, developers have access to the same highly scalable, reliable, fast, inexpensive data storage infrastructure that Amazon uses to run its own global network of web sites. In order to execute systems in the Amazon EC2 environment, developers use the tools provided to load their Amazon Machine Images (AMIs) into Amazon S3 and to move them between Amazon S3 and Amazon EC2.

Another use case could be for websites hosted on EC2 to load their static content from S3.

Q38

Question 38. Is It Possible To Change The Private Ip Addresses Of An Ec2 While It Is Running/stopped In A Vpc ?

Answer :

The primary private IP address cannot be changed. Secondary private addresses can be unassigned, assigned or moved between interfaces or instances at any point.

Q37

Question 37. How Is A Spot Instance Different From An On-demand Instance Or Reserved Instance ?

Answer :

First of all, let’s understand that Spot Instance, On-Demand instance and Reserved Instances are all models for pricing. Moving along, spot instances provide the ability for customers to purchase compute capacity with no upfront commitment, at hourly rates usually lower than the On-Demand rate in each region. Spot instances are just like bidding, the bidding price is called Spot Price.

The Spot Price fluctuates based on supply and demand for instances, but customers will never pay more than the maximum price they have specified. If the Spot Price moves higher than a customer’s maximum price, the customer’s EC2 instance will be shut down automatically.

But the reverse is not true, if the Spot prices come down again, your EC2 instance will not be launched automatically, one has to do that manually. In Spot and On demand instance, there is no commitment for the duration from the user side, however in reserved instances one has to stick to the time period that he has chosen.

Q36

Question 36. How Is Stopping And Terminating An Instance Different From Each Other ?

Answer :

Starting, stopping and terminating are the three states in an EC2 instance, let’s discuss them in detail:

  • Stopping and Starting an instance: When an instance is stopped, the instance performs a normal shutdown and then transitions to a stopped state. All of its Amazon EBS volumes remain attached, and you can start the instance again at a later time. You are not charged for additional instance hours while the instance is in a stopped state.
  • Terminating an instance: When an instance is terminated, the instance performs a normal shutdown, then the attached Amazon EBS volumes are deleted unless the volume’s deleteOnTermination attribute is set to false. The instance itself is also deleted, and you can’t start the instance again at a later time.

Q35

Question 35. What Is Public Key Credentials And How To Install It ?

Answer :

Amazon EC2 uses public–key cryptography to encrypt and decrypt login information. Public–key cryptography uses a public key to encrypt a piece of data, such as a password, then the recipient uses the private key to decrypt the data. The public and private keys are known as a key pair.

After configuring the AMI to prevent logging in using a password, you must make sure users can log in using another mechanism.

Q34

Question 34. How To Disable Password-based Logins For Root In Amazon Ec2 Instance ?

Answer :

Using a fixed root password for a public AMI is a security risk that can quickly become known. Even relying on users to change the password after the first login opens a small window of opportunity for potential abuse.

Following are the steps to disable password-based remote logins for the root user:

Open the /etc/ssh/sshd_config file with a text editor and locate the following line:
#PermitRootLogin yes
Change the line to:
PermitRootLogin without-password
The location of this configuration file might differ for your distribution.

Q33

Question 33. How To Update Ami Tools At Boot Time ?

Answer :

AWS recommends that your AMIs download and upgrade the Amazon

EC2 AMI creation tools during startup. This ensures that new AMIs based on your shared AMIs have the latest AMI tools.

For Amazon Linux, add the following to /etc/rc.local:

# Update the Amazon EC2 AMI tools

echo ” + Updating EC2 AMI tools”

yum update -y aws-amitools-ec2

echo ” + Updated EC2 AMI tools”

Q32

Question 32. What Is Shared Ami ?

Answer :

A shared AMI is an AMI that a developer created and made available for other developers to use.

One of the easiest ways to get started with Amazon EC2 is to use a shared AMI that has the components you need and then add custom content. You can also create your own AMIs and share them with others.

  • Use a shared AMI at your own risk. Amazon can’t vouch for the integrity or security of AMIs shared by other Amazon EC2 users. AWS recommends that you get an AMI from a trusted source.

Q31

Question 31. How You’re Charged In Amazon Ec2? Explain In Detail ?

Answer :

  • Charges varies upon AMIs backed and storage volums.
  • AMIs backed by instance storage charged for: AMI storage + Instance usage
  • AMIs backed by Amazon EBS storage charged for: Volume storage + Usage in addition to the AMI + instance usage
  • When an Amazon EBS-backed instance is stopped, you are not charged for instance usage, but you are still charged for volume storage.
  • AWS charges a full instance hour for every transition from a stopped state to a running state, even if we transition the instance multiple times within a single hour.

For example: if hourly instance charge for your instance is $0.10 and if you were to run that instance for one hour without stopping it, you would be charged $0.10. If you stopped and restarted that instance twice during that hour, then you would be charged $0.30 for that hour of usage (the initial $0.10, plus 2 x $0.10 for each restart).

Q30

Answer :
All AMIs are categorized as either backed by Amazon EBS or backed by instance store.
Backed by Amazon EBS – means that the root device for an instance launched from the AMI is an Amazon EBS volume created from an Amazon EBS snapshot.
Backed by instance store – means that the root device for an instance launched from the AMI is an instance store volume created from a template stored in Amazon S3.
Root device size limit for –
Amazon EBS – Backed is 16 TiB
Amazon Instance Store-Backed is 10 GiB

Q29

Answer :
We can determine the Root Device type of AMI using following 2 methods.
Method 1: Following are the steps to determine the Root Device type of an AMI using the console
  1. Open the Amazon EC2 console
  2. In the navigation pane, click AMIs, and select the AMI
  3. Check the value of Root Device Type in the Details tab as follows
  • If the value is ebs, this is an Amazon EBS-backed AMI
  • If the value is instance store, this is an instance store-backed AMI
Method 2: Following are the steps to determine the root device type of an AMI using the command line
We can use one of the following commands.
  1. describe-images (AWS CLI)
  2. Get-EC2Image (AWS Tools for Windows PowerShell)

Q28

Answer :
You can customize a instance that is launched from a public AMI and then save that configuration as a custom AMI for your own use.
Instances that you launch from your AMI use all the customizations that you’ve made.

Q27

Answer :
Key pair is used to log in to your instance securely. This is public-key cryptography to secure the login information for your instance.

Q26

Answer :
We can create one using the Amazon EC2 console. To launch instances in multiple regions, we’ll need to create a key pair in each region.
Following are the steps to create Key Pair:
  • Sign in to Amaon Web Service.
  • From the AWS dashboard, choose EC2 to open the Amazon EC2 console.
  • From the navigation bar, select a region for the key pair.
  • In the left navigation pane, under NETWORK & SECURITY, click Key Pairs.
  • Click Create Key Pair.
  • Enter a name for the new key pair in the Key pair name field of the Create Key Pair dialog box, and then click Create.
  • The private key file is automatically downloaded by your browser. The base file name is the name you specified as the name of your key pair, and the file name extension is .pem.

Q25

Answer :
AWS uses public-key cryptography to secure the login information for your instance. A Linux instance has no password; you use a key pair to log in to your instance securely.
You specify the name of the key pair when you launch your instance, then provide the private key when you log in using SSH.

Q24

Answer :
You can migrate your EC2 instance from one Availability Zone to another.
Following are the steps to migrate an Instance to another Availability Zone:
  • Create an AMI from the running instance
  • Launch an instance from the AMI that you just created, specify the new Availability Zone
  • You can use the same instance type as the original instance, or select a new instance type
  • If the original instance has an associated Elastic IP address, then associate it with the new instance
  • If the original instance is a Reserved Instance, change the Availability Zone for your reservation

Q23

Answer :
We can launch different types of instances from a single AMI. An instance type essentially determines the hardware of the (pivotal training) host computer used for your instance. Each instance type offers different compute and memory capabilities. 
After we launch an instance, it looks like a traditional host, and we can interact with it as we would do with any computer. We have complete control of our instances; we can use sudo to run commands that require root privileges.

Q22

Answer :
An Amazon Machine Image (AMI) is a template that contains a software configuration (for example, an operating system, an application server, and applications). From an AMI, we launch an instance, which is a copy of the AMI running as a virtual server in the cloud. We can even launch multiple instances of an AMI.

Q21

Answer :
Amazon Web Services provides several ways to access Amazon EC2, like web-based interface, AWS Command Line Interface (CLI) and Amazon Tools for Windows Powershell. First, you need to sign up for an AWS account and you can access Amazon EC2.
Amazon EC2 provides a Query API. These requests are HTTP or HTTPS requests that use the HTTP verbs GET or POST and a Query parameter named Action.

EKS Steps

Amazon Elastic Kubernetes Service (EKS) cluster involves creating the management console tools, the cluster control plane, worker nodes, and...