Category: Virtualization

Virtualization

Selecting virtual SCSI Controllers for Disks (VMware VM)

Selecting virtual SCSI Controllers for Disks (VMware VM)

Introduction-
To access virtual disks, a virtual machine uses virtual SCSI controllers. Each virtual disk that a virtual machine can access through one of the virtual SCSI controllers resides in the VMFS datastore, NFS-based datastore, or on a raw disk. The choice of SCSI controller does not affect whether your virtual disk is an IDE or SCSI disk.

Following virtual SCSI controllers commonly used…

A) BusLogic
– This was one of the first emulated vSCSI controllers available in the VMware platform.
– No updates and considered as legacy or for backward compatibility…

B) LSI Logic Parallel
– This was the other emulated vSCSI controller available originally in the VMware platform.
– Most operating systems had a driver that supported a queue depth of 32 and it became a very common choice, if not the default
– Default for Windows 2003/Vista and Linux

C) LSI Logic SAS
– This is an evolution of the parallel driver to support a new future facing standard.
– It began to grown popularity when Microsoft required its use for MCSC within Windows 2008 ore newer.
– Default for Windows 2008 or newer
– Linux guests SCSI disk hotplug works better with LSI Logic SAS
– Personally I use this
D) VMware Paravirtual (aka PVSCSI)
– This vSCSI controller is virtualization aware and was been designed to support very high throughput with minimal processing cost and is therefore the most efficient driver.
– In the past, there were issues if it was used with virtual machines that didn’t do a lot of IOPS, but that was resolved in vSphere 4.1.

* PVSCSI and LSI Logic Parallel/SAS are essentially the same when it comes to overall performance capability.
* Total of 4 vSCSI adapters are supported per virtual machine.  To provide the best performance, one should also distribute virtual disk across as many vSCSI adapters as possible
* Why not IDE? – IDE adapter completes one command at a time while SCSI can queue commands. So SCSI adapter is better optimized for parallel performance. Also Maximum of 4 IDE Devices per VM (includes CDROM) but SCSI allows 60 devices.

Thank You,
Arun

Choosing a NIC (Network Adapter) for VM in Vmware ESXi environment

Choosing a NIC (Network Adapter) for VM in Vmware ESXi environment

Introduction-

NIC types available for VM  are depends on VM Hardware version and Guest OS (Operating System). When you configure a virtual machine, you can add network adapters (NICs) and specify the adapter type…

The following NIC types widely used:

E1000 –
Emulated version of the Intel 82545EM Gigabit Ethernet NIC, with drivers available in most newer guest operating systems, including Windows XP and later and Linux versions 2.4.19 and later.

E1000e – This feature emulates a newer model of Intel Gigabit NIC (number 82574) in the virtual hardware. This is known as the “e1000e” vNIC. e1000e is available only on hardware version 8 (and newer) virtual machines in vSphere.

VMXNET2 (Enhanced)

Optimized for performance in a virtual machine and has no physical counterpart. Because operating system vendors do not provide built-in drivers for this card, you must install VMware Tools to have a driver for the VMXNET network adapter available.
Based on the VMXNET adapter but provides high-performance features commonly used on modern networks, such as jumbo frames and hardware offloads. VMXNET 2 (Enhanced) is available only for some guest operating systems on ESX/ESXi 3.5 and later.

VMXNET3

Next generation of a paravirtualized NIC designed for performance. VMXNET 3 offers all the features available in VMXNET 2 and adds several new features, such as multiqueue support (also known as Receive Side Scaling in Windows), IPv6 offloads, and MSI/MSI-X interrupt delivery. VMXNET 3 is not related to VMXNET or VMXNET 2.
– VMXNET 3 is supported only for virtual machines version 7 and later.
– Support 10Gpbs ie 10Gig Network
– Jumbo frame supported

I would suggest to use  “VMXNET3”

Thank you,
Arun

VMware Virtual Machine(VM) Configuration File types

VMware Virtual Machine(VM) Configuration File types

Introduction

When you create VM (Virtual Machine) in VMWare based Virtualization platform. VMware creates  few VM configuration files in  folder with VM name in Datastore (Local Storage or NFS/SAN). Please find the table which describes files types in vmware…

 

File Usage File Description File Format
.vmx .vmname.vmx Virtual machine configuration file. ASCII
.vmxf vmname.vmxf Additional virtual machine configuration files, available, for example, with teamed virtual machines. ASCII
.vmdk vmname.vmdk Virtual disk file. ASCII
.flat.vmdk vmname.flat.vmdk Preallocated virtual disk in binary format. Binary
.vswp vmname.vswp Swap file.
.nvram vmname.nvram or nvram Non-volatile RAM. Stores virtual machine BIOS information.
.vmss vmname.vmss Virtual machine suspend file.
.log vmware.log Virtual machine log file. ASCII
#.log vmware-#.log Old virtual machine log files. # is a number starting with 1. ASCII

 

Thank you,
Arun Bagul

VMware ESXi Commands

VMware ESXi Commands

Introduction

Sometime we need to login to Esxi server to check hardware/networking and performance/stats. Sharing few important ESXi commands..

a)  ESXi NIC List

~ # esxcfg-nics  --list
Name    PCI           Driver      Link Speed    Duplex MAC Address       MTU    Description
vmnic0  0000:01:00.00 tg3   Up   1000Mbps  Full  XX:10:55:DD:CC:XX 1500   Broadcom BCM5720 Gigabit Ethernet
vmnic1  0000:01:00.01 tg3   Up   1000Mbps  Full  XX:10:55:67:CC:XX 1500   Broadcom BCM5720 Gigabit Ethernet
vmnic2  0000:02:00.00 tg3   Up   1000Mbps  Full  XX:10:55:65:CC:YY 1500   Broadcom BCM5720 Gigabit Ethernet
vmnic3  0000:02:00.01 tg3   Up   1000Mbps  Full  XX:10:55:23:CC:00 1500   Broadcom BCM5720 Gigabit Ethernet
~ #
~ # esxcli network ip interface  list
vmk0
Name: vmk0
MAC Address: 24:b6:fd:XX:XX:YY
Enabled: true
Portset: vSwitch0
Portgroup: Management Network
VDS Name: N/A
VDS UUID: N/A
VDS Port: N/A
VDS Connection: -1
MTU: 1500
TSO MSS: 65535
Port ID: 33554438

b)  ESXi Storage/iSCSI stats

~# esxcli storage san iscsi stats get
Adapter: vmhba34
Total Number of Sessions: 20
Total Number of Connections: 20
IO Data Sent: 2647449088
IO Data Received: 107921345640
Command PDUs: 15509582
Read Command PDUs: 12353055
Write Command PDUs: 3156497
Bidirectional Command PDUs: 0
No-data Command PDUs: 30
Response PDUs: 15509582
R2T PDUs: 0
Data-in PDUs: 0
Data-out PDUs: 0
Task Mgmt Request PDUs: 0
Task Mgmt Response PDUs: 0
Login Request PDUs: 20
Login Response PDUs: 20
Text Request PDUs: 0
Text Response PDUs: 0
Logout Request PDUs: 0
Logout Response PDUs: 0
NOP-Out PDUs: 1767885
NOP-In PDUs: 1767885
Async Event PDUs: 0
SNACK PDUs: 0
Reject PDUs: 0
Digest Errors: 0
Timeouts: 0
No Tx Buf Count: 0
No Rx Data Count: 232170
~ #

 

c)  ESXi  ping-

Check connectivity to storage, jumbo frame etc

~ # vmkping  -c 5 -s 8972 192.168.7.243
PING 192.168.7.243 (192.168.7.243): 8972 data bytes
8980 bytes from 192.168.7.243: icmp_seq=0 ttl=64 time=2.104 ms
8980 bytes from 192.168.7.243: icmp_seq=1 ttl=64 time=0.693 ms
8980 bytes from 192.168.7.243: icmp_seq=2 ttl=64 time=0.541 ms

d) VMKernel  VMNIC and Check connectivity with VMKernel Port

~ # esxcfg-vmknic  --list
Interface  Port Group/DVPort   IP Family IP Address     Netmask       Broadcast       MAC Address     MTU   TSO MSS Enabled Type
vmk0       Management Network  IPv4      192.168.7.5    255.255.252.0  192.168.7.255  XX:10:55:23:CC:00 1500  65535  true  STATIC
vmk1       iSCSI Kernel 1      IPv4      192.168.7.55   255.255.252.0  192.168.7.255  XX:10:XX:23:CC:YY 1500  65535  true  STATIC
vmk2       iSCSI Kernel 2      IPv4      192.168.7.155  255.255.252.0  192.168.7.255  00:50:56:XX:65:ZZ 1500  65535  true  STATIC     

~ # vmkping  -c 5 -s 8972 -I vmk1 192.168.7.243
PING 192.168.7.243 (192.168.7.243): 8972 data bytes
8980 bytes from 192.168.7.243: icmp_seq=0 ttl=64 time=0.747 ms
8980 bytes from 192.168.7.243: icmp_seq=1 ttl=64 time=0.481 ms
8980 bytes from 192.168.7.243: icmp_seq=2 ttl=64 time=0.523 ms
8980 bytes from 192.168.7.243: icmp_seq=3 ttl=64 time=0.615 ms
8980 bytes from 192.168.7.243: icmp_seq=4 ttl=64 time=0.504 ms

--- 192.168.7.243 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.481/0.574/0.747 ms
~ #

e) vSwitch list

~ # esxcfg-vswitch --list
Switch Name      Num Ports   Used Ports  Configured Ports  MTU     Uplinks
vSwitch0         128         47          128               1500    vmnic0,vmnic1
PortGroup Name        VLAN ID  Used Ports  Uplinks
NFS                   188      0           vmnic0,vmnic1
DMZ 192.168.X.0/24    1103     13          vmnic0,vmnic1
DMZ 192.168.Y.0/22    1102     22          vmnic0,vmnic1
DMZ 192.168.X.0/24    1101     8           vmnic0,vmnic1
Management Network    1102     1           vmnic0,vmnic1

Switch Name      Num Ports   Used Ports  Configured Ports  MTU     Uplinks
vSwitch1         128         3           128               1500    vmnic2
PortGroup Name        VLAN ID  Used Ports  Uplinks
iSCSI Kernel 1        0        1           vmnic2

Switch Name      Num Ports   Used Ports  Configured Ports  MTU     Uplinks
vSwitch2         128         3           128               1500    vmnic3
PortGroup Name        VLAN ID  Used Ports  Uplinks
iSCSI Kernel 2        0        1           vmnic3
~ #

Thank You,
Arun

Log rotation in VMWare ESXi

Log rotation in VMWare ESXi

Introduction

Last month, while working on ESXi5.1 disconnect issue. we analyzed esxi logs for past 3/4 months. Just sharing information related to ESXi log rotation policy..

/var/log # esxcli system syslog config get
Default Rotation Size: 1024
Default Rotations: 8
Log Output: /scratch/log
Log To Unique Subdirectory: false
Remote Host: <none>
/var/log # cd /scratch/log
/vmfs/volumes/507a011b-acd45a80-9aed-e0db5501b632/log #

 

Thank you,
Arun Bagul

What is Virtualization and Types of Virtualization

What is Virtualization and Types of Virtualization

What is Virtualization and Type of Virtualization?

In general there are different types of virtualization like Memory,CPU, Storage, Hardware and Network virtualization. Howver here we are going to talk about OS virtualization only.

1] What is Hypervisor –

Hardware virtualization or platform virtualization refers to the creation of a virtual machine that acts like a real computer with an operating system. Software executed on these virtual machines is separated from the underlying hardware resources.
The words host and guest are used to distinguish the software that runs on the physical machine from the software that runs on the virtual machine.
The software or firmware that creates a virtual machine on the host hardware is called a hypervisor or Virtual Machine Manager.

2] Type of Virtualization –

a) Para-virtualization –
-Guest OS has to be modified
-VM does not simulate hardware
-Use special API that a modified guest OS must use
-Hypercalls trapped by the Hypervisor and serviced
-Xen, VMWare ESX Server

b) Full-virtualization (Native) –
VM simulates “enough” hardware to allow an unmodified guest OS to be run in
isolation. Same Hardware and CPU/Memory, eg- Vmware,IBM VM family,Parallels,
Xen.
* Full virtualization with Xen Hypervisor requires:
i) Intel processor with the Intel VT extensions, or
ii) AMD processor with the AMD-V extensions, or
iii) an Intel Itanium processor
* Full virtualization with KVM hypervisor requires:
i) Intel processor with the Intel VT and the Intel 64 extensions, or
ii) AMD processor with the AMD-V and the AMD64 extensions

c) Emulation –
-VM emulates/simulates complete hardware
-Unmodified guest OS for a different PC can be run
-VirtualPC for Mac, QEMU

d) OS-level virtualization –
-OS allows multiple secure virtual servers to be run
-Guest OS is the same as the host OS, but appears isolated apps see an
isolated OS. eg: Solaris Containers, BSD Jails, Linux Vserver,OpenVZ and LXC (LinuX Containers)

e) Application level virtualization –
-Application is gives its own copy of components that are not shared
(eg: own registry files, global objects) – VE prevents conflicts, JVM

Thank you,
Arun Bagul

Karesansui – Xen and kernel-based Virtual Machine (KVM) Manager

Karesansui – Xen and kernel-based Virtual Machine (KVM) Manager

Introduction –

Karesansui is the best web based kernel-based Virtual Machine (KVM) and Xen Manager.
Also one of the leading Japanese open source project.

Karesansui has Simple, easy web-based interface. Easy installation. Saves initial cost to use. Free for all.
Supports Xen/Kernel-based Virtual Machine(KVM) hypervisor. Other hypervisors/virtualization support on future plan.


Please refer the project URL for more information-  http://karesansui-project.info/

* How to install –

Please go through the steps as mentioned here- http://karesansui-project.info/wiki/1/En_tutorial

Thank You,
Arun Bagul

Xen virtualization on CentOS linux

Xen virtualization on CentOS linux

Introduction ~

What is Virtualization? ~ virtualization is technique of  running multiple operating system (OS) on same physical hardware at same time.
There are three types of Virtualization technologies

1) Full virtualization –
a) Hardware emulation – KQEMU
b) Binary translation – VirtualBox
c) Classic virtualization – OpenVZ
2) Para-virtualization
3) OS-level virtualization – Linux-VServer and OpenVZ

** Xen is an open-source para-virtualizing virtual machine monitor (VMM), or “hypervisor”,for a variety of processor. Xen can securely execute multiple virtual machines on a single physical system with near native performance.

** Xen Prerequisites –

1) iproute2 package
2) Linux bridge-utils (/sbin/brctl)
3) Linux hotplug system (/sbin/hotplug and related scripts)

Step 1) How to install Xen on Centos ~

[root@arun ~]# yum install xen.i386 xen-devel.i386   xen-libs.i386 libvirt.i386  libvirt-devel.i386  libvirt-python.i386 virt-manager.i386 virt-clone.i386

Step 2) How to install Xen Kernel for Centos ~

[root@arun ~]# yum install kernel-xen.i686  kernel-xen-devel.i686

* Once installation is completed; Please check the CentOS boot loader configuration file ie “/boot/grub/grub.conf”… and make sure that the first boot entry should look like this…

title CentOS (2.6.18-164.15.1.el5xen)
root (hd0,4)
kernel /boot/xen.gz-2.6.18-164.15.1.el5
module /boot/vmlinuz-2.6.18-164.15.1.el5xen ro root=LABEL=/ rhgb quiet
module /boot/initrd-2.6.18-164.15.1.el5xen.img

Step 3) Reboot the system so that system will boot with Xen Kernel….

That’s it Xen infrastructure is installed on CentOS.

[[root@arun ~]# rpm -qa | egrep “xen|virt” | sort
kernel-xen-2.6.18-164.15.1.el5
kernel-xen-devel-2.6.18-164.15.1.el5
libvirt-0.6.3-20.1.el5_4
libvirt-devel-0.6.3-20.1.el5_4
libvirt-python-0.6.3-20.1.el5_4
python-virtinst-0.400.3-5.el5
virt-manager-0.6.1-8.el5
xen-3.0.3-94.el5_4.3
xen-devel-3.0.3-94.el5_4.3
xen-libs-3.0.3-94.el5_4.3
[[root@arun ~]#
Step 4 ) Test Xen setup – make sure that “libvirtd” service is running

Step 5) Install first Guest CentOS –

* Create Disk as file as shown below….

[[root@arun ~]# dd if=/dev/zero  of=/var/xen-disk/centOS.hdd bs=4k seek=2048k count=0
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000191 seconds, 0.0 kB/s
[[root@arun ~]#  mke2fs -j /var/xen-disk/centOS.hdd
mke2fs 1.39 (29-May-2006)
/var/xen-disk/centOS.hdd is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1048576 inodes, 2097152 blocks
104857 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2147483648
64 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[[root@arun ~]# mount -o loop /var/xen-disk/centOS.hdd  /mnt/
[[root@arun ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5              55G   12G   41G  22% /
tmpfs                 829M   12K  829M   1% /dev/shm
/dev/sda2              23G   15G  7.8G  65% /mydata
none                  829M  104K  829M   1% /var/lib/xenstored
/var/xen-disk/centOS.hdd
7.9G  147M  7.4G   2% /mnt
[[root@arun ~]#

* We are going to install guestOS from CD/DVD image so we will export this image via FTP so let us
configure ftp server….

* We have copied Centos CD/DVD in “/home/CentOS5.0/” location….

[root@arun ~]# ls /home/CentOS5.0/
CentOS            RELEASE-NOTES-cz.html  RELEASE-NOTES-fr       RELEASE-NOTES-nl.html     repodata
EULA              RELEASE-NOTES-de       RELEASE-NOTES-fr.html  RELEASE-NOTES-pt          RPM-GPG-KEY-beta
GPL               RELEASE-NOTES-de.html  RELEASE-NOTES-it       RELEASE-NOTES-pt_BR       RPM-GPG-KEY-CentOS-5
images            RELEASE-NOTES-en       RELEASE-NOTES-it.html  RELEASE-NOTES-pt_BR.html  TRANS.TBL
isolinux          RELEASE-NOTES-en.html  RELEASE-NOTES-ja       RELEASE-NOTES-pt.html
NOTES             RELEASE-NOTES-es       RELEASE-NOTES-ja.html  RELEASE-NOTES-ru
RELEASE-NOTES-cz  RELEASE-NOTES-es.html  RELEASE-NOTES-nl       RELEASE-NOTES-ru.html
[root@arun ~]#

* I have changed anonymous FTP home from default one to “/home/CentOS5.0/” Please details below….

[root@arun ~]# grep ftp /etc/passwd
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
[root@arun ~]#  vi /etc/passwd
[root@arun ~]# grep ftp /etc/passwd
ftp:x:14:50:FTP User:/home/CentOS5.0:/sbin/nologin
[root@arun ~]#

* Now, restart FTP server and try to access to ftp with IPaddress assigned to bridge “virbr0”. In my case it is “ftp://192.168.122.1”

* Start installation now using “virt-install”

[root@arun ~]# virt-install –name arunOS –os-type=linux –ram=300 –file /var/xen-disk/centOS.hdd –location ftp://192.168.122.1 –nographics –bridge=virbr0

Starting install…

* Welcome to CentOS

+————–+ Manual TCP/IP Configuration +—————+
|                                                            |
| Enter the IPv4 and/or the IPv6 address and prefix          |
| (address / prefix).  For IPv4, the dotted-quad netmask     |
| or the CIDR-style prefix are acceptable. The gateway and   |
| name server fields must be valid IPv4 or IPv6 addresses.   |
|                                                            |
| IPv4 address: 192.168.122.2___ / 255.255.255.0___          |
| Gateway:      192.168.0.1______________________________    |
| Name Server:  _________________________________________    |
|                                                            |
|            +—-+                      +——+            |
|            | OK |                      | Back |            |
|            +—-+                      +——+            |
|                                                            |
|                                                            |
+————————————————————+

<Tab>/<Alt-Tab> between elements  | <Space> selects | <F12> next screen

* Welcome to CentOS

+—————————–+ Warning +——————————+
|                                                                      |
| /dev/xvda currently has a loop partition layout.  To use this disk   |
| for the installation of CentOS, it must be re-initialized, causing   |
| the loss of ALL DATA on this drive.                                  |
|                                                                      |
| Would you like to format this drive?                                 |
|                                                                      |
|         +————–+                  +————–+           |
|         | Ignore drive |                  | Format drive |           |
|         +————–+                  +————–+           |
|                                                                      |
|                                                                      |
+———————————————————————-+

<Tab>/<Alt-Tab> between elements   |  <Space> selects   |  <F12> next screen

* Welcome to CentOS

+————————-+ Partitioning Type +————————-+
|                                                                       |
|    Installation requires partitioning of your hard drive.  The        |
|    default layout is reasonable for most users.  You can either       |
|    choose to use this or create your own.                             |
|                                                                       |
| Remove all partitions on selected drives and create default layout.   |
| Remove linux partitions on selected drives and create default layout. |
| Use free space on selected drives and create default layout.          |
| Create custom layout.                                                 |
|                                                                       |
|       Which drive(s) do you want to use for this installation?        |
|                              [*] xvda ^                               |
|                                       #                               |
|                                                                       |
|                          +—-+   +——+                            |
|                          | OK |   | Back |                            |
|                          +—-+   +——+                            |
|                                                                       |
|                                                                       |
+———————————————————————–+

<Space>,<+>,<-> selection   |   <F2> Add drive   |   <F12> next screen

* Welcome to CentOS

+—————————-+ Partitioning +—————————-+
|                                                                        |
|      Device        Start    End     Size       Type     Mount Point    |
| /dev/xvda                                                            ^ |
|   Free space            1    1045    8192M  Free space               # |
|                                                                      : |
|                                                                      : |
|                                                                      : |
|                                                                      : |
|                                                                      : |
|                                                                      : |
|                                                                      : |
|                                                                      v |
|                                                                        |
|    +—–+   +——+   +——–+   +——+   +—-+   +——+      |
|    | New |   | Edit |   | Delete |   | RAID |   | OK |   | Back |      |
|    +—–+   +——+   +——–+   +——+   +—-+   +——+      |
|                                                                        |
|                                                                        |
+————————————————————————+

F1-Help     F2-New      F3-Edit   F4-Delete    F5-Reset    F12-OK

* Welcome to CentOS

+—————————-+ Partitioning +—————————-+
|                                                                        |
|      Device        Start    End     Size       Type     Mount Point    |
| /dev/xvda                                                            ^ |
|   xvda1                 1     829    6502M  ext3        /            # |
|   xvda2               830     893     502M  swap                     : |
|   Free space          894    1044    1184M  Free space               : |
|                                                                      : |
|                                                                      : |
|                                                                      : |
|                                                                      : |
|                                                                      : |
|                                                                      v |
|                                                                        |
|    +—–+   +——+   +——–+   +——+   +—-+   +——+      |
|    | New |   | Edit |   | Delete |   | RAID |   | OK |   | Back |      |
|    +—–+   +——+   +——–+   +——+   +—-+   +——+      |
|                                                                        |
|                                                                        |
+————————————————————————+

F1-Help     F2-New      F3-Edit   F4-Delete    F5-Reset    F12-OK


* Same way configure TZ,root password,packages,boot loader options etc…

* Welcome to CentOS

+———————+ Formatting +———————-+
|                                                         |
| Formatting / file system…                             |
|                                                         |
|                           70%                           |
|                                                         |
+———————————————————+

<Tab>/<Alt-Tab> between elements   |  <Space> selects   |  <F12> next screen

That’s it!

Thank you,
Arun Bagul