esxcfg-vswitch vSwitch0 -b
shows current status - which is listen
esxcfg-vswitch vSwitch0 -B both
sets esx host to broadcast and listen
use
esxcli network vswitch standard set -c both -v vSwitch0
for esxi5
command to run on the switch:
show lldp info remote-device
thanks to http://rickardnobel.se/vswitch-cdp-with-hp-switches/
Tuesday, 21 May 2013
Friday, 17 May 2013
echo to stdout all the commands in a script
put this at the top of the file
#!/bin/bash -x
for esxi
#!/bin/ash -x
#!/bin/bash -x
for esxi
#!/bin/ash -x
Thursday, 16 May 2013
Wednesday, 15 May 2013
change uplink / nic settings from the command line - esxcfg-nics
esxcfg-nics -l
esxcfg-nics -s 100 -d full vmnic0
esxi5
esxcli network nic set -n vmnic# -S speed -D duplex
esxcfg-nics -s 100 -d full vmnic0
esxi5
esxcli network nic set -n vmnic# -S speed -D duplex
maintenance mode cli
maintenance mode cli esxi4 & 5
vim-cmd hostsvc/maintenance_mode_enter
vim-cmd hostsvc/maintenance_mode_exit
vim-cmd hostsvc/maintenance_mode_enter
vim-cmd hostsvc/maintenance_mode_exit
Wednesday, 8 May 2013
Network/Storage firmware and recommended driver version in ESXi/ESX 4.x and 5.x - VID DID SVID and SDID
KB: 1027206
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1027206
Determining Network/Storage firmware and driver version in ESXi/ESX 4.x and 5.x
******************
EXTRACT for NIC
To determine the recommended driver for the card, we must obtain the Vendor ID (VID), Device ID (DID), Sub-Vendor ID (SVID), and Sub-Device ID (SDID) using the vmkchdev command:
# vmkchdev -l |grep vmnic0
002:01.0 8086:100f 15ad:0750 vmkernel vmnic0
In this example, the values are:
◦VID = 8086
◦DID = 100f
◦SVID = 15ad
◦SDID = 0750
5.You can now search the VMware Compatibility Guide for the Vendor ID (VID), Device ID (DID), Sub-Vendor ID (SVID), and Sub-Device ID (SDID). In some cases, you may need to do a text search to narrow down the particular card.
******************
Resolution
Note: In ESXi 5.x, the swfw.sh command is supplied with the vm-support support bundle collection tool. The swfw.sh command can be used to identify the firmware and driver versions of hardware connected to the host. To run this command, use this path:
# /usr/lib/vmware/vm-support/bin/swfw.sh
Obtaining Host Bus adapter driver and firmware information
To determine the driver and firmware version of a Host Bus Adapter:
•To determine the firmware version of a Host Bus Adapter, see Identifying the firmware of a Qlogic or Emulex FC HBA (1002413).
•To obtain the driver version of a Host Bus Adapter on an ESXi/ESX host:
1.Open a console to the ESXi/ESX host. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807) or Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910).
2.Obtain the driver type that the Host Bus Adapter is currently using:
# esxcfg-scsidevs -a
You see output similar to:
vmhba0 ata_piix link-n/a ide.vmhba0 (0:7.1) Intel Corporation Virtual Machine Chipset
vmhba1 mptspi link-n/a pscsi.vmhba1 (0:16.0) LSI Logic / Symbios Logic LSI Logic Parallel SCSI Controller
vmhba32 ata_piix link-n/a ide.vmhba32 (0:7.1) Intel Corporation Virtual Machine Chipset
Note: The second column shows the driver that is configured for the HBA.
3.To view the driver version in use, run the command:
# vmkload_mod -s HBADriver |grep Version
For example, to check the mptspi driver:
# vmkload_mod -s mptspi |grep Version
Version: Version 4.00.37.00.30vmw, Build: 721907, Interface: 9.0, Built on: May 18 2012
In this example, the driver version is 4.00.37.00.30vmw.
To obtain the driver version for all HBAs in the system with a single command, use:
# for a in $(esxcfg-scsidevs -a |awk '{print $2}') ;do vmkload_mod -s $a |grep -i version ;done
4.To determine the recommended driver for the card, we must obtain the Vendor ID (VID), Device ID (DID), Sub-Vendor ID (SVID), and Sub-Device ID (SDID) using the vmkchdev command:
# vmkchdev -l |grep vmhba1
000:16.0 1000:0030 15ad:1976 vmkernel vmhba1
In this example, the values are:
■VID = 1000
■DID = 0030
■SVID = 15ad
■SDID = 1976
To obtain vendor information for all HBAs in the system using a single command:
# for a in $(esxcfg-scsidevs -a |awk '{print $1}') ;do vmkchdev -l |grep $a ;done
5.You can now search the VMware Compatibility Guide for the Vendor ID (VID), Device ID (DID), Sub-Vendor ID (SVID), and Sub-Device ID (SDID). In some cases, you may need to do a text search to narrow down the particular card.
Note: You can check the ESXi/ESX host version with the command:
# vmware -v
Obtaining Network card driver and firmware information
To determine the version information for a physical network interface card in vSphere ESXi/ESX 4.x and 5.x:
1.Open a console to the ESXi/ESX host. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807) or Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910).
2.Obtain a list of network interface cards and names.
In ESXi/ESX 4.x, run this command:
# esxcfg-nics -l
For example:
# esxcfg-nics -l
Name PCI Driver Link Speed Duplex MAC Address
vmnic0 00:02:04.00 ACME Up 1000Mbps Full 01:23:45:67:89:AB
vmnic1 00:02:05.00 ACME Up 1000Mbps Full 01:23:45:67:78:AC
In ESXi 5.x, run this command:
# esxcli network nic list
3.Use the ethtool -i command to display available information for one of the network interfaces, specifying its name from step 2:
# ethtool -i VMNic_name
For example:
# ethtool -i vmnic0
driver: ACME
version: 1.2.3a-1vmw
firmware-version: 7.8.9
bus-info: 0000:02:04.00
To obtain information from ethtool -i for all network adapters at once, you can run the following command:
for a in $(esxcfg-nics -l|awk '{print $1}'|grep [0-9]) ;do ethtool -i $a;done
4.To determine the recommended driver for the card, we must obtain the Vendor ID (VID), Device ID (DID), Sub-Vendor ID (SVID), and Sub-Device ID (SDID) using the vmkchdev command:
# vmkchdev -l |grep vmnic0
002:01.0 8086:100f 15ad:0750 vmkernel vmnic0
In this example, the values are:
◦VID = 8086
◦DID = 100f
◦SVID = 15ad
◦SDID = 0750
To obtain vendor information for all NICs in the system using a single command:
# for a in $(esxcfg-nics -l |awk '{print $1}' |grep [0-9]) ;do vmkchdev -l |grep $a ;done
5.You can now search the VMware Compatibility Guide for the Vendor ID (VID), Device ID (DID), Sub-Vendor ID (SVID), and Sub-Device ID (SDID). In some cases, you may need to do a text search to narrow down the particular card.
Note: You can check the ESXi/ESX host version with the command:
# vmware -v
6.From both the ESXi/ESX version and the network type, you then know the version of the driver to use. Any driver updates are available on the VMware downloads page.
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1027206
Determining Network/Storage firmware and driver version in ESXi/ESX 4.x and 5.x
******************
EXTRACT for NIC
To determine the recommended driver for the card, we must obtain the Vendor ID (VID), Device ID (DID), Sub-Vendor ID (SVID), and Sub-Device ID (SDID) using the vmkchdev command:
# vmkchdev -l |grep vmnic0
002:01.0 8086:100f 15ad:0750 vmkernel vmnic0
In this example, the values are:
◦VID = 8086
◦DID = 100f
◦SVID = 15ad
◦SDID = 0750
5.You can now search the VMware Compatibility Guide for the Vendor ID (VID), Device ID (DID), Sub-Vendor ID (SVID), and Sub-Device ID (SDID). In some cases, you may need to do a text search to narrow down the particular card.
******************
Resolution
Note: In ESXi 5.x, the swfw.sh command is supplied with the vm-support support bundle collection tool. The swfw.sh command can be used to identify the firmware and driver versions of hardware connected to the host. To run this command, use this path:
# /usr/lib/vmware/vm-support/bin/swfw.sh
Obtaining Host Bus adapter driver and firmware information
To determine the driver and firmware version of a Host Bus Adapter:
•To determine the firmware version of a Host Bus Adapter, see Identifying the firmware of a Qlogic or Emulex FC HBA (1002413).
•To obtain the driver version of a Host Bus Adapter on an ESXi/ESX host:
1.Open a console to the ESXi/ESX host. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807) or Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910).
2.Obtain the driver type that the Host Bus Adapter is currently using:
# esxcfg-scsidevs -a
You see output similar to:
vmhba0 ata_piix link-n/a ide.vmhba0 (0:7.1) Intel Corporation Virtual Machine Chipset
vmhba1 mptspi link-n/a pscsi.vmhba1 (0:16.0) LSI Logic / Symbios Logic LSI Logic Parallel SCSI Controller
vmhba32 ata_piix link-n/a ide.vmhba32 (0:7.1) Intel Corporation Virtual Machine Chipset
Note: The second column shows the driver that is configured for the HBA.
3.To view the driver version in use, run the command:
# vmkload_mod -s HBADriver |grep Version
For example, to check the mptspi driver:
# vmkload_mod -s mptspi |grep Version
Version: Version 4.00.37.00.30vmw, Build: 721907, Interface: 9.0, Built on: May 18 2012
In this example, the driver version is 4.00.37.00.30vmw.
To obtain the driver version for all HBAs in the system with a single command, use:
# for a in $(esxcfg-scsidevs -a |awk '{print $2}') ;do vmkload_mod -s $a |grep -i version ;done
4.To determine the recommended driver for the card, we must obtain the Vendor ID (VID), Device ID (DID), Sub-Vendor ID (SVID), and Sub-Device ID (SDID) using the vmkchdev command:
# vmkchdev -l |grep vmhba1
000:16.0 1000:0030 15ad:1976 vmkernel vmhba1
In this example, the values are:
■VID = 1000
■DID = 0030
■SVID = 15ad
■SDID = 1976
To obtain vendor information for all HBAs in the system using a single command:
# for a in $(esxcfg-scsidevs -a |awk '{print $1}') ;do vmkchdev -l |grep $a ;done
5.You can now search the VMware Compatibility Guide for the Vendor ID (VID), Device ID (DID), Sub-Vendor ID (SVID), and Sub-Device ID (SDID). In some cases, you may need to do a text search to narrow down the particular card.
Note: You can check the ESXi/ESX host version with the command:
# vmware -v
Obtaining Network card driver and firmware information
To determine the version information for a physical network interface card in vSphere ESXi/ESX 4.x and 5.x:
1.Open a console to the ESXi/ESX host. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807) or Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910).
2.Obtain a list of network interface cards and names.
In ESXi/ESX 4.x, run this command:
# esxcfg-nics -l
For example:
# esxcfg-nics -l
Name PCI Driver Link Speed Duplex MAC Address
vmnic0 00:02:04.00 ACME Up 1000Mbps Full 01:23:45:67:89:AB
vmnic1 00:02:05.00 ACME Up 1000Mbps Full 01:23:45:67:78:AC
In ESXi 5.x, run this command:
# esxcli network nic list
3.Use the ethtool -i command to display available information for one of the network interfaces, specifying its name from step 2:
# ethtool -i VMNic_name
For example:
# ethtool -i vmnic0
driver: ACME
version: 1.2.3a-1vmw
firmware-version: 7.8.9
bus-info: 0000:02:04.00
To obtain information from ethtool -i for all network adapters at once, you can run the following command:
for a in $(esxcfg-nics -l|awk '{print $1}'|grep [0-9]) ;do ethtool -i $a;done
4.To determine the recommended driver for the card, we must obtain the Vendor ID (VID), Device ID (DID), Sub-Vendor ID (SVID), and Sub-Device ID (SDID) using the vmkchdev command:
# vmkchdev -l |grep vmnic0
002:01.0 8086:100f 15ad:0750 vmkernel vmnic0
In this example, the values are:
◦VID = 8086
◦DID = 100f
◦SVID = 15ad
◦SDID = 0750
To obtain vendor information for all NICs in the system using a single command:
# for a in $(esxcfg-nics -l |awk '{print $1}' |grep [0-9]) ;do vmkchdev -l |grep $a ;done
5.You can now search the VMware Compatibility Guide for the Vendor ID (VID), Device ID (DID), Sub-Vendor ID (SVID), and Sub-Device ID (SDID). In some cases, you may need to do a text search to narrow down the particular card.
Note: You can check the ESXi/ESX host version with the command:
# vmware -v
6.From both the ESXi/ESX version and the network type, you then know the version of the driver to use. Any driver updates are available on the VMware downloads page.
Friday, 3 May 2013
ESXi4 mount idrac iso and update nic drivers vmkload_mod
Driver versions Before:
~ # vmkload_mod -s bnx2x | grep Version
Version: Version 1.72.54.v41.1, Build: 00000, Interface: ddi_9_1 Built on: May 9 2012
~ #
~ # vmkload_mod -s cnic | grep Version
Version: Version 1.72.50.v41.1, Build: 00000, Interface: ddi_9_1 Built on: May 2 2012
~ # vmkload_mod -s bnx2i | grep Version
Version: Version 2.72.10.v41.2, Build: 00000, Interface: ddi_9_1 Built on: Apr 2 2012
~ # vmkload_mod -s bnx2 | grep Version
Version: Version 2.2.1l.v41.1, Build: 00000, Interface: ddi_9_1 Built on: Apr 19 2012
~ #
Driver versions After:
~ # vmkload_mod -s bnx2x | grep Version
Version: Version 1.74.22.v41.1, Build: 00000, Interface: ddi_9_1 Built on: Dec 20 2012
~ # vmkload_mod -s cnic | grep Version
Version: Version 1.74.04.v41.3, Build: 00000, Interface: ddi_9_1 Built on: Dec 20 2012
~ # vmkload_mod -s bnx2i | grep Version
Version: Version 2.74.07.v41.1, Build: 00000, Interface: ddi_9_1 Built on: Sep 6 2012
~ # vmkload_mod -s bnx2 | grep Version
Version: Version 2.2.3e.v41.1, Build: 00000, Interface: ddi_9_1 Built on: Aug 28 2012
~ #
To update or add drivers on existing ESX installations using esxupdate:
(for ESX only)
1. Power on the ESX host and log into an account with administrator capability.
2. Place the driver CD in the CD-ROM drive of the ESX host.
3. Mount the driver CD.
4. Navigate to <cd mount point>/offline-bundle/ and locate the
<offline-bundle>.zip file.
5. Run the esxupdate command to install drivers using the offline bundle.
esxupdate --bundle=<offline-bundle>.zip update
dev # vmkload_mod iso9660
Module iso9660 loaded successfully
/dev # ls /dev/cdrom
mpx.vmhba40:C0:T0:L0 vml.0005000000766d68626134303a303a30
mpx.vmhba42:C0:T0:L0 vml.0005000000766d68626134323a303a30
/dev # /sbin/vsish -e set /vmkModules/iso9660/mount mpx.vmhba40:C0:T0:L0
VSISHCmdSet():Set failed: Not supported
/dev # /sbin/vsish -e set /vmkModules/iso9660/mount mpx.vmhba42:C0:T0:L0
/dev # ls -al /vmfs/volumes/cdrom
ls: /vmfs/volumes/cdrom: No such file or directory
/dev # ls -al /vmfs/volumes/CDROM
lrwxr-xr-x 1 root root 20 May 3 17:57 /vmfs/volumes/CDROM -> mpx.vmhba42:C0:T0:L0
/dev # cd /vmfs/volumes/CDROM
/vmfs/volumes/mpx.vmhba42:C0:T0:L0 # ls
DOC DRIVERS.XML OFFLINE_ SOURCE TRANS.TBL _RPM
/vmfs/volumes/mpx.vmhba42:C0:T0:L0 # ls
DOC DRIVERS.XML OFFLINE_ SOURCE TRANS.TBL _RPM
/vmfs/volumes/mpx.vmhba42:C0:T0:L0 # cd OFFLINE_/
/vmfs/volumes/mpx.vmhba42:C0:T0:L0/OFFLINE_ # pwd
/vmfs/volumes/CDROM/OFFLINE_
/vmfs/volumes/mpx.vmhba42:C0:T0:L0/OFFLINE_ # esxupdate --bundle=BCM_B000.ZIP update
Unpacking cross_vmware-esx-dr.. ######################################## [100%]
Removing packages :vmware-esx.. ######################################## [100%]
Installing packages :cross_vm.. ######################################## [100%]
Running [vmkmod-install.sh]...
ok.
Running [/sbin/esxcfg-secpolicy -p /etc/vmware/secpolicy]...
ok.
The update completed successfully, but the system needs to be rebooted for the
changes to be effective.
/vmfs/volumes/mpx.vmhba42:C0:T0:L0/OFFLINE_ #
~ # vmkload_mod -s bnx2x | grep Version
Version: Version 1.72.54.v41.1, Build: 00000, Interface: ddi_9_1 Built on: May 9 2012
~ #
~ # vmkload_mod -s cnic | grep Version
Version: Version 1.72.50.v41.1, Build: 00000, Interface: ddi_9_1 Built on: May 2 2012
~ # vmkload_mod -s bnx2i | grep Version
Version: Version 2.72.10.v41.2, Build: 00000, Interface: ddi_9_1 Built on: Apr 2 2012
~ # vmkload_mod -s bnx2 | grep Version
Version: Version 2.2.1l.v41.1, Build: 00000, Interface: ddi_9_1 Built on: Apr 19 2012
~ #
Driver versions After:
~ # vmkload_mod -s bnx2x | grep Version
Version: Version 1.74.22.v41.1, Build: 00000, Interface: ddi_9_1 Built on: Dec 20 2012
~ # vmkload_mod -s cnic | grep Version
Version: Version 1.74.04.v41.3, Build: 00000, Interface: ddi_9_1 Built on: Dec 20 2012
~ # vmkload_mod -s bnx2i | grep Version
Version: Version 2.74.07.v41.1, Build: 00000, Interface: ddi_9_1 Built on: Sep 6 2012
~ # vmkload_mod -s bnx2 | grep Version
Version: Version 2.2.3e.v41.1, Build: 00000, Interface: ddi_9_1 Built on: Aug 28 2012
~ #
To update or add drivers on existing ESX installations using esxupdate:
(for ESX only)
1. Power on the ESX host and log into an account with administrator capability.
2. Place the driver CD in the CD-ROM drive of the ESX host.
3. Mount the driver CD.
4. Navigate to <cd mount point>/offline-bundle/ and locate the
<offline-bundle>.zip file.
5. Run the esxupdate command to install drivers using the offline bundle.
esxupdate --bundle=<offline-bundle>.zip update
dev # vmkload_mod iso9660
Module iso9660 loaded successfully
/dev # ls /dev/cdrom
mpx.vmhba40:C0:T0:L0 vml.0005000000766d68626134303a303a30
mpx.vmhba42:C0:T0:L0 vml.0005000000766d68626134323a303a30
/dev # /sbin/vsish -e set /vmkModules/iso9660/mount mpx.vmhba40:C0:T0:L0
VSISHCmdSet():Set failed: Not supported
/dev # /sbin/vsish -e set /vmkModules/iso9660/mount mpx.vmhba42:C0:T0:L0
/dev # ls -al /vmfs/volumes/cdrom
ls: /vmfs/volumes/cdrom: No such file or directory
/dev # ls -al /vmfs/volumes/CDROM
lrwxr-xr-x 1 root root 20 May 3 17:57 /vmfs/volumes/CDROM -> mpx.vmhba42:C0:T0:L0
/dev # cd /vmfs/volumes/CDROM
/vmfs/volumes/mpx.vmhba42:C0:T0:L0 # ls
DOC DRIVERS.XML OFFLINE_ SOURCE TRANS.TBL _RPM
/vmfs/volumes/mpx.vmhba42:C0:T0:L0 # ls
DOC DRIVERS.XML OFFLINE_ SOURCE TRANS.TBL _RPM
/vmfs/volumes/mpx.vmhba42:C0:T0:L0 # cd OFFLINE_/
/vmfs/volumes/mpx.vmhba42:C0:T0:L0/OFFLINE_ # pwd
/vmfs/volumes/CDROM/OFFLINE_
/vmfs/volumes/mpx.vmhba42:C0:T0:L0/OFFLINE_ # esxupdate --bundle=BCM_B000.ZIP update
Unpacking cross_vmware-esx-dr.. ######################################## [100%]
Removing packages :vmware-esx.. ######################################## [100%]
Installing packages :cross_vm.. ######################################## [100%]
Running [vmkmod-install.sh]...
ok.
Running [/sbin/esxcfg-secpolicy -p /etc/vmware/secpolicy]...
ok.
The update completed successfully, but the system needs to be rebooted for the
changes to be effective.
/vmfs/volumes/mpx.vmhba42:C0:T0:L0/OFFLINE_ #
Subscribe to:
Comments (Atom)