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

VMware ESX Server 3 Commands Guide

If you are using ESX server 2.x, you can click here for the command line guide to ESX 2.x
 
The esxcfg- Commands
 
esxcfg-
There are a new set of command line tools in ESX 3.x which all start with "esxcfg-". These tools are used to configure each part of the ESX 3.x configuration. For example, esxcfg-firewall is used to manage the service console firewall while the esxcfg-nic is used to manage the physical Ethernet adapters present in the server.
 
esxcfg-advcfg
The esxcfg-advcfg command is interesting as there is not a huge amount of help about this command. However, we can figure out that it is meant to do advanced configuration and we can figure out some settings that can be made. The -g switch is used to "get" settings; the -s switch is used to "set" settings.
Here are a few examples of some VMkernel parameters which can be interrogated.
[root@esx1host vmware]# esxcfg-advcfg -g /Misc/BlueScreenTimeout
Value of BlueScreenTimeout is 0
[root@esx1host vmware]# esxcfg-advcfg -g /Misc/HostName
Value of HostName is esx1.vmlab.net 
[root@esx1host vmware]# esxcfg-advcfg -g /VMFS3/ZeroedThickVirtualDisks
Value of ZeroedThickVirtualDisks is 1
[root@esx1host vmware]# esxcfg-advcfg –g /Disk/SupportSparseLUN
Value of SupportSparseLUN is 1
[root@esx1host vmware]# esxcfg-advcfg –g /Disk/MaxLUN
Value of MaxLUN is
[root@esx1host vmware]# esxcfg-advcfg –g /Scsi/ConflictRetries
Value of ConflictRetries is
[root@esx1host vmware]# esxcfg-advcfg –g /LVM/EnableResignature
Value of EnableResignature is
The question is, how much is configurable? To figure out what is configurable, we recommend that you look in the directory /proc/vmware/config which you will find in the service console command line and then you will see the following directories
BufferCache
Cpu
Disk
FileSystem
Irq
LVM
Mem
Migrate
Misc
Net
NFS
Numa
Scsi
User
VMFS3
From these directories and the files within, you can work out the paths to be supplied to the esxcfg-advcfg command as parameters. Alternatively, you could also use the command
esxcfg-info –o
to list the advanced options.
When using the esxcfg-advcfg command, remember case sensitivity!
Usage: esxcfg-advcfg <options> [<adv cfg Path>]
 -g|--get             Get the value of the config option
 -s|--set <value>     Set the value of the config option
 -d|--default         Reset Config option to default
 -q|--quiet           Suppress output
 -k|--set-kernel      Set a VMkernel load time option value.
 -j|--get-kernel      Get a VMkernel load time option value.
 -h|--help            Show this message.
 -r|--restore         Restore all advanced options from the configuration file. (FOR INTERNAL USE ONLY).
 
esxcfg-firewall
The service console in ESX 3 now has a firewall enabled by default. The network packet filtering found in Red Hat Linux is called iptables. As the management of iptables is not entirely straightforward, the esxcfg-firewall command makes things a load easier.
We use this command to view and configure the firewall rules.
The most popular switch will be the -q switch to query the firewall for its settings.
[root@esxhost1 root]# esxcfg-firewall -q
<output>
The -s switch will allow you to enable or disable network services that may traverse the firewall successfully. The list of known services are shown below - very case sensitive!....
nfsClient
ftpServer
ntpClient
dellom
nisClient
vncServer
tmpLicenseClient
swISCSIClient
CIMHttpsServer
sshClient
snmpd
tmpAAMClient
vpxHeartbeats
smbClient
hpim
tmpHostVmdbServer
tmpHostdSOAPServer
ftpClient
sshServer
ibmdirector
CIMHttpServer
telnetClient
The -l switch loads the firewall and enables the IP tables.
The -u switch unloads the firewall and disables the IP tables.
We use the -e switch to enable a particular known service, so if we wanted to enable ssh outbound connections from the service console we would simply enter
[root@esxhost1 root]# esxcfg-firewall -e sshClient
We use the -d switch to disable a service. In the following example, we prevent outbound connections
[root@esxhost1 root]# esxcfg-firewall -d smbClient
If we need to open a TCP or UDP port that is not described by a defined friendly name like "sshClient", then we can explicitly open that port with the -o switch. The service console firewall is bidirectional and so when opening a port you must also specify direction of incoming or outgoing. Equally, we can close an explicit port with the -c switch.
[root@esxhost1 root]# esxcfg-firewall -o tcpport,out,name
In the following example, we are opening a unique port which we are calling "customapp"
[root@esxhost1 root]# esxcfg-firewall -o 12345,out,custom-app
The service names such as sshClient and smbClient are defined in the file /etc/vmware/firewall/services.xml .
 
esxcfg-module
This command produces an output similar to vmkload_mod -list
[root@esx1host tools-isoimages]# esxcfg-module -l

Module        Type      Enabled Loaded
vmkapimod     vmkapimod true    true
vmklinux      linux     true    true
cciss.o       scsi      true    false
tg3.o         nic       true    false
qla2300_7xx.o fc        true    false
Although if you compare the output with the old command, things don't exactly match up. Not sure why just yet....
 
esxcfg-rescan
This command is used to perform a rescan of a host bus adapter (HBA). Specifically it scans a named vmkernel hba device, i.e. a vmhba. This command does a similar job to vmkfstools -rescan.
In this example the esxcfg-rescan command is used to rescan the iSCSI software initiator vmhba.
[root@esx1host]# esxcfg-rescan vmhba40


See all the ways you can stay connected to friends and family

الأحد، 17 مايو 2009

Configure a Distributed File System (DFS) environment in Windows Server 2003

Configure a Distributed File System (DFS) environment in Windows Server 2003

Windows 2000 introduced Distributed File System (DFS), which allows you to consolidate file shares so users can access them from a single point on the network. Windows Server 2003 improved the technology to include WAN replication, allowing DFS points to exist across WAN links. In this tip, I will explain how DFS works and walk you through the steps of setting it up and configuring it in Windows Server 2003.

In a DFS environment, you can consolidate shared folders and files that may exist on multiple servers to appear as though they all live in the same location. For example, on the file server in the corporate office in Chicago, each of the departments has its own share. The field office in Denver has a smaller file server for its local employees. Using DFS, the files in the Denver office appear to the Chicago users as though they live on the Chicago file server.

Follow these steps to configure a DFS environment:

  1. Configure your server to have the file server role. Open the Start menu and choose Administrative Tools.
  2. Select Configure Your Server Wizard.
  3. In the Roles wizard, select the file server role and click Next. (You may need to supply the Windows Server 2003 CD to complete this setup.)
  4. After the setup completes, click Finish.

Using DFS components does not depend on the file server role. If you do not wish to configure the file server role, you can install the DFS components by following these steps:

  1. Go to Start | Control Panel and open Add/Remove Programs.
  2. Select Windows Components from the left navigation bar.
  3. Check the box next to the desired DFS component. If you are not using multiple sites with replication requirements, you can select the DFS component and click Details to uncheck the DFS replication component.
  4. Go to Start | All Programs | Administrative Tools.
  5. Select Distributed File System.
  6. In the left pane of the DFS snap-in, right-click the Distributed File System node and select New Root.

Creating a DFS root

DFS environments create a DFS root, which is the location where all items within DFS live. For example, if the Chicago office calls the DFS root on its local file server "Departments," the root of Departments would list the shares included in the DFS.

  1. The New Root Wizard will open to assist you in creating the DFS root. Click Next on the Welcome screen to begin.
  2. The next screen in the New Root Wizard will ask you if you want to create a Standalone Root or a Domain Root. Select the root type and then click Next.

A domain root uses Active Directory (AD) to store the DFS information; it also allows the DFS information to replicate with AD, which allows DFS roots and shares to stay synchronized across sites. A standalone root stores DFS information on the file server itself and will not replicate.

The type of root you create will determine what you provide in the next portion of the New Root Wizard. If you select Domain Root, you will need to specify the domain name of your AD environment, as well as any trusting domains. If you select Standalone, you will enter the name of the file server that will host the DFS root.

  1. Enter the name of the Active Directory Domain (for a domain root) or the Server Name (for a standalone root) and click Next.

(For the remainder of this tip, I will use a standalone root for DFS. The difference between root types has to do with AD replication and does not affect the general configuration of DFS.)

  1. After you specify your file server name for the DFS root host, enter the root name and click Next. (In our example, the root name is Departments.)
  2. On the next screen of the wizard, browse to a folder you wish to share as part of the DFS environment. Select the folder and click Next. You can add additional shares to the DFS root at any time after the initial configuration.
  3. Click Finish to complete the DFS New Root installation wizard.

If you click on the DFS root you created in the DFS console, you will not see any shares because you have not added them yet. The shared folder specified when creating a DFS root serves as a starting point for the DFS environment. To add shares to your DFS root, you will need to link the shares to the root. Follow these steps to add a link to the DFS root:

  1. Right-click the DFS Root object under the Distributed File System node in the DFS console and select New Link.
  2. The system will ask for the UNC path to the share, as well as a name for the link. The New DFS Link dialog box also allows you to specify an amount of time for a client to cache the reference to the link. This reduces network traffic by reducing the attempts to constantly look up the DFS link.
  3. Enter the name of your link. After you do, it will appear in the Preview text box on the New Link dialog box. This will show you the path to the new link.
  4. Click OK to create the link.

Now that you have added the DFS root and a link, you can begin using your DFS environment. You can link all of the department shares to the Departments root (regardless of the shares' actual location); reduce the amount of overhead needed to manage these shares; and gain access to all the links added through the DFS root no matter which server the share lives on.

Using DFS will allow administrators to point network drive maps to a single location for access to all of the shares linked within the root. Reducing the number of drive mappings and maintenance which can be associated with managing these mappings.