Tuesday, September 28, 2010

How to Resolve VC Service Problem - VC data base limit 4 GB




Posting this with the permission of my colleague Mike


Problem:
Surface Problems:
No clients can connect to the Virtual Center; error usually states a problem with “remote computer”. The remote computer is the virtual center server. Upon checking the virtual center server, you should notice that the “VMWare virtual center server” service is not running. The Virtual Center service will not start. It repeatedly stops after attempting to start the service manually or after reboot (automatically).

Root Problem:
The Virtual Center Database was at the 4GB limit.






The first error I noticed was the “unexpectedly shutdown error” (first error shown above). After digging through the logs you may start to see other errors indicating a database problem.

Resolution:
Use KB article http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1000125
In short, do the following:
Stop services
Backup database
Run script to trim database size
Shrink database
Restart services

Stop/Start Virtual center services:
Log into the virtual center server, go to services and stop/start the VMWare VirtualCenter Server service

Backup Database for Virtual Center
We use MSSQL Express Database for our VC environment.
Open SQL Server Management Studio application; login in with windows authentication (default settings)

Browse to the database being used by Virtual Center – In our case VIM_VCDB



Right Click the DB, select tasks and backup. A backup window will appear:

Ensure that the appropriate DB is selected and that a FULL backup is selected.

Create a name for the backup and note where the backup will be located once complete. Then press OK.

Your backup will run and the progress bar (bottom left corner) will indicate when it is complete. This can take more than 30 minutes.

Run Script to clean up database:

I have downloaded the script on our virtual center server. It is located on the mtalbot desktop. The script can be downloaded from the KB article posted above.

I highly recommend that you watch the video in the KB article! It is short and easy to understand.

In short you need to open the script; it should open in SQL server management studio. YOU MUST CHANGE THE DATABASE TO THE VIRTUAL CENTER DATABASE VIM_VCDB.

Execute the script to get an idea of how many rows will be deleted.

There are two things that need to be adjusted in order to execute the script and delete rows.

1. The “SET @DELETE_DATA = 0 “

a. If set to 0, then no data will be deleted.

b. If set to 1, then data will delete from the DB

2. The “SET @CUTOFF_DATE = GETUTCDATE – 180”

a. Change the number to the amount of days you would like to delete data

b. A suggestion is to delete minimal days and review the size of your database. If you are comfortable with the size of the database, you do not need to delete more days.



Notes about Database and Script:

*SQL Express has a data limit size of 4GB. If our database is approaching or at 4GB this is when we run into this problem. We need to backup database, trim records from db.

*The SQL script will delete tasks, events, and performance data. Simply comment or delete the applicable section of the script if any of these items are not to be purged.

*You can build a new query to monitor the transaction log progress. This will tell you how the log files and space are being updated during the execution of the original script run.

Again, review the video in the KB article for more information.



Shrink Database:

Open SQL Server Management

Browse to the database being used by Virtual Center – In our case VIM_VCDB



Right Click the DB, select tasks, shrink and database.

A window will pop up to allow you to manage the process, review your settings and click OK. Verify you are working with the correct DB. Also, note the size and free space available.



The progress bar in the bottom left corner will let you know when the process is complete.

Once the shrink is complete, restart the server or service for VMWare Virtual Center Server.

Stop/Start Virtual center services:

Log into the virtual center server, go to services and stop/start the VMWare VirtualCenter Server service















Linux memory check script

Please save this with .sh ext and run it ./memmon.sh



#!/bin/bash

# create a memmon.sh script that tracks the current date, memory usage and running processes
echo '#!/bin/bash' > /root/memmon.sh
echo "
date;
uptime
free -m
vmstat 1 5
ps auxf --width=200
" >> /root/memmon.sh

chmod +x /root/memmon.sh

# create a cronjob that runs every few minutes to log the memory usage
echo '0-59/10 * * * * root /root/memmon.sh >> /root/memmon.txt' > /etc/cron.d/memmon
/etc/init.d/cron* restart

# create a logrotate entry so the log file does not get too large
echo '/root/memmon.txt {}' > /etc/logrotate.d/memmon

Thursday, September 16, 2010

EXCHANGE SMTP CONNECTORS

In Exchange Server 2007 there are two receive connectors.
All SMTP mail is routed through a Send connector.

Server to Server SMTP and Client to Server SMTP.

Client---> server SMTP is used for POP3 and IMAP clients to send mail via SMTP.
Client Usage Type will allow the Permission Group of Exchange Users

In Exchange 2007, Microsoft wanted to comply with updated RFC standards and kept Server to Server SMTP communication over port 25 and segregated Client to Server communications over port 587

By default, Client to Server Authentication is encrypted using TLS via this Client Receive Connector

Example:

If you want to allow an anonymous application such as a Web Application to relay off of your Exchange 2007 server, you would do the following:

1. Create a new Receive Connector with the Custom Usage Group
2. For Remote Network Settings, remove 0.0.0.0-255.255.255.255, and then add the IP Address of the remote server that requires relaying permissions
3. Once the new Custom Receive Connector is created, go into the properties of this connector, go to the Permission Groups Tab > Add Anonymous Users


If you look at the Authentication Tab, only Transport Layer Security will be selected. This is called Opportunistic TLS which means that TLS will be accepted and is the preferred method for communication, but TLS will not be required.

To activate Anonymous users to use this connector for relaying, you must issue the following command:
Get-ReceiveConnector “Receive Connector Name” | Add-ADPermission -User “NT AUTHORITY\ANONYMOUS LOGON” -ExtendedRights “Ms-Exch-SMTP-Accept-Any-Recipient”

Tuesday, August 17, 2010

lsof command - whos doing what

lsof will show list of open files

#lsof
[root@rock ~]# lsof | more
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
init 1 root cwd DIR 8,5 4096 2 /
init 1 root rtd DIR 8,5 4096 2 /
init 1 root txt REG 8,5 38620 6422543 /sbin/init
ncftpput 15940 root 3u IPv4 16636687 TCP rock.transfer.my:47940->10.10.10.115:ftp (ESTABLISHED)

Show all open tcp files
#lsof -i TCP


#lsof -i -P | grep sshd

To see list of open files
#lsof -i -U

Wednesday, June 30, 2010

"Paradigm shift” - An Old Story

A Group of Scientist placed 5 monkeys in a cage and in the middle, a ladder with bananas on the top.

Every time a monkey went up the ladder, the scientists soaked the rest of the monkeys with the cold water.

After a while, every time a monkey went up a ladder, the others beat up the one on the ladder.

After some time, no monkeys dare to go up the ladder regardless the temptation.

Scientists then decided to substitute one of the monkeys. The 1st thing this monkey did was to go up the ladder.

Immediately the other monkeys beat him up.

After several beatings, the new member learned not to climb up the ladder even though never know why.

The 2nd monkey was substituted and the same occurred. The 1st monkey participate in beating for the second monkey. Same way all the monkeys were replaced.

What was left was a group of 5 monkeys that even though never received a cold water shower, continued to beat up any monkey who attempted to climb up the ladder.

If it was possible to ask the monkeys why would beat up all those who attempted to go up the ladder ....i bet you the answer would be.....

" I do not know - that's how the things are done around here"

Does this sound familiar .....


Tuesday, June 29, 2010

Law of attraction

I was reading the below blog and it was so true in every way.


http://www.forbes.com/2010/06/28/chinese-billionaire-beijing-leadership-managing-rein.html


What I Learned From A Chinese Billionaire
He taught me the basic principles he relied on to go from grinding poverty to enormous wealth.

n the last decade more new billionaires emerged in China than anywhere else in the world. There are now at least 79 Chinese billionaires. China's rich are fueling the country's 15% annual growth in luxury sales, which have reached $9 billion a year, making the country the world's second largest market for top-end products. You can wait a year for a new Ferrari in China. Porsche launched its Panamera sedan there before it did so in the U.S. Long lines often stretch outside Louis Vuitton and Hermès stores.

Who are the superrich Chinese? What are they like? How did they get so wealthy?
To find answers to those questions I've talked to a half dozen Chinese billionaires. Some of them made their money by taking Internet companies public in the U.S., others by investing in real estate or beverages. Unlike many of today's American billionaires, such as the Rockefellers or the Waltons of Wal-Mart, China's are almost all self-made. Half of the world's 14 self-made billionaire women are Chinese. They all overcame hardship and failure, and they all are highly optimistic about China's future.

One Chinese billionaire, a real estate mogul, met with me more than a dozen times over five years to share his lessons for succeeding in business. Sometimes we met at his palatial home in Beijing, sometimes at my much smaller one in Shanghai. We ate clams the size of footballs on a beach in Australia, and one time we went to McDonald's for french fries. I liked spending time with him not only because I could briefly live the life of a billionaire but also because it became obvious why he was so successful. He actually embodied the lessons he taught me. He didn't just preach them.

There was one condition to our talks and my writing about him, though. He insisted on remaining anonymous. Therefore I will call him Mr. Chen. Like many wealthy Chinese, Mr. Chen prefers to fly under the radar, because he doesn't want to accidentally get on anyone's wrong side. Lest you think his fears are exaggerated, realize that 70 of the people who have appeared on the Forbes China Rich List in the last decade have publicly gotten into trouble. China's affluent now sometimes half-jokingly call the ranking the Death List.

Mr. Chen's first lesson is to believe that anything is possible and the only thing that can stop you is yourself. He never ceased to believe that he would make something of himself. As a poor peasant child with no high government connections, he had the odds stacked again him. He had to drop out of school in his teens because his family had no money.

Yet he believed in himself and refused to give up. With no powerful family behind him, he had to take out loans at five times the normal rates of his well-connected competitors. He had to do smaller projects that no one else wanted and endure derision and slights from others. Slowly, over time, he developed a reputation for doing what he said he would, and his projects got bigger and bigger.

Now he pays for the food, medical costs and living expenses of more than 80 members of his extended family. He donates millions a year to set up schools in rural areas, and he often walks the halls of hospitals with his offspring and pays for the medical costs of uninsured patients. But before he could do any of that he spent decades in sheer perseverance, ignoring all the better-educated, wealthier people who disdained him.

The second lesson Mr. Chen taught me is that to get what you want you have to respect everyone and sometimes eat humble pie. A decade ago, when nearly everyone in China was poor, it took less than $10 million to make the China rich list. Last year you needed $120 million. The creation of wealth has been staggeringly quick. As Mr. Chen says, you could be a waiter today and the head of a food and beverage conglomerate tomorrow--so you'd better respect everyone, or your attitude may come back to haunt you. Practically everyone in China knows someone who a decade ago raised pigs and today drives a Mercedes and buys Tiffany jewelry.

Finally, Mr. Chen believes in sharing wealth. He lets business partners make more than he does, so that the next time they secure a good deal they'll think of working with him first. He sees no point in ever trying to shortchange business partners.

He is right. I have been in meetings with him with different partners with projects all over the country. I asked several of them why they worked with him rather than anyone else, and every one of them said it was because they knew he'd take a smaller piece of the total pie. But so many small pieces add up to a whole lot of pie.

Mr. Chen believes in sharing wealth also in the sense of ensuring good working conditions for rank-and-file employees and letting the most productive ones get rich. He does not believe in letting lieutenants scrape by while a CEO is paid absurd sums. And he believes that companies like Apple and Dell need to improve the conditions at the factories where they source their products.

Mr. Chen built a fortune out of dogged determination and a reputation for being assiduously honest, fair and respectful. He sees no reason why the same shouldn't work for anyone else. As he told me once, "If I can do it with as little as I had growing up, anyone can do it."

Wednesday, May 26, 2010

Steps towards Green IT

1) What are the Green initiatives that have been taken within your company?

- We shut down the desktop after office hours and during weekends, direct result is 60% reduction in electricity bill.

- Optimizing windows start up time

- We are using thin client technology for desktops machine which are critical, they are more energy efficient and also easy to mange.

- AC shut down after 8 PM and during weekends.

- Use of Virtualization technology, we consolidated the servers, any new application/machine deployment is a contender of virtualization, all the legacy machines/application also replaced with virtualization technology, It direct results in lower power consumption.

- We are using SaaS (Software as a Service) model for payroll and HR dept.

- We have migrated our solution to SaaS (Kind of hosting model).

- Migrated the application from SUN servers to Intel based architecture.

- Energy efficient CFL lighting in the office

- Use of TFT/LCD screen instead of old CRT monitors, TFT/LCD are more energy efficient

2) What are the benefits that have resulted from such green initiatives?

- Cost Saving , better ROI , it is major motivating factor

- Reduced carbon foot print , Greener Planet

- Less Hardware (using virtualization and consolidation of servers )

3) What is the road-map for furthering the green agenda, i.e., what other green initiatives is your company intending to take?

- For new IT equipment we are in process for contract with the Hardware vendor for hardware replacement and refresh after its life cycle(in our case it is Dell)

- Every new application should be deployed using Virtualization technology.

- Relocating our office servers to data center colo. It will save cost for us and bigger data centers can afford Green IT Data center. Many times is not feasible for a smaller company to afford green data center (design, build and its operation) in house.

- Dell servers with Intel high-efficiency power supplies, fans and processors to reduce our total watts per server.

- We partner with a company that refurbishes and resells our old server hardware that we can't reuse internally.

Wednesday, May 12, 2010

How to extend the virtual disk size in ESX/VM

1. Power off the VM-1
2. Make clone of this VM -1 , call it VM-2 (for backup , in case you mess with VM-1)
3. From Vsphere client , increase the size of the VM-1 , you can also increase with a command line tool. #vmkfstools -X 40G VM-1.vmdk (-X is the switch for the size that you want the disk file to be , not the size you want to extend).
4. Power down VM-2
5. On Hardware tab add a new existing HDD and point it to the original VM-1.vmdk (the disk we resized few minutes back), mount it as second HDD.
6. Boot VM-2
7. From run menu type “diskpart”, this utility resize disk partition in windows 2k3
8. DISKPART> list volume , will show you the list volume , select your volume that you want to extend.
9. DISKPAER> extend , run this command to finally to extend the HDD size.
10. You can cross check the HDD size in HDD management snapin (mycomputer->manage->Disk Management)
11. Shut down VM-2 and remove the disk we added
12. Power on the VM-1
13. Voila you are back to business

another way of doing this


1. Power off VM
2. Add a blank larger target disk
3. Add a temp disk (formatted NTFS) to hold a ghost or acronis image
4. Boot to Ghost or Acronis CD
5. Image source disk to image on your temp disk
6. Restore temp image to your larger disk
7. dismount your source and temp disks and test a boot
8. If everything goes well then you are done, you can delete your temp and source disks.
9. if something bad happen then you can revert back to your original disk.


Friday, April 30, 2010

Catch infected machines with TCPDUMP

tcpdump -l -n arp | egrep 'arp who-has' | head -100 | awk '{ print $NF }' |sort | uniq -c | sort -n

Friday, January 15, 2010

Squid Made Simple

1. Modify Squid.conf
Open [root@localhost root]# vi /etc/squid/squid.conf
Edit the following entries:
http_access deny all to http_access allow all
After run:
[root@localhost root]# squid -z
Start squid service by:
[root@localhost root]# service squid restart

2. Create a file with any name .... for our example say iptables.sh
# List all hosts allowed --- separate them by single space
HOSTS="x.x.x.x y.y.y.y"

for host in $HOSTS
do
iptables -I FORWARD -s $host -j ACCEPT


iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -s $host -j REDIRECT --to-port 3128
iptables -A INPUT -i eth1 -j ACCEPT
iptables -A OUTPUT -o eth1 -j ACCEPT

iptables -A INPUT -i $host -j ACCEPT
iptables -A OUTPUT -o $host -j ACCEPT

done

save this file and execute
chmod +x iptables.sh
[root@localhost root]# ./iptables.sh
[root@localhost root]# iptables-save
[root@localhost root]# iptables-save > /etc/sysconfig/iptables

3.
[root@localhost root]# vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
4.
[root@localhost root]# service iptables restart
Now configure users Browser for internet.

Friday, November 13, 2009

Troubleshooting SMTP Servers

$ telnet localhost 25
ehlo
mail from: a@b.com
rcpt to: me@mydomain.com
250 2.1.5 Ok
data
.
Subject: SMTP testing
Greetings from me
.
quit
221 2.0.0 Bye
Connection closed by foreign host.

$ telnet localhost 25
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
That means the server is not running, which you can confirm with Netstat:
# netstat -pant|grep :25
If it returns nothing, your SMTP server is not running

Tuesday, October 27, 2009

How to kill remote session via command line

C:\Documents and Settings\datagram>qwinsta /server:10.10.10.x

SESSIONNAME USERNAME ID STATE TYPE DEVICE

console 0 Conn wdcon

rdp-tcp 65536 Listen rdpwd

rdp-tcp#4 datagram 1 Active rdpwd

administrator 2 Disc rdpwd

C:\Documents and Settings\datagram>rwinsta rdp-tcp#4 /server:10.10.10.x


Monday, October 26, 2009

Remotely Start/Stop windows services

Two ways.

1. sc \\"+MachineName+ start+ServiceName

2.
  • To start a service, type:

    net startservice

  • To stop a service, type:

    net stopservice

Sunday, October 25, 2009

Error: Service 'RemoteRegistry' failed to reach status 'Stopped' on this server.

When installing exchange 2007 sp2

In the services manager set Remote Registry to "Disabled" then reboot.
When the workstation has restarted open the services manager and set it to "auto" or "manual" then try the install again.

Saturday, October 24, 2009

attempting to load a 64-bit application however this cpu is not compatible with 64-bit mode

Solution to this problem.

1. Check your server BIOS settings and enable Virtualization.
****** YOU HAVE TO SHUT DOWN YOUR SERVER AND PLUG OUT THE POWER CORD FOR AT LEAST 2 MINUTES TO MAKE THIS SETTING EFFECTIVE.

2.There is no 64bit support for VMI. VMI is not compatible with 64bit guests.
You must disable VMI to power on this 64bit guest operating systems.
To disable VMI:
  1. Choose the virtual machine in VMware Infrastructure Client.
  2. Click Edit Settings > Options > Advanced.
  3. Deselect Paravirtualization.


Tuesday, October 20, 2009

IP/Port Blocking

Q. All machines with IP range 10.10.10.x should have access to Port 80 on
(Machine 10.10.10.xx). and rest all should be blocked.

Ans.
Via IPTABLES

iptables -A INPUT -s 10.10.10.0/24 -p tcp --destination-port 80 -j
ACCEPT
iptables -A INPUT -p tcp --destination-port 80 -j DROP

Via Hosts

in hosts.allow
80: 10.10.10.0/24

in hosts.deny
80: ALL

Wednesday, October 14, 2009

Count Disk Space

To show the size of all sub directories of a specific directory
du -sh /home/*
du /path/to/dir --max-depth=1 | sort -nr
du -sh
df -h /path/to/dir
To show all the 1 level sub directories size
du -sh *
To show the size of specific directory
du -sh /home

Wednesday, September 23, 2009

sudo: sorry, you must have a tty to run sudo

1. visudo
2. comment out # Defaults requiretty
3. it is always better that you block this for a particular user e.g
4.Defaults:backupuser !requiretty


here is the man page for quick reference
http://www.linuxmanpages.com/man5/sudoers.5.php#lbAM

Monday, August 17, 2009

How to use "noatime" option in linux ext3 filesystem for better performance of I/O

use the 'noatime' option:
  • Edit the file '/etc/fstab'
  • Add the option 'noatime', separated with a comma, to the fourth field of every disk based filesystem entry
  • Save the file and reboot (or remount all the filesystems corresponding to the modified entries (using the command: mount -o remount ))


Most Linux desktop and server is hurt by a noticeable IO performance slowdown due
to the constant atime updates, while there's just two or three real users of it:
tmpwatch [which can be configured to use ctime so it's not a big issue]
and some backup tools.
and mail-notify.

Example
proc /proc proc defaults 0 0
none /dev/pts devpts gid=5,mode=620 0 0
/dev/md0 /boot ext3 defaults 0 0
/dev/md1 none swap sw 0 0
/dev/md2 / ext3 defaults,noatime 0 0


Also in addition to this

if you put your swap partition at the beginning of the drive it will give some improvement.
The beginning of the drive is physically located on the outer portion of the cylinder, and the read/write head can cover
much more ground per revolution.
You can check that with /sbin/hdparm -t /dev/sda1 or sda2 etc etc command.

Tuesday, August 11, 2009

DoS-denial attacks

How to Prevent it in linux

Add these lines to the end of /etc/rc.d/rc.local

######## shut some DoS stuff down
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
echo 1 > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts

# increase the SYN backlog queue
echo 2048 > /proc/sys/net/ipv4/tcp_max_syn_backlog
echo 0 > /proc/sys/net/ipv4/tcp_sack
echo 0 > /proc/sys/net/ipv4/tcp_timestamps

echo 64000 > /proc/sys/fs/file-max

ulimit -n 64000


# increase the local port range
echo 1024 65535 > /proc/sys/net/ipv4/ip_local_port_range

# stop source routing
for i in /proc/sys/net/ipv4/conf/*/accept_source_route
do
echo 0 > $i
done

# enable reverse-path filtering
for i in /proc/sys/net/ipv4/conf/*/rp_filter
do
echo 1 > $i
done

##### End

VISUDO

1. Add a user
#useradd -g users admin
#passwd admin

2. #visudo
here insert the below line in the end.
admin ALL=(ALL) NOPASSWD: ALL

with NOPASSWD it will not prompt for admin users password

Now if you want to give permissions to just few services instead of full privilege

1. #visudo
2. admin ALL=(root) NOPASSWD: /etc/init.d/postgresql

Save and Exit as :wq
now
# sudo /etc/init.d/postgresql start
will start the postgresql service without asking your password.

Now if you want to prohibit a users for accessing few services say shell, su,passwd or visudo

admin ALL = ALL, !SHELLS, !SU, !PASSWD, !VISUDO

Monday, August 3, 2009

Folder Access outside document root in apache

Say you have a folder with name "web" under /home

Give permission to that folder with the Apache user and group and under httpd.conf file add the below lines.

“Directories need to be executable by the Apache user, so that Apache can get listings of the files in the directory, and display the documents located in that directory”


Alias /web /home/web

Directory "/home/web">
Options Indexes SymLinksIfOwnerMatch IncludesNoExec
AllowOverride None
Allow from all
Order allow,deny
/Directory>


Thursday, June 11, 2009

restorecond: Will not restore a file with more than one hard link (/etc/resolv.conf) No such file or directory

How to fix this.

(1) rm /etc/sysconfig/networking/profiles/default/resolv.conf
(2) restorcon /etc/resolv.conf
(3) ln -s /etc/resolv.conf /etc/sysconfig/networking/profiles/default/resolv.conf

Actually this is a bug in policycoreutils package and now have been Fixed in policycoreutils-2.0.57-16

https://bugzilla.redhat.com/show_bug.cgi?id=483371

Wednesday, June 10, 2009

How to Start Fedora Directory Server Manually

Go to /opt/fedora-ds
1.[root@vfds fedora-ds]# slapd-vfds/start-slapd
2./start-admin
3./startconsole

give userName and Password here....

Tuesday, June 9, 2009

How to Install VMware-Tools on CentOS 5.3

1. Open the VMware Console
2.Click on VM
3.Select "Install VMware Tools"
4.This will mount the VMware tools to the CD-ROM automatically
5. run "rpm -ivh VMwareTools-6.x.x-xxxx.i386.rpm"
6. Run this script "vmware-config-tools.pl"
7.reboot the machine

Tuesday, June 2, 2009

VMWARE PART -2 : VIRTAUL NETWORKING

• ESX Server Networking
• Virtual Switches
• Virtual Switches and VLANS
• NETWORKING Tools



How virtual machines communicate with rest of the appliance in network.

Why we need virtual networking
==> Each device requires a NIC, this NIC allow a device to communicate with rest of the devices in the network. With the introduction of virtualization in Vmware we have one big host which is physical device and several machines running on that physical host . And in a traditional sense you would need a NIC card for every virtual machine to allow connectivity to rest of the network , and it does not make sense to make 20-30 nic cards for virtual machines and this is where the concept of virtual switch comes into play.

A virtual switch mimics a physical switch except it is a software based and it will have ports in it and these ports can be added or deleted. You can have upto 1016 ports on a virtual switch.

The idea here is to connect one or more physical nic cards to this virtual switch, the virtual switch is server by one or more physical nic cards.

So we connect the VM machines nic with the virtual switch ports and virtual switch gives the connectivity to the outside world via physical NIC.






In the above scenario both vm are connected with the virtual switch and VS is not connected with any physical NIC. So they can talk to each other only and this is perfect for testing only.

Next Scenario




One virtual switch with one physical nic.
As we gave physical connectivity so you can do traffic shaping.

Another scenario




Advantage is redundancy as you have multiple nic card.

One more scenario





NETWORK CONNECTIONS:



There are 3 types of port configuration that can we done on a virtual switch
• Service console
• Vmkernel : vmotion,iscsi, nfs/nas
• Virtual machines

On the same virtual switch you can have one or more port types ,
You can have virtual switch that supports port for the service console and also for vm for example or each virtual switch can have its own port types so all the ports on this virtual switch will only support virtual machines or service console or vmkernel.














Rolling Failover
No:= in the event that a physical nic card goes down and another nic card takes over its place continues production, after the failed nic card comes back online if this setting is sets to NO then the failed nic card that just came online will tackle the existing nic card will take its place and return to the servicing production.
If it is set to
YES: then the failed nic card remains offline even after it recovers from the failure that it experience and it will not take over the currently active nic card until the event another failure happens.

Network Failover Detection:-
Link state only--> if the failure is from switch end then the esx server will not able to know that
Becon Probing--> it will notify the esx that link from switch is down




NETWORKING TOOLS
• Service network restart ---when you want to change the ip address of service console
• Ifconfig --
• Findnic -- able to map the way esx server labels the vm nic to the actual physical nic.
• Mii-tool -- used to configure or modify nic settings from command line stand point from vm