Thursday, 15 February 2018

AWS LAB

Computing

CREATE YOUR FIRST AMAZON EC2 INSTANCE (LINUX)
CREATE YOUR FIRST AMAZON EC2 INSTANCE (WINDOWS)
FIRST STEPS INTO THE LINUX CONSOLE

Storage

USING S3 BUCKET POLICIES AND CONDITIONS TO RESTRICT SPECIFIC PERMISSIONS
CREATE AN EBS-BACKED LINUX AMI
MANAGING INSTANCE VOLUMES USING EBS
INTRODUCTION TO THE ELASTIC FILE SYSTEM
CONFIGURING A STATIC WEBSITE WITH S3 AND CLOUDFRONT

Databases

INTRODUCTION TO DYNAMODB
CREATE YOUR FIRST AMAZON RDS DATABASE
CREATE YOUR FIRST AMAZON S3 BUCKET

Networking & Auto Scaling

INTRODUCTION TO VIRTUAL PRIVATE CLOUD (VPC)
SERVE YOUR FILES USING THE CLOUDFRONT CDN
WORKING WITH THE APPLICATION LOAD BALANCER
CREATING YOUR FIRST AUTO SCALING GROUP
WORKING WITH AMAZON EC2 AUTO SCALING GROUPS
LAUNCHING AUTO SCALING GROUPS BEHIND A CLASSIC LOAD BALANCER
CREATING YOUR FIRST CLASSIC LOAD BALANCER

Security

Others

INTRODUCTION TO AWS LAMBDA
MANAGE MESSAGE QUEUES USING AMAZON SQS
CREATE YOUR FIRST ELASTICACHE CLUSTER






CREATE YOUR FIRST AMAZON EC2 INSTANCE (LINUX)

How to launch, configure, and access a Linux virtual machine using AWS

Lab Overview

Amazon Elastic Compute Cloud (EC2) is one of the most popular AWS services. EC2 allows you to launch different types of cloud instances and pay for them with a pay-per-use model. EC2 allows you to have operating system level control of your computing resources while running in Amazon’s computing environment. Amazon EC2 reduces the time required to obtain and boot new server instances from days or weeks to minutes. This allows you to quickly scale capacity, both up and down, as your computing requirements change. Amazon EC2 allows you to build and configure your instances as you like, from your desired operating system to your applications.
By completing this hands-on lab, you will be able to launch and configure your first Amazon EC2 instance using the AWS Management Console.

Lab Objectives

Upon completion of this lab you will be able to:
  • Configure and launch an instance in EC2
  • Understand the Instance States and other critical instance information
  • Generate and use a Secure Shell (SSH) public/private key pair
  • Connect to a running Linux instance using an SSH client
  • Extract metadata about your running instance
  • Terminate an instance

Lab Prerequisites

You should be familiar with:
  • Conceptual understanding of EC2
  • Conceptual understanding of SSH client software, protocol, and keys
  • Some Linux shell/command level understanding is helpful, but not required

CREATE YOUR FIRST AMAZON EC2 INSTANCE (WINDOWS)

How to launch, configure, and access a Microsoft Windows virtual machine using AWS

Amazon EC2 is the most famous AWS service and allows you to launch different types of cloud instances and pay for them with a pay-per-use approach. With Amazon EC2 you can create new servers in a few minutes and use different images (AMI) to personalize them. AWS provides several Microsoft Windows Server AMIs that enables you to run any compatible Windows-based solution. You can use Windows-based applications, websites, and web-services written in .NET, for data processing, media transcoding, and any other task requiring Windows software.
By completing this hands-on lab, you will be able to launch and access your first Amazon EC2 instance running Microsoft Windows Server.

Follow these steps to learn by building helpful cloud resources

Log In to the Amazon Web Service Console

Your first step to start the laboratory experience

Create a Windows EC2 instance

Launch an new EC2 instance using the Windows AMI

Retrieve the Administrator password using the Keypair

Get the Windows Administrator password starting from the EC2 Keypair

Connect to a Windows instance using a Remote Desktop connection

How to start a Remote Desktop connection using the EC2 instance credentials

Get the EC2 instance metadata (Windows)

How to get the EC2 instance ID and other useful metadata

Terminate an EC2 instance

How to destroy an EC2 instance

FIRST STEPS INTO THE LINUX CONSOLE

GNU/Linux is the leading operating system on servers and other big iron systems such as mainframe computers and supercomputers. Any system administrator should know the basics of the Linux Command Line Interface (CLI). This laboratory will show you the Linux CLI step-by-step.

Follow these steps to learn by building helpful cloud resources

Introduction to the Linux Command Line Interface (CLI)

Learn what a shell is and a terminal emulator.

Log In to the Amazon Web Service Console

Your first step to start the laboratory experience

Create an EC2 instance

Launch a new EC2 instance using the management console wizard

Convert a PEM key to a PPK key

Learn how to generate a PPK (PuTTY key) using the AWS PEM key

Connect to a remote shell using an SSH connection

How to use a remote Linux shell from Windows, Linux or Mac

Move between directories and list file content

How to use pwd, ls, cd, cat and tail commands

Manage files and their permissions

Learm how to use cp, mv, rm, mkdir, chmod and chown commands

Monitor and manage processes

How to use top, free, uptime and df commands.

Terminate an EC2 instance

How to destroy an EC2 instance


USING S3 BUCKET POLICIES AND CONDITIONS TO RESTRICT SPECIFIC PERMISSIONS

Being able to restrict and grant access to specific S3 resources is fundamental when implementing your security procedures. There are various methods that could be used to achieve this, one of which is to implement bucket policies. Bucket policies are applied directly to a bucket within S3 itself, and apply to that bucket only.
To make your bucket policy even more effective, you can apply specific conditions as to when the effects of that Policy should apply. There are a number of conditions you could base your bucket policy upon, and the AWS documentation provides greater insight into these found here.
It is also possible to create user policies which are created within IAM, however for this lab we will be focusing on bucket policies. For more information regarding user policies, please see our other labs and courses relating to IAM.
This lab will guide you through the bucket policy creation process with the use of the AWS Policy Generator.
We will create 2 Bucket Policies
1. Configure a bucket policy that will restrict what a user can do within an S3 bucket based upon their IP address
2. Configure a bucket policy to only allow the upload of objects to a bucket when server side encryption has been configured for the object

Follow these steps to learn by building helpful cloud resources

Log In to the Amazon Web Service Console

Your first step to start the laboratory experience

Create an S3 bucket

Create a new S3 bucket

Create a Bucket Policy Within S3 with IP Address Conditions

How to create and apply a bucket policy with IP address conditions within S3 using the AWS Policy Generator.

Create a Bucket Policy Within S3 with Encryption Conditions

How to create and apply a bucket policy with encryption conditions using the AWS Policy Generator.

CREATE AN EBS-BACKED LINUX AMI

Learn to create a customized OS image through an Amazon Machine Image (AMI)

An Amazon Machine Image (AMI) provides the information required to launch an EC2 instance. You can customize an EC2 instance and then save the configuration as a custom AMI for your private or public use. Every EC2 instance launched selecting the customized AMI will contain any software or file that you've previously added.
During this lab, you will setup a webserver EC2 instance starting from a Linux AMI, and then generate a new AMI.

Follow these steps to learn by building helpful cloud resources

Log In to the Amazon Web Service Console

Your first step to start the laboratory experience

Create a basic webserver instance

How to create a simple webserver instance

Create an AMI starting from an EBS-backed instance

How to create an AMI starting from a customized EC2 instance

Make an AMI public

How to allow the usage of a specific AMI from other AWS accounts













MANAGING INSTANCE VOLUMES USING EBS

Learn to manage the storage space of your EC2 instance using Amazon EBS

Amazon Elastic Block Store (Amazon EBS) provides persistent block level storage volumes for use with Amazon EC2 instances in the AWS Cloud.  Each Amazon EBS volume is automatically replicated within its Availability Zone to protect you from component failure. This provides high availability and durability. Amazon EBS volumes offer consistent, low-latency performance needed to run your workloads.
During this laboratory, you will learn to create an EC2 instance with an additional EBS volume. You will learn to attach and detach an EBS to/from a specific EC2 instance, take a snapshot, and master how to delete a volume.

Follow these steps to learn by building helpful cloud resources

Log In to the Amazon Web Service Console

Your first step to start the laboratory experience

Create an EC2 instance with an additional EBS

How to launch an EC2 instance with an additional EBS volume

Create a new EBS volume

How to create a new EBS Volume.

Attach and Detach an EBS volume

How to attach and detach an EBS volume to an EC2 instance

Connect to a remote shell using an SSH connection

How to use a remote Linux shell from Windows, Linux or Mac

Create a filesystem on an EBS Volume

How to create a filesystem in an EBS volume using a Linux instance.

Create an EBS snapshot

How to create and manage EBS snapshots










INTRODUCTION TO THE ELASTIC FILE SYSTEM

Amazon Elastic File System (Amazon EFS) provides simple, scalable file storage for use with Amazon EC2 instances in the AWS Cloud. With Amazon EFS, storage capacity is elastic, growing and shrinking automatically as you add and remove files, so your applications have the storage they need, when they need it.
Amazon EFS has a simple web services interface that allows you to create and configure file systems quickly and easily. The service manages all the file storage infrastructure for you, avoiding the complexity of deploying, patching, and maintaining complex file system deployments.

Pre-requisites:

This is a beginner level Lab, however, in order to follow the next steps you should be able to:
  • Describe and launch EC2 instances;
  • Connect to an EC2 instance using SSH;
  • Describe, create and configure Security Groups.
 We recommend this lab as pre-requisite:
 Learning Objectives:
By the end of this lab you should be able to:
  • Create file systems;
  • Mount file systems to EC2 instances;
  • Read/write files to a file system.

Follow these steps to learn by building helpful cloud resources

Log In to the Amazon Web Service Console

Your first step to start the laboratory experience

Create a File System

In this step, you will create a new File System in the Elastic File System console.

Mount a File System

In this step, you will mount a File System in an EC2 instance.

Retrieve files from EFS

In this step, you will use another EC2 instance to retrieve files from a File System.





























CONFIGURING A STATIC WEBSITE WITH S3 AND CLOUDFRONT

You can easily and inexpensively use Amazon Web Services (AWS) to host a website that uses client-side technologies (such as HTML, CSS, and JavaScript) and does not require server-side technologies (such as PHP and ASP.NET). This type of site is called a static website and is used to display content that does not change frequently.
During this lab, you will host your static website using the Amazon Simple Storage Service ( S3) so that it is secure, fast, protected against data loss, and can scale to support enterprise-level traffic. To do that, you'll store your website files on Amazon S3 and also use S3 to deliver your content to visitors to your website.
After setting up the static website on S3, this lab will show you how to use Amazon CloudFront to create a content delivery network (CDN). A CDN makes your website content available from data centers around the world, called edge locations. Using edge locations improves the speed of your website by reducing latency. Doing so is especially important if your website displays large media files such as high-resolution images, audio, or video.
Are you ready to get started?
Pre-requisites:
This is a beginner level Lab, however, in order to follow the next steps you should be able to:
  • Create S3 buckets
  • Set permissions for buckets and objects using ACLs and bucket policies
  • Create CloudFront distributions
We recommend these labs as pre-requisites:

Learning Objectives:

By the end of this lab you should be able to:
  • Configure static website hosting on Amazon S3
  • Configure static websites to work with CloudFront distributions

Follow these steps to learn by building helpful cloud resources

Log In to the Amazon Web Service Console

Your first step to start the laboratory experience

Create a S3 Static Website

In this step, you will create a new S3 static website

Create a CloudFront Distribution For The Static Website

In this step, you will create a new CloudFront distribution to work with the S3 static website



































USING S3 BUCKET POLICIES AND CONDITIONS TO RESTRICT SPECIFIC PERMISSIONS

Being able to restrict and grant access to specific S3 resources is fundamental when implementing your security procedures. There are various methods that could be used to achieve this, one of which is to implement bucket policies. Bucket policies are applied directly to a bucket within S3 itself, and apply to that bucket only.
To make your bucket policy even more effective, you can apply specific conditions as to when the effects of that Policy should apply. There are a number of conditions you could base your bucket policy upon, and the AWS documentation provides greater insight into these found here.
It is also possible to create user policies which are created within IAM, however for this lab we will be focusing on bucket policies. For more information regarding user policies, please see our other labs and courses relating to IAM.
This lab will guide you through the bucket policy creation process with the use of the AWS Policy Generator.
We will create 2 Bucket Policies
1. Configure a bucket policy that will restrict what a user can do within an S3 bucket based upon their IP address
2. Configure a bucket policy to only allow the upload of objects to a bucket when server side encryption has been configured for the object

Follow these steps to learn by building helpful cloud resources

Log In to the Amazon Web Service Console

Your first step to start the laboratory experience

Create an S3 bucket

Create a new S3 bucket

Create a Bucket Policy Within S3 with IP Address Conditions

How to create and apply a bucket policy with IP address conditions within S3 using the AWS Policy Generator.

Create a Bucket Policy Within S3 with Encryption Conditions

How to create and apply a bucket policy with encryption conditions using the AWS Policy Generator.

CREATE AN EBS-BACKED LINUX AMI

Learn to create a customized OS image through an Amazon Machine Image (AMI)

An Amazon Machine Image (AMI) provides the information required to launch an EC2 instance. You can customize an EC2 instance and then save the configuration as a custom AMI for your private or public use. Every EC2 instance launched selecting the customized AMI will contain any software or file that you've previously added.
During this lab, you will setup a webserver EC2 instance starting from a Linux AMI, and then generate a new AMI.

Follow these steps to learn by building helpful cloud resources

Log In to the Amazon Web Service Console

Your first step to start the laboratory experience

Create a basic webserver instance

How to create a simple webserver instance

Create an AMI starting from an EBS-backed instance

How to create an AMI starting from a customized EC2 instance

Make an AMI public

How to allow the usage of a specific AMI from other AWS accounts



















MANAGING INSTANCE VOLUMES USING EBS

Learn to manage the storage space of your EC2 instance using Amazon EBS

Amazon Elastic Block Store (Amazon EBS) provides persistent block level storage volumes for use with Amazon EC2 instances in the AWS Cloud.  Each Amazon EBS volume is automatically replicated within its Availability Zone to protect you from component failure. This provides high availability and durability. Amazon EBS volumes offer consistent, low-latency performance needed to run your workloads.
During this laboratory, you will learn to create an EC2 instance with an additional EBS volume. You will learn to attach and detach an EBS to/from a specific EC2 instance, take a snapshot, and master how to delete a volume.

Follow these steps to learn by building helpful cloud resources

Log In to the Amazon Web Service Console

Your first step to start the laboratory experience

Create an EC2 instance with an additional EBS

How to launch an EC2 instance with an additional EBS volume

Create a new EBS volume

How to create a new EBS Volume.

Attach and Detach an EBS volume

How to attach and detach an EBS volume to an EC2 instance

Connect to a remote shell using an SSH connection

How to use a remote Linux shell from Windows, Linux or Mac

Create a filesystem on an EBS Volume

How to create a filesystem in an EBS volume using a Linux instance.

Create an EBS snapshot

How to create and manage EBS snapshots

































































































Sunday, 11 February 2018

Scenerio Based Linux Interview Questions with Answer

1. Which file have runlevel configuration?

/ect/inittab

2. What command would you use to shut down the system in 100 seconds?

#shutdown -h 100

3. What daemon controls the print spooling process?

The Line Printing Daemon (lpd) controls the print spooling process.

4. What configuration file defines the default runlevel for the init process?

/etc/inittab file defines the default runlevel for the init process.

5. Which command can you use to shut down and halt a Linux System?

The halt command will shut down a Linux system without rebooting

6. What init level should you set to bring the system to single-user mode?

init 1 will bring the system to single-user mode

7. A user wants to restart the NFS server because they want to enable changes made in the configuration file. What command accomplishes this task?

#service nfs reload

The reload command will tell the system to stop the service, reload the configuration file, and restart the service

8. What command can you use to reboot a Linux system?

The command to reboot a Linux system is reboot

9. What mode must you be in when using vi editor to input text into a file?

To insert text in the vi editor, you must be in insert mode
What runlevel does init 1 represent?

init 1 represents runlevel1. Runlevel 1 is used for single user mode.

10. One user from your company left the job without telling root account password of his system. To reset root password, in which mode you need to boot the system?

To reset the root password, we need to boot the system in single user mode.

11. What runlevel does init 2 represent?

init2 represents rulevel 2. runlevel 2 is used for multiuser without networking.

12. Some users are complaining that the DHCP server is not running. After examine the running processes on the system, you notice that the process is not present. What command should you use to start the DHCP service?

Because the service is currently not running, use the start command

#service dhcpd start

13. What runlevel does init 5 represent?

Runlevel 5 is used to boot up a full multiuser system and to automatically start X-windows.

14. What tar argument is used to extract files from an archive?

To extract files from an archive, use the -x argument in the tar command.

15. What init runlevel should be set to shut down and reboot the system?

init runlevel 6 is used to shut down and reboot the system

16. What command would you use to add the user name vickey?

#useradd vickey

This command will add the user viceky with default options. But this will not be able to login in system until you set a password for it. To set password use following command

#passwd vickey

17. Which runlevel currently not is used ?

Runlevel 4 is not used.

18. Your company hired a new developer for temporary periods to speed up the ongoing project. You are tasked to create a new user account which should be disabled automatically on 5 may 2014. How would you do that?

Use -e option with useradd command. -e option allows you to set the date on which the user account will be disabled. The date is specified in the format YYYY-MM-DD. Following command will do the assigned task

#useradd -e 2014-05-05

19. Which command should you use to change the user information listed form finger command?

chfn command is used to change the information listed from finger command.

20. What runlevel does init 6 represent?

Runlevel 6 is used to reboot the system.

21. You are tasked to delete a user account with all his associated files including his home directory and mail folder. How will you do that ?

#userdel -r [username]

Above command will delete user account as well all his associated files including his home directory and mail folder.

22. A user comes to you and complain that his system was starting fine in GUI mode, but from last reboot system is starting in command line interface. What is the most likely cause of the problem?

In the /etc/inittab file, the default runlevel is probably set to 3, which tells it to start the system in command line.

23. What files are updated when adding a group?

/etc/group and /etc/gshadow files contains group information in Linux system. So these files would be updated every time whenever new group is added.

24. What command is used to delete a group?

The groupdel command will delete a group.

25. What runlevel does init 3 represent?

init3 represents rulevel 3. runlevel 3 is used for multiuser with networking.

26. What command will display the directory path that is currently in use?

pwd command will display the directory path that is currently in use.

27. A user type 'cd ~ ' on command prompt, what this command will do?

This command will move user to his or her home directory. ~ represents home directory in Linux.

28. A user comes to you and complain that his system start fine, but as soon as it is almost loaded it reboot again. What is the most likely cause of the problem?

In the /etc/inittab file, the default runlevel is probably set to 6, which tells it to reboot right after the system has started.

29. Which command will list all the files and sub-directories in a directory and include the access rights?

ls -l command will list all the files and sub-directories in a directory and include the access rights.

30. Which command will list all the files in a directory including hidden files?

ls -a command will list all the files in a directory including hidden files.

31. What is the correct syntax for the move command?

The correct syntax for the move command is

mv [options] [source] [destination]

32. Which character option with chmod command allows the execute-only permission if the file is a directory?

The x option is used to allow execute only if the file is a directory.

33. How will you display confirmation of the change of ownership of a file from rhuser1 to rhuser2?

Use --verbose option with chown command. For example

#chown --verbose rhuser2 /tmp/testfile

34. Which command is used to un-mount a DVD?

Use umount command to un-mount the DVD or CD or any other mounted media.

35. What runlevel does init 0 represent?

Runlevel 0 is used to halt /shutdown the system.

36. Which command will display the total size of all files, without listing the files, in a user's home directory?

The command du -c -s /home/user will display the total size of all files, without listing the files

37. Which command will display the available space of each partition in megabytes (MB)?

The command df -m will display the available space of each partition in MB.

38. Hard drive in your system is full and you want new hard drive. However sales department would not approve the expenditure without proof. Which tool would you use get a proof?

Use df command to justify the available free space in hard disk.

39. A user comes to you and complain that his system start fine, but as soon as it is almost loaded it shuts down again. What is the most likely cause of the problem?

In the /etc/inittab file, the default runlevel is probably set to 0, which tells it to shutdown right after the system has started.

LVM interview questions and answers.

1.Is it possible to increase the logical volume on fly?
Answer: Yes. LVM has the feature to increase the volume without unmount it.

2.How to reduce the logical volume? is it possible to reduce on fly?
Answer: No. we can't reduce the logical volume on fly. Here is the steps to reduce the logical volume.

Un-mount the filesystem
Run e2fsck on the volume device
Reduce the Filesystem using resize2fs
Reduce the logical Volume using lvreduce
Mount the filesystem back for production.

3.How do you scan the new LUN or disk?
Answer:Use "echo 1 > /sys/class/scsi_host/hostx/scan" to scan disk from newly connected SAN or DISKS and also replace the "x" with number of host id present under /sys/class/scsi_host/.

4.How to scan disks for existing volume group?
Answer:Use "vgscan" to scan existing volume group from newly connected SAN or DISKS.
But we should use "pvscan" prior to executing this command.

5.How to scan a logical volume from exising volume group?
Answer: lvscan

6.How to stop the logical volume? or deactivate the logical volume?
Answer: "lvchange -an /dev/vg_name/lv_name"


7.How to activate the logical volume which is in deactivated state?
Answer: "lvchange -ay /dev/vg_name/lv_name".

8.How to disable the volume group? or Deactivate the volume group?
Answer:"vgchange -an volume_group_name".

9.How to enable the volume group? or Activate the volume group?
Answer:"vgchange -ay volume_group_name" .

10.How do you find that what are the disks are used for logical volume mirroring?
Answer: use "lvs -a -o +devices"

11. What are steps to perform in order to increase the logical volume on fly?
Answer:
   Extend the logical volume
   Increase the Filesystem size
   Verify the status using df command or lvs command.



12.How to list the imported volume groups?
Answer: Use "vgs" command to display the imported volume group.

13.How to list the available logical volumes on the system?
Answer: Use "lvs" command to list the available logical volumes on the system.

14.How to list the available physical volumes in LVM?
Answer: Use "pvs" command to list the available physical volumes.

15.How to see the detailed volume group information?
Answer: Use "vgdisplay vg_name"
 
16.How to see the detailed logical volume information?
Answer: Use "lvdisplay /dev/vg_name/lv_name"

17.How to see the detailed physical volume information?
Answer: Use "pvdisplay /dev/disk_name"  Ex: pvdisplay /dev/sde

18.How to rename volume Group? can we rename the VG on fly?
Answer:Yes. Its possible to rename the volume group on fly. But the mounted volumes will not reflect the same unless you re-mount the volume with new VG name. Need to update the /etc/fstab with new VG name to mount the volumes across the system reboot.

19.How to take a LVM configuration backup?
Answer:Use "vgcfgbackup vg_name" to take the latest configuration backup of volume group. The default volume group backup location is "/etc/lvm/backup" .

20.How to re-create the device files for LVM volumes?
Answer:Run "vgmknodes" to recreate the LVM devices files.

21.What is lvmdump?
Answer: "lvmdump" is tool for LVM2 to collect the various information for diagnostic purposes.By default, it creates a tarball suitable for submission along with a problem report

22.How are snapshots in LVM2 different from LVM1 in Redhat Linux?
Answer:LVM1 snapshots are readonly by default where LVM2 snapshots were read/write.

23.What are the steps involved to create the logical volume from scratch?
Answer:
Create a physical volume using pvcreate command.
   #pvcreate /dev/sdc
Create a volume group using "vgcreate" command
   #vgcreate vg02 /dev/sdc
Create a logical volume using "lvcreate" command
   #lvcreate -L 100M -n vol1 vg02
Create a filesystem on logical volume using mkfs command.
    #mkfs -t ext4 /dev/vg02/vol1
Mount the filesystem using mount command for use.
    #mount -t ext4 /dev/vg02/vol1 /vol1

24.How to extent the volume group?
Answer:Using "vgextend" we can increase the volume group.

25.Assume Volume group "vg02" is already exists. How do you extend the volume group with 50GB? Provide all the steps with commands.
Answer:
   1.Get the 50GB lun from storage team.(/dev/sdd)
   2.Create physcical volume ( # pvcreate /dev/sdd )
   2.Extend the volume group (# vgextend vg02 /dev/sdd)

26.If the vg02 has two physical volumes called /dev/sdc/ & /dev/sdd. How do you remove /dev/sdd from vg02.
Answer: "vgreduce vg02 /dev/sdd/"

27.How to decommission/remove LVM completely from the host?
Answer:
     1.Un-mount all the logical filesystems
     2.Remove the logical volumes using "lvremove" command.
     3.Destroy the volume group using "vgremove" command.
     4.Use "pvremove" command remove the physical volumes from the system.

28. Why LVM is required?
Ans: LVM stands for Logical Volume Manager , to resize filesystem's size online we required LVM partition in Linux. Size of LVM partition can be extended and reduced using the lvextend & lvreduce commands respectively.

29. How to create partition from the raw disk?
Ans: Using fdisk utility we can create partitions from the raw disk.Below are the steps to create partition from the raw disk :
- fdisk /dev/hd* (IDE) or /dev/sd* (SCSI)
- Type n to create a new partition
- After creating partition , type w command to write the changes to the partition table.

Vmware Interview Questions and Answers

1. What is a Hypervisor?

It is a program that allows multiple operating systems to share a single hardware host. Each operating system appears to have the host's processor, memory, and other resources all to itself. However, the hypervisor is actually controlling the host processor and resources, allocating what is needed to each operating system in turn and making sure that the guest operating systems (called virtual machines) cannot disrupt each other.

2. What are the files that make a Virtual Machine?

     .vmx - Virtual Machine Configuration File
     .nvram - Virtual Machine BIOS
     .vmdk - Virtual Machine Disk file
     .vswp - Virtual Machine Swap File
     .vmsd - Virtual MAchine Snapshot Database
     .vmsn - Virtual Machine Snapshot file
     .vmss - Virtual Machine Suspended State file
     .vmware.log - Current Log File
     .vmware-#.log - Old Log file

3. What is the difference between the vSphere ESX and ESXi architectures?


VMware ESX and ESXi are both bare metal hypervisor architectures that install directly on the server hardware.

Although neither hypervisor architectures relies on an OS for resource management, the vSphere ESX architecture relied on a Linux operating system, called the Console OS (COS) or service console, to perform two management functions: executing scripts and installing third-party agents for hardware monitoring, backup or systems management.

In the vSphere ESXi architecture, the service console has been removed. The smaller code base of vSphere ESXi represents a smaller “attack surface” and less code to patch, improving reliability and security.

4. What is a .vmdk file?

This isn't the file containing the raw data. Instead it is the disk descriptor file which describes the size and geometry of the virtual disk file. This file is in text format and contains the name of the –flat.vmdk file for which it is associated with and also the hard drive adapter type, drive sectors, heads and cylinders, etc. One of these files will exist for each virtual hard drive that is assigned to your virtual machine. You can tell which –flat.vmdk file it is associated with by opening the file and looking at the Extent Description field.

5. What are the different types of virtualization?

Server Virtualization – consolidating multiple physical servers into virtual servers that run on a single physical server.

Application Virtualization – an application runs on another host from where it is installed in a variety of ways. It could be done by application streaming, desktop virtualization or VDI, or a VM package (like VMware ACE creates with a player). Microsoft Softgrid is an example of Application virtualization.

Presentation Virtualization – This is what Citrix Met frame (and the ICA protocol) as well as Microsoft Terminal Services (and RDP) are able to create. With presentation virtualization, an application actually runs on another host and all that you see on the client is the screen from where it is run.

Network Virtualization – with network virtualization, the network is “carved up” and can be used for multiple purposes such as running a protocol analyzer inside an Ethernet switch. Components of a virtual network could include NICs, switches, VLANs, network storage devices, virtual network containers, and network media.

Storage Virtualization – with storage virtualization, the disk/data storage for your data is consolidated to and managed by a virtual storage system. The servers connected to the storage system aren’t aware of where the data really is. Storage virtualization is sometimes described as “abstracting the logical storage from the physical storage.

6. What is VMware vMotion and what are its requirements?

VMware VMotion enables the live migration of running virtual machines from one physical server to another with zero downtime.

VMotion lets you:

    Automatically optimize and allocate entire pools of resources for maximum hardware utilization and
    availability.
    Perform hardware maintenance without any scheduled downtime.
    Proactively migrate virtual machines away from failing or under performing servers.

Below are the pre-requisites for configuring vMotion

    Each host must be correctly licensed for vMotion
    Each host must meet shared storage requirements
        vMotion migrates the vm from one host to another which is only possible with both the host are sharing a common storage or to any storage accessible by both the source and target hosts.
        A shared storage can be on a Fibre Channel storage area network (SAN), or can be implemented using iSCSI SAN and NAS.
        If you use vMotion to migrate virtual machines with raw device mapping (RDM) files, make sure to maintain consistent LUN IDs for RDMs across all participating hosts.

    Each host must meet the networking requirements
        Configure a VMkernel port on each host.
        Dedicate at least one GigE adapter for vMotion.
        Use at least one 10 GigE adapter if you migrate workloads that have many memory operations.
        Use jumbo frames for best vMotion performance.
        Ensure that jumbo frames are enabled on all network devices that are on the vMotion path including physical NICs, physical switches and virtual switches.

7. What is the difference between clone and template in VMware?

Clone

    A clone is a copy of virtual machine.
    You cannot convert back the cloned Virtual Machine.
    A Clone of a Virtual Machine can be created when the Virtual Machine is powered on
    Cloning can be done in two ways namely Full Clone and Linked Clone.
    A full clone is an independent copy of a virtual machine that shares nothing with the parent virtual machine after the cloning operation. Ongoing operation of a full clone is entirely separate from the parent virtual machine.
    A linked clone is a copy of a virtual machine that shares virtual disks with the parent virtual machine in an ongoing manner. This conserves disk space, and allows multiple virtual machines to use the same software installation.
    Cloning a virtual machine can save time if you are deploying many similar virtual machines. You can create, configure, and install software on a single virtual machine, and then clone it multiple times, rather than creating and configuring each virtual machine individually.
Template

    A template is a master copy or a baseline image of a virtual machine that can be used to create many clones.
    Templates cannot be powered on or edited, and are more difficult to alter than ordinary virtual machine.
    You can convert the template back to Virtual Machine to update the base template with the latest released patches and updates and to install or upgrade any software and again convert back to template to be used for future deployment of Virtual Machines with the latest patches.
    Convert virtual Machine to template cannot be performed, when Virtual machine is powered on.  Only Clone to Template can be performed when the Virtual Machine is powered on.
    A template offers a more secure way of preserving a virtual machine configuration that you want to deploy many times.
    When you clone a virtual machine or deploy a virtual machine from a template, the resulting cloned virtual machine is independent of the original virtual machine or template.

8. What is promiscuous mode in Vmware?

    Promiscuous mode is a security policy which can be defined at the virtual switch or portgroup level
    A virtual machine, Service Console or VMkernel network interface in a portgroup which allows use of promiscuous mode can see all network traffic traversing the virtual switch.
    If this mode is set to reject, the packets are sent to intended port so that the intended virtual machine will only be able to see the communication.
    Example: In case you are using a virtual xp inside any Windows VM. If promiscuous mode is set to reject then the virtual xp won't be able to connect the network unless promiscuous mode is enabled for the Windows VM.

9. What is the difference between Thick provision Lazy Zeroed, Thick provision Eager Zeroed and Thin provision?

Thick Provision Lazy Zeroed

    Creates a virtual disk in a default thick format.
    Space required for the virtual disk is allocated when the virtual disk is created.
    Data remaining on the physical device is not erased during creation, but is zeroed out on demand at a later time on first write from the virtual machine.
    Using the default flat virtual disk format does not zero out or eliminate the possibility of recovering deleted files or restoring old data that might be present on this allocated space.
    You cannot convert a flat disk to a thin disk.

Thick Provision Eager Zeroed

    A type of thick virtual disk that supports clustering features such as Fault Tolerance.
    Space required for the virtual disk is allocated at creation time.
    In contrast to the flat format, the data remaining on the physical device is zeroed out when the virtual disk is created.
    It might take much longer to create disks in this format than to create other types of disks.

Thin Provision

    It provides on on-demand allocation of blocks of data.
    All the space allocated at the time of creation of virtual disk is not utilized on the hard disk, rather only the size with utilized data is locked and the size increases as the amount of data is increased on the disk.
    With thin provisioning, storage capacity utilization efficiency can be automatically driven up towards 100% with very little administrative overhead.

10. What is a snapshot?

A snapshot is a “point in time image” of a virtual guest operating system (VM). That snapshot contains an image of the VMs disk, RAM, and devices at the time the snapshot was taken. With the snapshot, you can return the VM to that point in time, whenever you choose. You can take snapshots of your VMs, no matter what guest OS you have and the snapshot functionality can be used for features like performing image level backups of the VMs without ever shutting them down.

11. What is VDI?

    VDI stands for Virtual Desktop Infrastructure where end user physical machine like desktop or laptop are virtualized due to which VMware described VDI as "delivering desktops from the data center”.
    Once VDI is used the end user connect to their desktop using a device called thin client.
    The end user can also connect to their desktop using VMware Horizon View installed on any desktop or mobile devices
12. What is VMware HA?

    VMware HA i.e. High Availability which works on the host level and is configured on the Cluster.

    A Cluster configured with HA will migrate and restart all the vms running under any of the host in case of any host-level failure automatically to another host under the same cluster.

    VMware HA continuously monitors all ESX Server hosts in a cluster and detects failures.

    VMware HA agent placed on each host maintains a heartbeat with the other hosts in the cluster using the service console network. Each server sends heartbeats to the others servers in the cluster at five-second intervals. If any servers lose heartbeat over three consecutive heartbeat intervals, VMware HA initiates the failover action of restarting all affected virtual machines on other hosts.

    You can set virtual machine restart priority in case of any host failure depending upon the critical nature of the vm.

NOTE: Using HA in case of any host failure with RESTART the vms on different host so the vms state will be interrupted and it is not a live migration

13. What is the difference between VMware HA and vMotion?

VMware HA is used in the event when any of the hosts inside a cluster fails then all the virtual machines running under it are restarted on different host in the same cluster.

Now HA is completely dependent on vMotion to migrate the vms to different host so vMotion is just used for the migration purpose between multiple hosts. vMotion also has the capability to migrate any vm without interrupting its state to any of the host inside cluster.

14. What is storage vMotion?

    Storage vMotion is similar to vMotion in the sense that "something" related to the VM is moved and there is no downtime to the VM guest and end users. However, with SVMotion the VM Guest stays on the server that it resides on but the virtual disk for that VM is what moves.
    With Storage vMotion, you can migrate a virtual machine and its disk files from one datastore to another while the virtual machine is running.
    You can choose to place the virtual machine and all its disks in a single location, or select separate locations for the virtual machine configuration file and each virtual disk.
    During a migration with Storage vMotion, you can transform virtual disks from Thick-Provisioned Lazy Zeroed or Thick-Provisioned Eager Zeroed to Thin-Provisioned or the reverse.
    Perform live migration of virtual machine disk files across any Fibre Channel, iSCSI, FCoE and NFS storage

15. What is VMware DRS and how does it works?

    Here DRS stands for Distributed Resource Scheduler which dynamically balances resource across various host under Cluster or resource pool.
    VMware DRS allows users to define the rules and policies that decide how virtual machines share resources and how these resources are prioritized among multiple virtual machines.
    Resources are allocated to the virtual machine by either migrating it to another server with more available resources or by making more “space” for it on the same server by migrating other virtual machines to different servers.
    The live migration of virtual machines to different physical servers is executed completely transparent to end-users through VMware VMotion
    VMware DRS can be configured to operate in either automatic or manual mode. In automatic mode, VMware DRS determines the best possible distribution of virtual machines among different physical servers and automatically migrates virtual machines to the most appropriate physical servers. In manual mode, VMware DRS provides a recommendation for optimal placement of virtual machines, and leaves it to the system administrator to decide whether to make the change.

16. What is VMware Fault Tolerance?

    VMware Fault Tolerance provides continuous availability to applications running in a virtual machine, preventing downtime and data loss in the event of server failures.
    VMware Fault Tolerance, when enabled for a virtual machine, creates a live shadow instance of the primary, running on another physical server.
    The two instances are kept in virtual lockstep with each other using VMware vLockstep technology
    The two virtual machines play the exact same set of events, because they get the exact same set of inputs at any given time.
    The two virtual machines constantly heartbeat against each other and if either virtual machine instance loses the heartbeat, the other takes over immediately. The heartbeats are very frequent, with millisecond intervals, making the failover instantaneous with no loss of data or state.
    VMware Fault Tolerance requires a dedicated network connection, separate from the VMware VMotion network, between the two physical servers.

17. In a cluster with more than 3 hosts, can you tell Fault Tolerance where to put the Fault Tolerance virtual machine or does it chose on its own?

You can place the original (or Primary virtual machine). You have full control with DRS or vMotion to assign it to any node. The placement of the Secondary, when created, is automatic based on the available hosts. But when the Secondary is created and placed, you can vMotion it to the preferred host.

18. How many virtual CPUs can I use on a Fault Tolerant virtual machine?

vCenter Server 4.x and vCenter Server 5.x support 1 virtual CPU per protected virtual machine.

19. What happens if vCenter Server is offline when a failover event occurs?

When Fault Tolerance is configured for a virtual machine, vCenter Server need not be online for FT to work. Even if vCenter Server is offline, failover still occurs from the Primary to the Secondary virtual machine. Additionally, the spawning of a new Secondary virtual machine also occurs without vCenter Server.

20. What is the difference between Type 1 and Type 2 Hypervisor?

Type 1 Hypervisor

    This is also known as Bare Metal or Embedded or Native Hypervisor.
    It works directly on the hardware of the host and can monitor operating systems that run above the hypervisor.
    It is completely independent from the Operating System.
    The hypervisor is small as its main task is sharing and managing hardware resources between different operating systems.
    A major advantage is that any problems in one virtual machine or guest operating system do not affect the other guest operating systems running on the hypervisor.
    Examples: VMware ESXi Server, Microsoft Hyper-V, Citrix/Xen Server
Type 2 Hypervisor

    This is also known as Hosted Hypervisor.
    In this case, the hypervisor is installed on an operating system and then supports other operating systems above it.
    It is completely dependent on host Operating System for its operations
    While having a base operating system allows better specification of policies, any problems in the base operating system a ffects the entire system as well even if the hypervisor running above the base OS is secure.
    Examples: VMware Workstation, Microsoft Virtual PC, Oracle Virtual Box

21. How does vSphere HA works?

When we configure multiple hosts for HA cluster, a single host is automatically elected as the master host. The master host communicates with vCenter Server and monitors the state of all protected virtual machines and of the slave hosts. When you add a host to a vSphere HA cluster, an agent is uploaded to the host and configured to communicate with other agents in the cluster.

22. What are the monitoring methods used for vSphere HA?

The Master and Slave hosts uses two types of monitoring the status of the hosts

    Datastore Heartbeat
    Network Heartbeat

23. What are the roles of master host in vSphere HA?

    Monitoring the state of slave hosts. If a slave host fails or becomes unreachable, the master host identifies which virtual machines need to be restarted.
    Monitoring the power state of all protected virtual machines. If one virtual machine fails, the master host ensures that it is restarted. Using a local placement engine, the master host also determines where the restart should be done.
    Managing the lists of cluster hosts and protected virtual machines.
    Acting as vCenter Server management interface to the cluster and reporting the cluster health state.

24. How is a Master host elected in vSphere HA environment?

When vSphere HA is enabled for a cluster, all active hosts (those not in standby or maintenance mode, or not disconnected) participate in an election to choose the cluster's master host. The host that mounts the greatest number of datastores has an advantage in the election. Only one master host typically exists per cluster and all other hosts are slave hosts.

If the master host fails, is shut down or put in standby mode, or is removed from the cluster a new election is held.

25. If the vCenterserver goes down with a situation that it was pre configured with vSphere HA and DRS, so after power down will HA and DRS perform their task?

vSphere HA is not dependent on vCenterserver for its operations as when HA is configured it installs an agent into each host which does its part and is not dependent on vCenterserver. Also HA doesnot uses vMotion, it justs restarts the vms into another host in any case of host failure.

Further vSphere DRS is very much dependent on vCenterserver as it uses vMotion for its action for live migration of vms between multiple hosts so in case vCenterserver goes down the vMotion won't work leading to failure of DRS.

26. What is the use of vmware tools?

VMware Tools is a suite of utilities that enhances the performance of the virtual machine's guest operating system and improves management of the virtual machine. Without VMware Tools installed in your guest operating system, guest performance lacks important functionality. Installing VMware Tools eliminates or improves these issues:

    Low video resolution
    Inadequate color depth
    Incorrect display of network speed
    Restricted movement of the mouse
    Inability to copy and paste and drag-and-drop files
    Missing sound
    Provides the ability to take quiesced snapshots of the guest OS
    Synchronizes the time in the guest operating system with the time on the host
    Provides support for guest-bound calls created with the VMware VIX API

Tuesday, 6 February 2018

vSphere 5 vs vSphere 6 Difference between both versions

vSphere 5 vs vSphere 6 Difference between both versions