Thursday, January 29, 2015

VMWare interview Ques and Ans-Networking


What is Service Console?


The service console is developed based up on Redhat Linux Operating system, it is used to manage the VMKernel
What are the basic commands to troubleshoot  connectivity between vSphere Client /vCenter to ESX server?

service mgmt-vmware restart  (restarts host agent(vmware-hostd) on vmware esx server)
service vmware-vpxa restrat (restarts Vcenter agent service)
service network restart (restarts management networks on ESX)
What is vCenter Agent?
VC agent is an agent installed on ESX server which enables communication between VC and ESX server. This Agent will be installed on ESX/ESXi will be done when you try to add the ESx host in Vcenter.
What is the command used to restart SSH, NTP & Vmware Web access?
Service sshd restart
Service ntpd restrat
Service vmware-webaccess restart
What are the types of Ports groups in ESX/ESXi?
There are 3 types of port groups in ESX
1.Service console port group
2.VMkernel Port group
3. Virtual machine port group
There are only 2 types of port group in ESXi
1. Vmkernel Port group
2.Virtual Machine Port group
What is VMKernel ?
VMWare Kernel is a Proprietary kernel  of vmwareand is not based on any of the flavors of Linux operating systems, .VMkernel requires an operating system to boot and manage the kernel. A service console is being provided when VMWare kernel is booted. Only service console is based up on Redhat Linux OS not VMkernel.
What is the use of Service Console port ?
Service console port group required to manage the ESX server and it acts as the management network for the ESX. Vcenter/Vsphere Client uses the service console IP’s to communicate with the ESX server.
What is the use of VMKernel Port ?
Vmkernel port is used by ESX/ESXi for vmotion, ISCSI & NFS communications. ESXi uses Vmkernel as the management network  since it don’t have service console built with it.
What is the use of Virtual Machine Port Group?
Virtual Machine port group is used by Virtual machine communication.
How Virtual Machine communicates to another servers in Network ?
All the Virtual Machines which are configured in VM Port Group are able to connect to the other machines on the network. So this port group enables communication between vSwitch and Physical Switch by the use of uplink (Physical NIC) associated with the port group.
What is the default number of ports configured with the Virtual Switch?
When the time of Virtual switch created, Vswitch is created with 56 ports by default. We can extend the no of ports by editing the vswitch properties.

What are the different types of Partitions in ESX server?
/ -root
Swap
/var
/Var/core
/opt
/home
/tmp
What are the security options available for ESX vswitch?
Promiscuous Mode – Reject
MAC Address changes – Accept
Forged Transmits – Accept
What is Promiscuous Mode ?
If the promiscuous mode set to Accept, all the communication is visible to all the virtual machines, in other words all the packets are sent to all the ports on vSwitch. It can be useful when you are running virtual machines with network sniffers to capture packet in that network.

What is MAC Address changes?
All the virtual machines nics are provide with the MAC address at the time of creation and it is stored in .VMX file. If the packet  doesn’t match with the MAC address as same as in the .VMX  file , it does not allow incoming traffic to the VM by setting this option as reject.
If it is set as Accept,ESX accepts requests to change the effective MAC address to other than the MAC address save din the .VMX file.

What is Forged Transmits ?
Which is same as the Mac Address changes setting but it worked for the outgoing traffic but the MAC address changes setting is for incoming traffic.
What is a VLAN ?
A VLAN is the Virtual LAN which is used to broke down the Broadcast traffic into many logical groups. Basically, one physical switch comprise of one broadcast domain. VLAN used to separate the one broadcast domain into many small pieces to separate the networks within the broadcast domain.

What are the types of VLAN tagging in Vsphere?
There are 3 types of VLAN tagging available in Vsphere.
1.Virtual Switch Tagging (VST)
2.External Switch Tagging (EST)
3.Virtual Guest Tagging (VGT)
What is VST , EST & VGT?
Please refer my blog post on VST , EST & VGT .
What are the Traffic Shaping policies available in the Vswitch?
Traffic shaping policies are disabled by default. There are 3 different traffic shaping policy setting
Average Bandwidth
Peak Bandwidth
Burst Size
Average Bandwidth is defined in KBPS
Peak bandwidth is defined in KBPS
Burst Size is defined in Kilobytes
What are the Load balancing policies available in vswitch?
Route based on the originating virtual switch port ID
Route based on source MAC hash
Route based on IP hash
Route based on the originating virtual switch port ID – Chooses an uplink based on the virtual port where the traffic entered the virtual switch.  The traffic will be always send with that same uplink until that particular uplink is failed and failed over to another NIC.
Route based on source MAC hash – Choose an uplink based on a hash of the source Ethernet MAC address.The traffic will be always send with that same uplink until that particular uplink is failed and failed over to another NIC.
Route based on IP hash – Choose an uplink based on a hash of the source and destination IP addresses of each packet.

What are the  types for Network Failover Detection settings?
Link Status only
Beacon Probing
Link Status only – Relies solely on the link status provided by the network adapter. This detects failures, such as cable pulls and physical switch power failures, but it cannot detect configuration errors, such as a physical switch port being blocked by spanning tree or misconfigured to the wrong VLAN or cable pulls on the other side of a physical switch.
Beacon Probing –  Sends out and listens for beacon probes — Ethernet broadcast frames sent by physical adapters to detect upstream network connection failures — on all physical Ethernet adapters in the team. In addition to link status, to determine link failure. This detects many of the failures which are not detected by Link Status.

What is the command to  check the IP address along with the detailed network cards assigned to the esx server?
Ifconfig -a
Output appears like this
========================================================================
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:9365 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9365 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8127714 (7.7 MiB)  TX bytes:8127714 (7.7 MiB)
vmnic0    Link encap:Ethernet  HWaddr 00:0C:29:85:0D:76
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:100772 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5103 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:35475848 (33.8 MiB)  TX bytes:402120 (392.6 KiB)
          Interrupt:145
vmnic1    Link encap:Ethernet  HWaddr 00:0C:29:85:0D:80
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:105895 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:35894203 (34.2 MiB)  TX bytes:0 (0.0 b)
          Interrupt:129
vmnic2    Link encap:Ethernet  HWaddr 00:0C:29:85:0D:8A
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:105908 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:35895750 (34.2 MiB)  TX bytes:0 (0.0 b)
          Interrupt:137
vmnic3    Link encap:Ethernet  HWaddr 00:0C:29:85:0D:94
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:105690 errors:0 dropped:0 overruns:0 frame:0
          TX packets:228 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:35883279 (34.2 MiB)  TX bytes:13680 (13.3 KiB)
          Interrupt:145
vswif0    Link encap:Ethernet  HWaddr 00:50:56:4D:69:D1
          inet addr:192.168.0.75  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14893 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2575 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:966513 (943.8 KiB)  TX bytes:230028 (224.6 KiB)
vswif1    Link encap:Ethernet  HWaddr 00:50:56:4F:45:B1
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:11042 errors:0 dropped:0 overruns:0 frame:0
          TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:717158 (700.3 KiB)  TX bytes:1260 (1.2 KiB)
=========================================================================
You can use “ip addr” command also to view the ip information
=========================================================================
[root@ESXTEST1 etc]# ip addr
1: lo: mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
2: vmnic0: mtu 1500 qdisc noop qlen 1000
    link/ether 00:0c:29:85:0d:76 brd ff:ff:ff:ff:ff:ff
3: vmnic1: mtu 1500 qdisc noop qlen 1000
    link/ether 00:0c:29:85:0d:80 brd ff:ff:ff:ff:ff:ff
4: vmnic2: mtu 1500 qdisc noop qlen 1000
    link/ether 00:0c:29:85:0d:8a brd ff:ff:ff:ff:ff:ff
5: vmnic3: mtu 1500 qdisc noop qlen 1000
    link/ether 00:0c:29:85:0d:94 brd ff:ff:ff:ff:ff:ff
6: vswif0: mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:50:56:4d:69:d1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.75/24 brd 192.168.0.255 scope global vswif0
7: vswif1: mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:50:56:4f:45:b1 brd ff:ff:ff:ff:ff:ff
9: vswif2: mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:50:56:43:92:be brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.96/24 brd 192.168.0.255 scope global vswif2
=========================================================================
what is the command to check the ESX vswitch details, port group and its ip address?
Esxcfg-vswitch -l
Outuput will appear like this:
=========================================================================
[root@ESXTEST1 ~]# esxcfg-vswitch -l
Switch Name    Num Ports   Used Ports  Configured Ports  MTU     Uplinks
vSwitch0       32          4           32                1500    vmnic0
  PortGroup Name      VLAN ID  Used Ports  Uplinks
  Service Console     0        1           vmnic0
  VMkernel            0        1           vmnic0
Switch Name    Num Ports   Used Ports  Configured Ports  MTU     Uplinks
vSwitch1       64          3           64                1500    vmnic2,vmnic1
  PortGroup Name      VLAN ID  Used Ports  Uplinks
  VM-10.0.0 subnet    0        0           vmnic2,vmnic1
  VM-192.168.0 subnet 0        0           vmnic2,vmnic1
Switch Name    Num Ports   Used Ports  Configured Ports  MTU     Uplinks
vSwitch2       64          4           64                1500    vmnic3
  PortGroup Name      VLAN ID  Used Ports  Uplinks
  Service Console 2   0        1           vmnic3
  Vmotion             0        1           vmnic3
=========================================================================
From the above output,
we come to know that we have 3 virtual switches named vSwitch0,vSwitch1 and vSwitch2.
4 uplinks (physical nics in our esx server) Vmnic0,vmnic1,vmnic2,vmnic3.
vswitch0 constains 2 port group (Service Console & VMKernel), vSwitch1 contains 2 virtual machine port group (VM-10.0.0 subnet & VM-192.168.0 subnet) and Vswitch2 contains 2 port group (Service Console 2 & Vmotion) port group.
What is command to get the information about Service console ports and its IP address assigned to it?
esxcfg-vswif -l
Output will appear like this:
=========================================================================
[root@ESXTEST1 ~]# esxcfg-vswif -l
Name     Port Group/DVPort   IP Family IP Address                              Netmask                                 Broadcast        Enabled   TYPE
vswif0   Service Console     IPv4      192.168.0.75                            255.255.255.0                           192.168.0.255    true      STATIC
vswif1   Service Console 2   IPv4      192.168.0.78                            255.255.255.0                           192.168.0.255    false     STATIC
=========================================================================
what is the command to get the information about vmkernel ports and its ip address?
esxcfg-vmknic -l
Output will appear like this:
=========================================================================
[root@ESXTEST1 ~]# esxcfg-vmknic -l
Interface  Port Group/DVPort   IP Family IP Address                              Netmask         Broadcast       MAC Address       MTU     TSO MSS   Enabled Type
vmk0       VMkernel            IPv4      192.168.0.110                           255.255.255.0   192.168.0.255   00:50:56:78:7e:73 1500    65535     true    STATIC
vmk1       Vmotion             IPv4      192.168.0.77                            255.255.255.0   192.168.0.255   00:50:56:76:42:df 1500    65535     true    S
=========================================================================

what is the command to get the information about physical nics installed on ESX server?
esxcfg-vmknic -l
Output will appear like this:
=========================================================================
[root@ESXTEST1 sbin]# esxcfg-nics -l
Name    PCI      Driver      Link Speed     Duplex MAC Address       MTU    Description
vmnic0  02:00.00 e1000       Up   1000Mbps  Full   00:0c:29:85:0d:76 1500   Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
vmnic1  02:02.00 e1000       Up   1000Mbps  Full   00:0c:29:85:0d:80 1500   Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
vmnic2  02:03.00 e1000       Up   1000Mbps  Full   00:0c:29:85:0d:8a 1500   Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
vmnic3  02:04.00 e1000       Up   1000Mbps  Full   00:0c:29:85:0d:94 1500   Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
========================================================================
What is command to add the new virtual switch named (vswitch3) to our ESX server?
[root@ESXTEST1 sbin]# esxcfg-vswitch -a vswitch3
Now vswitch3 is created without any port group.
======================================================================
Switch Name    Num Ports   Used Ports  Configured Ports  MTU     Uplinks
vswitch3       64          1           64                1500
  PortGroup Name      VLAN ID  Used Ports  Uplinks
========================================================================
What is command to add the new port group  named (mgmt)to vswitch (vswitch 3) ?
[root@ESXTEST1 sbin]# esxcfg-vswitch -A mgmt vswitch3
now port group “mgmt” is added.
=========================================================================
Switch Name    Num Ports   Used Ports  Configured Ports  MTU     Uplinks
vswitch3       64          1           64                1500
  PortGroup Name      VLAN ID  Used Ports  Uplinks
  mgmt                0        0
=========================================================================

How to add the service console port (vswif2) to our newly created port group “mgmt” with the ip addr 192.168.0.79 ?
[root@ESXTEST1 sbin]# esxcfg-vswif -a vswif2 -i 192.168.0.79 -n 255.255.255.0 -p “mgmt”
where i is the ip address, n is subnet mask p is to mentione the port group name
=========================================================================
vswif2   mgmt                IPv4      192.168.0.79                            255.255.255.0                           192.168.0.255    true      STATIC
=========================================================================
 How to add the vmkernal port (vmk2)  to our newly created port group “mgmt” with the ip addr 192.168.0.83?
[root@ESXTEST1 sbin]# esxcfg-vmknic -a  -i 192.168.0.83 -n 255.255.255.0 -p “mgmt”
=========================================================================
vmk2       mgmt                IPv4      192.168.0.83               255.255.255.0   192.168.0.255   00:50:56:7b:bd:36 1500    65535     true    STATIC
=========================================================================
How to change the ip addresss of the existing service console “vswif2″?
nano /etc/sysconfig/network-scripts/ifcfg-vswif2.
Edit the file with your new id address ” 192.168.0.255″ then save and exit.
======================================================
DEVICE=vswif2
HOTPLUG=yes
MACADDR=00:50:56:43:92:be
ONBOOT=yes
PORTGROUP=mgmt
BOOTPROTO=static
BROADCAST=192.168.0.255
DHCPV6C=no
IPADDR=192.168.0.96
IPV6INIT=no
IPV6_AUTOCONF=no
NETMASK=255.255.255.0
======================================================
restart the network service for ip change to take effect:
[root@ESXTEST1 sysconfig]# service network restart
Shutting down interface vswif0:                            [  OK  ]
Shutting down interface vswif2:                            [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface vswif0:                              [  OK  ]
Another way is to connect to the console of the ESX server and at the shell prompt type in :esxcfg-vswif -d vswif2
This will delete the existing vswif0 and it will give the message about “nothing to flush”.
then type the below command
esxcfg-vswif -a vswif2 -p mgmt -i 192.168.0.97 -n 255.255.255.0
=========================================================================
[root@ESXTEST1 etc]# esxcfg-vswif -d vswif2
Nothing to flush.
[root@ESXTEST1 etc]# esxcfg-vswif -a vswif2 -p mgmt -i 192.168.0.97 -n 255.255.255.0
[2011-09-17 19:35:46 'Vnic' warning] Generated New MAC address, 00:50:56:43:92:be for vswif2
Nothing to flush.
=========================================================================
How to change  the  ESX host name and default gateway?
edit the below file:
nano  /etc/sysconfig/network
======================================
NETWORKING=yes
HOSTNAME=ESXTEST1.lab.com
GATEWAY=192.168.0.20
GATEWAYDEV=vswif0
IPV6_AUTOCONF=no
NETWORKING_IPV6=no
======================================
restart the network service for ip change to take effect:
[root@ESXTEST1 sysconfig]# service network restart
 How to edit the  ESX host file ?
nano /etc/hosts
Edit the file to make entry to your host file.
==========================================
127.0.0.1       localhost
::1             localhost
192.168.0.75    ESXTEST1.lab.com ESXTEST1
==========================================
How to edit the DNS entry of your ESX server?
nano /etc/resolv.conf
Edit the file to make changes or to make new entry of dns for your ESX server
========================
nameserver 192.168.0.20
search lab.com
=======================
 what is the command to query the firewall ports ?
esxcfg-firewall – q
How  to open the port in firewall  (port no 8877, tcp, incoming , name: test3 ?
esxcfg-firewall -o 8877,tcp,in,test3

Tuesday, January 27, 2015

VMware vCenter 5.5 – You do not have permission to login to the server

Permission error

To get domain credentials to work you need to login to the VMware vSphere Web Client and setup the relevant permissions.
So how to login to vCenter using web client if domain users are not allowed?
Well that will be the one you configured when you installed vCenter and known as the vCenter Single Sign on.
Install SSO
From my case the login would be administrator@vsphere.local and the password would be what I entered. Insert these details into the VMware vSphere Web Client and click Login.
login
Once logged in you will see the vCenter Home.
Click on vCenter on the left hand side , Then click on vCenter Servers
vCenterserver
Click on your vCenter server on the left. Then click manage on the right.
Click on the permissions button
permission
Then add your relevant groups / users who you want to administrate your ESXi hosts.
add_user
Set the privileges to the user
 user_role
 Now you are allowed to login using that particular account to access vCenter Server

Tuesday, January 13, 2015

Veeam Backup Free Edition : Installation , Configuration , backup and restore of VMs in VMWare & Hyper-V


VEEAM Backup free edition supports VMs in VMWare and Hyper-V hosts.

The Veeam Backup utility is " VeeamZIP " and it's so easy to use and no downtime for your VMs (no interrupt to availability of virtual machine) .

You can restore :
                             - Full VM
                             - VM Files
                             - Guest Files

Also you can use the VeemZip to archive the VMs on disk storages.VeeamZip removes "Zero Bytes" blocks ,Swap files and compresses the VM to minimize the size of backup.

VeeamZip encapsulates all the virtual disks and configuration files into a single backup file , you can keep this file even on a removable storage like external hard drive or USB flash memories.
Veeam Backup free edition supports instant file level  recovery to fast access to files and folders stored inside the VM.(in the Paid version you can access the Exchange and Sharepoint files as well)

Veeam Backup free edition also includes " Veeam FastSCP " to manage VMs and host files and it's available for VMWare and HYper-V.
There is no expiration date or no limits for the number of VMs.

Please check this documents in VEEAM site to see all the differences between the free version and the Paid version also see more details about the VEEAM Backup :

Free vs. paid: What’s the difference?
The must-have tool for VMware and Hyper-V

Here is the link to the site to download the free product :

http://www.veeam.com/virtual-machine-backup-solution-free.html

The latest version at the time of writing this post is " 7.0 R2 ".

This is download page for Veeam Backup Free Edition Version 7 :



Free edition doesn't require a License key . However you can enable full functionality of Veeam Backup & Replication by installing a license key and it will be valid for 30 days trial.
Download file is an ISO file and you need to attach it to the machine that you want to install the application on it.

Installation process is too easy , but I will show you all the steps.

First run the setup file :



Click on " Veeam Backup & Replication " to start the installation wizard :


If .NET Framework 4.0 is not installed on your system , click on OK to install it :



After installing .NET Framework 4.0 , click on next to start installing VEEAM :


Accept the license agreement and click on Next to continue :


Because we want to use the free version, we don't need to insert a license file, click on Next to continue :



I have select all the features to install them :


If all the requirements are not installed on your computer (same as mine ;) ) click on Install to deploy missing features:



After installing all the required features, click on Next to continue :



Insert the user credential that has access and rights to the SQL server instance and full control permission on the catalog folder :



I'm not going to create an instance for Veeam backup in my SQL server database (this post is just for training purposes and I don't want to create another database in my SQL server, I/m already using it for lots of other different projects;) ). Then I select the first option to install a new instance of SQL server :


Select different port numbers if you want, I leave the default ports :


Select the location for the "vPower NFS" and "Guest file system catalog" , I leave the default ones (I have more than 20GB free space on C drive ) :


Review all the configurations and when ready click on Install :


Installation process takes few mins, first the SQL server 2008 R2 Express will be installed and after that the Veeam application :



At the end PowerShell SDK for Veeam Backup will be installed :


When installation is done, click on Finish to close the installation wizard :


Open the Veeam Backup & Replication by double click on the icon :



The first step is registering the vCenter or the Hyper-V, click on "Add Server" :



I'm using the VMWare vSphere, then I will select the first option :


Enter the DNS name or IP address of the vCenter and if you like a description :


Select a user credential with administrative privileges :


Wait for few seconds, Veeam will detect the server type :


If everything works fine, Veeam will conect to vCenter successfully , click on Finish to complete adding the vCenter to Veeam :


Click on "View" and then on "Category View" to see the list of all available folders and VMs :



Click on top left button and then select the "Configuration Backup" to check the current settings :



You can't change the Backup Repository location in free version (default backup repository created by Veeam backup during the installation)
You can schedule backups, or see the status of back up jobs.



Let's start to back up one of the VMs . Right click on the name of VM and select VeeamZIP (I want to show you all the available options here , else select "VeeamZIP to C:\Backup" to start the back up process quickly)



Select Destination folder and Compression level , click on OK to start the back up :



It may take lots of time for the backup to be completed , depend on your infrastructure . For sure for me it will take lots of time (using basic devices in my home lab,not fast at all ;) )


Backup completed successfully :


Let's check the size of back up file and see how the compression level worked :

VM size was 36GB and the backup size is almost 15GB



Now to show you the restore process, I'm going to delete this VM , and after that Restore it from Veeam :


Deleted the VM in the VC :


Click the Restore button and browse to select the backup file :


select the VM and click on Restore . You have 5 different options :

- Entire VM (including registration)
- VM hard disks
- VM Files (VMDK,VMX)
- Guest files (Windows)
- Guest files (Other OS)



I select the first option to restore my test VM.
You can restore the VM to the original location or you can select a new location :


Review the summary and click on Finish to start the Restore. (I selected the option to power on the VM after restoring)



Restore completed almost after 30 mins :



VM is up & running in vCenter :


You can check the History for all the jobs done in the Veeam :



Source