الجمعة، 22 مايو 2009

VMware ESX Server 3 Commands Guide 3

The esxcfg- Commands
 
esxcfg-init
Should not be run manually!
 
esxcfg-nas
The esxcfg-nas command is used to list, mount and dismount NFS exports for the VMkernel. In the first example we list the NFS datastores which the VMkernel has mounted.
[root@esx1host root]# esxcfg-nas -l
NFS01 is /NFS from 100.100.100.253 mounted
In the next example, we add a new VMkernel mount to a remote NFS server. This time we are connecting to the NFS server at IP address 100.100.100.253 and the name of the exported directory is "/Test". We are labelled this NFS mount "NFS02".
[root@esx1host etc]# esxcfg-nas -a -o 100.100.100.253 -s /Test NFS02
Connecting to NAS volume: NFS02
NFS02 created and connected.
Remember that to create a connection to an NFS datastore, the VMkernel needs to have an IP address, as it is the NFS client. We give the VMkernel an IP address by creating a VMkernel port on a virtual Ethernet switch. We can do this at the command line using the command esxcfg-vmknic
 
The command line options for esx are:
esxcfg-nas <options> [<label>]
 -a|--add               Add a new NAS filesystem to /vmfs volumes. Requires --host and --share options.
 -o|--host <host>       Set the host name or ip address for a NAS mount.
 -s|--share <share>     Set the name of the NAS share on the remote system.
 -d|--delete            Unmount and delete a filesystem.
 -l|--list              List the currently mounted NAS file systems.
 -r|--restore           Restore all NAS mounts from the configuration file. (FOR INTERNAL USE ONLY).
 -h|--help              Show this message.
 
esxcfg-route
If we add an IP address to the VMkernel by adding a VMkernel port, then we can fully configure that IP stack by also assigning a default gateway. We can view (no parameters) and set (1st parameter) the VMkernel IP default gateway with the esxcfg-route command as shown here.
[root@esx1host etc]# esxcfg-route
VMkernel default gateway is 100.100.100.254
[root@esx1host etc]# esxcfg-route 100.100.100.1
VMkernel default gateway set to 100.100.100.1
 
esxcfg-vmknic
Used to view and set configure the VMkernel ports on virtual Ethernet switches. A VMkernel port is a special type of port group on a virtual Ethernet switch which is used to assign an IP address to the VMkernel. The VMkernel only needs an IP address for VMotion, software-initiated iSCSI or NFS access.
If you need to create a VMkernel port at the command line, then you need to create a port group first and then enable it as a VMkernel port. This tool does not allow you to enable the VMkernel port for VMotion, you must either use vimsh or the VI client for that.
[root@esx1host root]# esxcfg-vswitch -A VMotion vSwitch0
[root@esx1host root]# esxcfg-vmknic -a -i 100.100.100.121 -n 255.255.255.0 VMotion
The above commands would result in an additional connection to the virtual Ethernet switch, specifically a VMkernel port. The esxcfg-vmknic command has assigned the VMkernel an IP address & the portgroup called VMotion is now explicitly VMkernel port.
 
In the following example, we list the VMkernel ports, then use esxcfg-vmknic to delete one of them and then list them again.
[root@esx1host etc]# esxcfg-vmknic -l
Port Group          IP Address      Netmask         Broadcast       MAC Address       MTU     Enabled
NFS access          100.100.100.21  255.255.255.0   100.100.100.255 00:50:56:62:ca:f6 1514    true
VMotion             100.100.100.121 255.255.255.0   100.100.100.255 00:50:56:6d:7c:7d 1514    true
[root@esx1host etc]# esxcfg-vmknic -d VMotion
[root@esx1host etc]# esxcfg-vmknic -l
Port Group          IP Address      Netmask         Broadcast       MAC Address       MTU     Enabled
NFS access          100.100.100.21  255.255.255.0   100.100.100.255 00:50:56:62:ca:f6 1514    true
 
The command line options are:
esxcfg-vmknic <options> [[<portgroup>]]
-a|--add                  Add a VMkernel NIC to the system, requires IP parameters and portgroup name.
-d|--del                  Delete VMkernel NIC on given portgroup.
-e|--enable               Enable the given NIC if disabled.
-D|--disable              Disable the given NIC if enabled.
-l|--list                 List VMkernel NICs.
-i|--ip <X.X.X.X>         The IP address for this VMkernel NIC. Setting an IP address requires that the
                          --netmask option be given in same command.
-n|--netmask <X.X.X.X>    The IP netmask for this VMkernel NIC. Setting the IP netmask requires that the --ip
                          option be given in the same command.
-r|--restore              Restore VMkernel TCP/IP interfaces from Configuration file (FOR INTERNAL USE ONLY).
-h|--help Show this message.

esxcfg-dumppart
Used to configure the VMkernel crash dump partition. The old ESX 2.x utility for this function (vmkdump) is still present on an ESX 3 server, but appears just to be for extracting dump files.
So far, we have only used this utility to interrogate ESX hosts to determine where the dump partition has been created. Here is an example of viewing the dump partition.
# esxcfg-dumppart -l VM Kernel Name      Console Name        Is Active   Is Configured vmhba0:0:0:7        /dev/cciss/c0d0p7   yes         yes
Remember that the dump partition does not show up when you run the vdf utility. However it is visible if you run fdisk. In the following example, we are running fdisk to view the partitions. We can see the dump partition as c0d0p7, i.e. partition #7. Notice the Id of that partition is "fc", the custom partition type for VMkernel dump partitions.
# fdisk /dev/cciss/c0d0

Disk /dev/cciss/c0d0: 36.3 GB, 36385505280 bytes
64 heads, 32 sectors/track, 34699 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
           Device Boot    Start       End    Blocks   Id  System /dev/cciss/c0d0p1   *         1       100    102384   83  Linux /dev/cciss/c0d0p2           101      5100   5120000   83  Linux /dev/cciss/c0d0p3          5101      7100   2048000   83  Linux /dev/cciss/c0d0p4          7101     34699  28261376    f  Win95 Ext'd (LBA) /dev/cciss/c0d0p5          7101      7644    557040   82  Linux swap /dev/cciss/c0d0p6          7645     34599  27601904   fb  Unknown /dev/cciss/c0d0p7         34600     34699    102384   fc  Unknown
The command line options are:
esxcfg-dumppart <options> [<partition>]
-l|--list            List the partitions available for Dump Partitions. WARNING: This will scan all LUNs on the system.
-t|--get-active      Get the active Dump Partition for this system, returns the internal name of the partition
                     vmhbaX:X:X:X) or 'none'.
-c|--get-config      Get the configured Dump Partition for this system, returns the internal name of the partition
                     vmhbaX:X:X:X) or 'none'.
-s|--set             Set the Dump Partition for this system and activate it, either vmhbaX:X:X:X or 'none' to
                     deactivate the active dump partition.
-f|--find            Find usable Dump partitions and list in order of preference.
-S|--smart-activate  Activate the configured dump partition or find the first appropriate partition and use it(same
                     order as -f).
-a|--activate        Activate the configured dump partition.
-d|--deactivate      Deactivate the active dump partition.
-h|--help            Show this message.

 
 
 
 
 
 
 


check out the rest of the Windows Live™. More than mail–Windows Live™ goes way beyond your inbox. More than messages

ليست هناك تعليقات: