Warning: sem_get() [function.sem-get]: failed for key 0x152b: Permission denied in /home3/adminsky/public_html/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 98
AdminSky.org » CMD – VMware

Our Sponsors

Linux – vdf (VMware)

vdf is an ESX Server-customized version of the df command. Use vdf in place of the df command. vdf works with all the standard df options.
The listing also shows the total space, amount of space used and percentage of space used for each file system.

vdf -h (with human readable switch)

CMD – VMware – Esxcfg-vswif

This tool can manage the Ethernet interfaces of the service console. In a big change from previous versions of ESX, the Ethernet interface of the service console is named with the “vswif” prefix and not “eth” prefix as you may be used to in Linux.

During installation of ESX server, your service console Ethernet connection should  have been created. However, maybe a mistake was made, or we want to add another service console port for redundancy.

In VI Client we can view the network configuration of our ESX host. Here is an example of a typical network configuration.

vswif0

If we use the esxcfg-vswif tool, we are examining, creating or modifying a service console port. So in the first example here, we are simply listing what ports have been created.

# esxcfg-vswif -l

Name  Port Group            IP Address       Netmask              Broadcast             Enabled    DHCP

vswif0 Service Console 192.168.31.31 255.255.255.0 192.168.31.255 true             false

So the output is showing the same as the graphical output in VI client.

If we wanted to add a 2nd service console port, we could use this command. However, all this command will do is turn a regular portgroup into a service console port and bind an IP address to Linux. So in the following command line example, we create a portgroup first, and then we turn it into a service console port with esxcfg-vswif.

# esxcfg-vswitch –add-pg=”Service Console Backup” vSwitch1
# esxcfg-vswif -a -i 10.10.1.31 -n 255.255.0.0
-p “Service Console Backup” vswif1

[2007-11-21 11:29:18 'Vnic' warning] Generated New MAC address
, 00:50:56:4d:da:97 for vswif1

Nothing to flush.

So now if we run esxcfg-vswif to list the service console ports, we will be able to see the original service console port as well as our new one we just created. We’ve shown you the graphical representation as well from the VI client so you can compare.

# esxcfg-vswif -l

Name Port Group IP Address Netmask Broadcast Enabled DHCP

vswif0 Service Console 192.168.31.31 255.255.255.0 192.168.31.255 true false

vswif1 Service Console Backup 10.10.1.31 255.255.0.0 10.10.255.255 true false

vswif1

A new function was added to esxcfg-vswitch when ESX 3.5 was released at the end of 2007. This version of ESX server was the first to support Ethernet Jumbo Frames. This is where the MTU size is increased beyond the default 1500 bytes. In the following example, we are changing the maximum MTU for vSwitch1.

# esxcfg-vswitch -m 9000 vSwitch1

CMD – VMware – Esxcfg-swiscsi

ESX server 3 supports both hardware and software initiated iSCSI. For hardware iSCSI, we can use host bus adapters which perform the TCP offload and so the VMkernel can just pass SCSI commands to them as normal. The iSCSI hba can then wrap the SCSI command in IP transport and forward them to the iSCSI target.

In VI-3, one of the supported iSCSI hardware HBAs is the QLogic 4052. More information about this particular family of adapters can be found at http://support.qlogic.com/support/product_resources.asp?id=964

In software iSCSI initiator, the wrapping of SCSI commands in IP is performed by the VMkernel and a regular physical network card is used to communicate with the iSCSI target. The software iSCSI configuration is exposed in the VI Client as a host bus adapter called vmhba40 in ESX 3.0.x and is called vmhba32 in ESX 3.5. We can use this command line tool esxcfg-swiscsi to configure the software iSCSI initiator. The software iSCSI initiator in the VMkernel has a dependency upon the service console, therefore both the service console and VMkernel must have an IP route to the iSCSI target. The esxcfg-swiscsi command is not used in isolation, we use it in a sequence of commands to fully configure iSCSI from the service console command line.

1. Add a VMkernel port to a vSwitch that has an uplink and route to iSCSI target
2. Ensure service console IP interface has a route to the same iSCSI target
3. Using either the VI Client security profile or the esxcfg-firewall, open a port in the service console firewall for iSCSI (TCP:3260)
4. In the command line, enable iSCSI with the command esxcfg-swiscsi -e
5. Enable a discovery address with the command vmkiscsi-tool -D -a 10.0.0.99 vmhba32
6. List the targets that were discovered with vmkiscsi-tool -T -l vmhba32
7. Perform a rescan with esxcfg-rescan vmhba32
8. List the iSCSI LUNs with vmkiscsi-tool -L -l vmhba32

If you want to ensure the VI client reflects the changes made at command line, it is best to restart the vmware management service with the command service mgmt-vmware restart

The full list of command line options for this command are:

-e, –enable Enable sw iscsi
-d, –disable Disable sw iscsi
-q, –query Check if sw iscsi is on/off
-s, –scan Scan for disk available through sw iscsi interface
-k, –kill Try to forcibly remove iscsi sw stack
-r, –restore Restore sw iscsi configuration from file (FOR INTERNAL USE ONLY)
-h, –help Show this message

CMD – VMware – Esxcfg-nics

This tool can be used to view and configure the speed and duplex settings of the physical network cards in the ESX Server. This tool can replace the mii-tool and modules.conf for network card management.

In the following example, we run the list option to view all physical NICs and their properties.

[root@esx1host etc]# esxcfg-nics -l

Name   PCI      Driver  Link Speed    Duplex Description
vmnic2 01:01.00 tg3     Up   1000Mbps Full Broadcom Corporation NetXtreme BCM5703 Gigabit Ethernet
vmnic0 01:02.00 tg3     Up   100Mbps  Full Broadcom Corporation NC7781 Gigabit Server Adapter (PCI-X, 10,100,1000-T)
vmnic1 04:02.00 tg3     Up   1000Mbps Full Broadcom Corporation NC7781 Gigabit Server Adapter (PCI-X, 10,100,1000-T)

This command has the following optional parameters:

esxcfg-nics <options> [nic]
-s|–speed <speed> Set the speed of this NIC to one of 10/100/1000/10000. Requires a NIC parameter.
-d|–duplex <duplex> Set the duplex of this NIC to one of ‘full’ or ‘half’. Requires a NIC parameter.
-a|–auto Set speed and duplexity automatically. Requires a NIC parameter.
-l|–list Print the list of NICs and their settings.
-r|–restore Restore the nics configured speed/duplex settings (INTERNAL ONLY)
-h|–help Display this message.

CMD – VMware – Esxcfg-linuxnet

There is not normally a command that a virtual infrastructure administrator should need. The tool is automatically used when you start an ESX server in troubleshooting mode; i.e. when you start only the service console Linux kernel and don’t start the VMkernel.

When you are working in the service console while the VMkernel is loaded, the service console’s network interface is not called eth0, but is called vswif0 instead. This is because the service console network interface is provided via a service console portgroup on a virtual Ethernet switch. If you restart your ESX server without the VMkernel, then standard Linux drivers and network card management is used. Therefore the network interface used in troubleshooting mode is called eth0 – just like any other regular Linux box. This tool is called by starting troubleshooting mode to replicate the IP parameters assigned to vswif0 to eth0.

Should you want to investigate this command, the options are:

esxcfg-linuxnet –setup
–remove
-h –help

The –setup option cannot be combined with the –remove option.


Warning: sem_acquire(): supplied argument is not a valid SysV semaphore resource in /home3/adminsky/public_html/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 107

Warning: sem_release(): supplied argument is not a valid SysV semaphore resource in /home3/adminsky/public_html/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 116