<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>New Technologies System Virtualisation &#187; virtual infrastructure</title>
	<atom:link href="http://www.ntsysv.com/index.php/tag/virtual-infrastructure/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ntsysv.com</link>
	<description>La théorie rejoint la pratique</description>
	<lastBuildDate>Fri, 02 Dec 2011 13:33:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>VMware ESX: Management, Configuration and Troubleshooting with Command Line</title>
		<link>http://www.ntsysv.com/index.php/vmware-esx-management-configuration-troubleshooting-command-line</link>
		<comments>http://www.ntsysv.com/index.php/vmware-esx-management-configuration-troubleshooting-command-line#comments</comments>
		<pubDate>Mon, 12 Jan 2009 00:49:57 +0000</pubDate>
		<dc:creator>ElMehdi</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[virtualisation]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[service console]]></category>
		<category><![CDATA[vi3]]></category>
		<category><![CDATA[virtual infrastructure]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://www.ntsysv.com/?p=264</guid>
		<description><![CDATA[Performing management, configuration, and troubleshooting tasks is an important skill set for Virtual Infrastructure administrators; This post focuses on commands that are most likely to be used to manage an ESX Server from the Service Console. The Service Console is a modified version of Red Hat Linux which is used to boot and load the VMkernel for [...]]]></description>
			<content:encoded><![CDATA[<p>Performing management, configuration, and troubleshooting tasks is an important skill set for <strong>Virtual Infrastructure</strong> administrators; This post focuses on commands that are most likely to be  used to manage an <strong>ESX Server</strong> from the <strong>Service Console</strong>.<span id="more-264"></span></p>
<p>The Service Console is a modified version of <strong>Red Hat  Linux</strong> which is used to boot and load the <strong>VMkernel</strong> for VMware ESX Server and  provide services such as the Apache web server for the MUI and command-line  management. It has several commands that are unique to ESX Server such as <strong> vmware-cmd</strong>, <strong>vmkfstools</strong>, <strong>vmkpcidivy</strong>, <strong>esxtop</strong>, and some custom scripts.</p>
<p>To attach to the Service Console remotely from a Windows  workstation, you can use the <strong>PuTTY </strong>SSH client, freely available from its <a title="PuTTY is a FREE SSH and telnet client" href="http://www.putty.org/" target="_blank">official website</a>.</p>
<h2>Practical Examples</h2>
<ul>
<li>If you need to view current partitions, sizes, and the amount of disk space  consumed, type :</li>
</ul>
<blockquote>
<p style="text-align: center;">vdf –h</p>
</blockquote>
<p>the output should be similar to the one showed  bellow</p>
<div id="attachment_265" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.ntsysv.com/wp-content/uploads/2009/01/view-consumed-disk-space-on-esx-host.jpg"><img class="size-medium wp-image-265" title="Consumed disk space on esx host" src="http://www.ntsysv.com/wp-content/uploads/2009/01/view-consumed-disk-space-on-esx-host-300x88.jpg" alt="view-consumed-disk-space-on-esx-host" width="300" height="88" /></a><p class="wp-caption-text">View consumed disk space on esx host</p></div>
<ul>
<li>
<div>If you want to view the contents of a VMFS volume on your  server, type :</div>
</li>
</ul>
<blockquote>
<div style="text-align: center;">vmkfstools –l <em>vmfs_label</em></div>
</blockquote>
<ul>
<li>
<div>To check disk space consumption under a specific directory, type  :</div>
</li>
</ul>
<blockquote>
<div style="text-align: center;">du –sk <em>directory-name</em></div>
</blockquote>
<ul>
<li>
<div>To find out which device file maps to a LUN,</div>
</li>
</ul>
<blockquote>
<ol>
<li style="text-align: left;">type : vmkpcidivy &#8211;refreshnames (This refreshes the table of  device files.)</li>
<li style="text-align: left;">type : vmkpcidivy –q vmhba_devs</li>
</ol>
</blockquote>
<ul>
<li>
<div>To export a virtual disk from vmfs to a different location on  your ESX Server, type :</div>
</li>
</ul>
<blockquote>
<div style="text-align: center;">vmkfstools –e <em>/targetdirectory/filename.vmdk  /vmfs/volume_label/sourcefile.vmdk</em></div>
</blockquote>
<ul>
<li>
<div>To display all registered VMs, type :</div>
</li>
</ul>
<blockquote>
<div style="text-align: center;">vmware-cmd  –l</div>
</blockquote>
<div id="attachment_266" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.ntsysv.com/wp-content/uploads/2009/01/list-registred-virtual-machine-on-esx-host.jpg"><img class="size-medium wp-image-266" title="Registred virtual machine on esx host" src="http://www.ntsysv.com/wp-content/uploads/2009/01/list-registred-virtual-machine-on-esx-host-300x72.jpg" alt="List Registred virtual machine on esx host" width="300" height="72" /></a><p class="wp-caption-text">List Registred virtual machine on esx host</p></div>
<ul>
<li>
<div>To power on VMs from the Service Console, type :</div>
</li>
</ul>
<blockquote>
<div style="text-align: center;">vmware-cmd  <em>vmx-configfile</em> start soft</div>
</blockquote>
<ul>
<li>
<div>To power off VMs from the Service Console, type :</div>
</li>
</ul>
<blockquote>
<div style="text-align: center;">vmware-cmd  <em>vmx-configfile</em> stop soft</div>
<div style="text-align: center;">or</div>
<div style="text-align: center;">vmware-cmd <em>vmx-configfile</em> stop  hard</div>
</blockquote>
<p>I&#8217;m trying here to list some available commands and  their options, but it is not intended to replace the officiel documentation  neither a better reference.</p>
<h2>Using esxcfg</h2>
<p>In addition to the standard Linux commands, VMware has  implemented a specific set of commands directed toward ESX-specific tasks. The  following list of commands show how to manage various components of the ESX  Server configuration.</p>
<p><strong>esxcfg-auth</strong> Used to configure an ESX  Server host to support network-based authentication methods (e.g., Active  Directory [AD]).</p>
<ul>
<li>
<div>- -enablead to configure Service Console for AD  authentication</div>
</li>
<li>
<div>- -addomain to set the domain the Service Console will  authenticate against</div>
</li>
<li>
<div>- -addc to set the domain controller to authenticate  against for AD authentication</div>
</li>
<li>
<div>- -usecrack to enable the pam_cracklib for managing  password complexity</div>
</li>
</ul>
<p><strong>esxcfg-firewall</strong> Used to query, enable,  and disable services on the Service Console firewall. Note that everything is  <strong>blocked</strong> by default.</p>
<ul>
<li>
<div>-q to query the current firewall settings</div>
</li>
<li>
<div>-q <em>servicename</em> to query the status of a  specific service</div>
</li>
<li>
<div>-q incoming/outgoing to query the status of incoming  and outgoing ports</div>
</li>
<li>
<div>- -blockIncoming to block all incoming connections on  ports not required for system function</div>
</li>
<li>
<div>- -blockOutgoing to block all outgoing connections on  ports not required for system function</div>
</li>
<li>
<div>- -allowIncoming to allow incoming connections on all  ports</div>
</li>
<li>
<div>- -allowOutgoing to allow outgoing connections on all  ports</div>
</li>
<li>
<div>- -e <em>servicename </em>to enable a specific  service</div>
</li>
<li>
<div>- -d <em>servicename </em>to disable a specific  service</div>
</li>
</ul>
<p><strong>esxcfg-info</strong> Used to review the hardware  information for Service Console and VMKernel.</p>
<ul>
<li>
<div>-w to print hardware information</div>
</li>
<li>
<div>-s to print storage and disk information</div>
</li>
<li>
<div>-n to print network information</div>
</li>
</ul>
<p><strong>esxcfg-mpath</strong> Used to view and configure  the multipathing settings for an ESX Server host&#8217;s fibre channel or iSCSI  storage devices. Multipathing is the ability to connect to SAN or iSCSI storage  devices through multiple pahs, and it suppose that the host has at least (and it  is enough) 2 HBA cards.</p>
<ul>
<li>
<div>-p to set the policy for mru (most recently used),  fixed, or rr (round-robin)</div>
</li>
<li>
<div>-P to define a path to operate on</div>
</li>
<li>
<div>-s with &#8220;on&#8221; or &#8220;off&#8221; to enable or disale a specific  path</div>
</li>
<li>
<div>-f to set a specified path as the  preferred</div>
</li>
</ul>
<p><strong>esxcfg-nas</strong> Used to configure NAS  storage on ESX Server. NAS is supported by ESX but limits its features like  vMotion which is not allowed in this case (but still it is a low cost  solution)</p>
<ul>
<li>
<div>-l to list all NAS</div>
</li>
<li>
<div>-a to add a new NAS datastore on a specified  host</div>
</li>
<li>
<div>-o to provide the name of the NAS host</div>
</li>
<li>
<div>-s to provide the name of the NAS share</div>
</li>
<li>
<div>-delete to delete a NAS datastore</div>
</li>
</ul>
<p><strong>esxcfg-nics</strong> Used to obtain information  about and configure the physical network adapters installed in an ESX Server  host.</p>
<ul>
<li>
<div>-s to set the speed of a card to 10,100,1000, or  10,000.</div>
</li>
<li>
<div>-d to set the duplex to half or full</div>
</li>
</ul>
<p><strong>esxcfg-route</strong> Used to configure the  default gateway for the VMkernel.</p>
<p><strong>esxcfg-swiscsi</strong> Used to configure the  software iSCSI component of ESX Server.</p>
<ul>
<li>
<div>-e to enable software iSCSI</div>
</li>
<li>
<div>-d to disable software iSCSI</div>
</li>
<li>
<div>-q to query if software iSCSI is enabled</div>
</li>
<li>
<div>-s to scan for new LUNs using software  iSCSI</div>
</li>
</ul>
<p><strong>esxcfg-vmhbadevs</strong> Used to obtain  information about the LUNs available to the ESX Server.</p>
<ul>
<li>
<div>-m to print the VMFS UUID if formatted as VMFS  esxcfg-vmknic Used to configure the VMkernel NIC.</div>
</li>
<li>
<div>-a to add a VMkernel port group</div>
</li>
<li>
<div>-d to delete a VMKernel</div>
</li>
<li>
<div>-e to enable the VMkernel NIC</div>
</li>
<li>
<div>-D to disable the VMkernel port</div>
</li>
<li>
<div>-i to set the IP address of the VMkernel  NIC</div>
</li>
<li>
<div>-n to set the network mask for the IP of the  call</div>
</li>
</ul>
<p><strong>esxcfg-vswif</strong> Used to set the parameters  of the Service Console; the Service Console interface allow management of the  ESX.</p>
<ul>
<li>
<div>-a to add a Service Console NIC (this option is  predicated on having IP information and port group names)</div>
</li>
<li>
<div>-d to delete a the Service Console NIC</div>
</li>
<li>
<div>-e to enable the Service Console NIC</div>
</li>
<li>
<div>-D to disable the Service Console NIC</div>
</li>
<li>
<div>-p to set the port group name for the Service Console  NIC</div>
</li>
<li>
<div>-i to set the IP address to be used for the Service  Console NIC</div>
</li>
<li>
<div>-n to set the network mask of for the Service Console  NIC</div>
</li>
</ul>
<p><strong>esxcfg-vswitch</strong> Used to add, remove, or  modify a virtual switch. All network communications of virtual machines go  through virtual switches.</p>
<ul>
<li>
<div>-a to add a new virtual switch</div>
</li>
<li>
<div>-d to delete a new virtual switch</div>
</li>
<li>
<div>-l to list all existing virtual switches</div>
</li>
<li>
<div>-L to unlink a network adapter from a hosting  provider</div>
</li>
<li>
<div>-U to link a network adapter</div>
</li>
<li>
<div>-v to set the vLAN ID for a port group</div>
</li>
<li>
<div>-A to add a new port group</div>
</li>
<li>
<div>-D to delete a port group</div>
</li>
<li>
<div>-C to query for the existence of a port group  name</div>
</li>
</ul>
<h2>Using vicfg</h2>
<p>The latest updates to the VI3 product suite, ESX Server 3.5, ESXi, and  VirtualCenter 2.5 have also brought about the introduction of a new set of  command line tools in the vicfg. The commands are similar to the esxcfg commands  but are more directly dedicated to remote host management functions using the  new remote command line interface tool available from VMware.</p>
<p>Just to remid you, ESX 3.5i comes without the &#8220;management virtual machine&#8221;  that everybody takes for the OS of the ESX! In fact, the ESX 3.5i is a 32Mb OS,  in other words, the least set of commands to manage VMs.</p>
<p><strong>vicfgvicfg-nas</strong> Used to manipulate NAS/NFS.</p>
<ul>
<li>- -add or -a to add a new NAS file syste</li>
<li>- -delete or -d to delete a NAS file system</li>
<li>- -help to display help text</li>
<li>- -nasserver or -o followed by &lt;n_host&gt; to add the hostname of the new  NAS file system</li>
<li>- -share or -s used with -a to provide the name of the directory that is  exported on the NAS device</li>
<li>- -vihost or -h followed by &lt;host&gt; to direct the command to a  particular ESX Server host</li>
</ul>
<p><strong>vicfg-vmhbadevs</strong> Used to discover information about available  LUNs.</p>
<ul>
<li>- -help to display help text</li>
<li>- -query or -q to print the output in 2.6 compatibility mode</li>
<li>- -vihost or -h followed by &lt;host&gt; to direct the command to a  particular ESX Server host</li>
<li>- -vmfs or -m to print the VMFS UUID in addition to the HBA and /dev names  for LUNs that are formatted as VMFS</li>
</ul>
<p><strong>vicfg-mpath</strong> Used to manipulate multipathing.</p>
<ul>
<li>- -help to display help text</li>
<li>- -bulk or -b to show all LUNs and paths in parsable format</li>
<li>- -detailed or -d to show all information about a LUN, including its globally  unique name</li>
<li>- -hbas or -a to print the list of HBAs that can be identified by a unique  ID</li>
<li>- -list or —l to list all LUNs on the system and the paths to each LUN</li>
<li>- -lun or -L followed by &lt;lun&gt; to specify the LUN to use in the  operations command (this option is not used by itself)</li>
<li>- -path or -P followed by &lt;path&gt; to specify the path to use in the  operations command (this option is not used by itself)</li>
<li>- -policy or -p followed by [mru | fixed] to set the policy for a given LUN  (the option for round-robin (rr) can be used but is still experimental)</li>
<li>- -preferred or -f to set the specified path (—path) as the preferred  path</li>
<li>- -query or -q to query a LUN for information</li>
<li>- -state or -s followed by on or off to enable or disable a given path</li>
<li>- -vihost or -h followed by &lt;host&gt; to direct the command to a  particular ESX Server host</li>
</ul>
<p><strong>vicfg-rescan</strong> Used to perform a rescan for discovering new  LUNs.</p>
<ul>
<li>- -help to display help text</li>
<li>- -vihost or -h followed by &lt;host&gt; to direct the command to a  particular ESX Server host<br />
&lt;VMkernel_SCSI_adapter_name&gt; to provide the  name of the adapter to rescan (i.e., vmhba1)</li>
</ul>
<p><strong>vicfg-dumppart</strong> Used to query, set, and scan diagnostic  partitions on ESXi.</p>
<ul>
<li>- -activate or -a to activate the configured diagnostic partition (performs  the same as —set)</li>
<li>- -deactivate or -d to deactivate the currently active diagnostic  partition</li>
<li>- -find or -f to find all diagnostic partitions</li>
<li>- -get-active or -t to get the active diagnostic partition for the  system</li>
<li>- -get-config or -c to get the configured diagnostic partition for the  system</li>
<li>- -list or -l to list all partitions on the system that can act as a  diagnostic partition</li>
<li>- -set or -s followed by &lt;vmhbaw:x:y:z&gt; to set the active and  configured diagnostic partition</li>
<li>- -vihost or -h followed by &lt;host&gt; to direct the command to a  particular ESX Server host</li>
</ul>
<p><strong>vicfg-nics</strong> Used to report on and manage physical network  adapters.</p>
<ul>
<li>- -help to display help text</li>
<li>- -auto or -a to set the given adapter to autonegotiate the speed and duplex  settings</li>
<li>- -duplex or -d followed by [full | half] &lt;nic&gt; to set the duplex value  for a given NIC</li>
<li>- -speed or -s followed by &lt;speed&gt;&lt;nic&gt; to set the speed value  for a given NIC</li>
<li>- -list or -l to list the physical adapters in the system</li>
<li>- -vihost or -h followed by &lt;host&gt; to direct the command to a  particular ESX Server host</li>
</ul>
<p><strong>vicfg-vmknic</strong> Used to configure virtual network adapters.</p>
<ul>
<li>- -help to display help text</li>
<li>- -add or -a to add a virtual network adapter to the system (an IP address  and port group name must be specified)</li>
<li>- -del or -d followed by &lt;port_group&gt; to delete the virtual network  adapter on the specified port group</li>
<li>- -ip or -i followed by [&lt;IP address&gt;| DHCP] to set the virtual network  adapter to a given IP address or to obtain an address from a DHCP server</li>
<li>- -list or -l to list virtual network adapters on the system</li>
<li>- -netmask or -n followed by &lt;netmask&gt; to set the network mask for the  assigned IP address</li>
<li>- -vihost or -h followed by &lt;host&gt; to direct the command to a  particular ESX Server host</li>
</ul>
<p><strong>vicfg-vswitch</strong> Used to configure virtual switches.</p>
<ul>
<li>- -help to display help text</li>
<li>- -add or -a followed by &lt;vswitch_name&gt; to add a new virtual  switch</li>
<li>- -add-pg or -A followed by &lt;portgroup&gt; &lt;switch&gt; to add a port  group to the specified switch</li>
<li>- -check or -c followed by &lt;virtual_switch&gt; to check for the existence  of a virtual switch</li>
<li>- -check-pg or -C followed by &lt;port_group&gt; to check for the existence  of a port group</li>
<li>- -delete or -d followed by &lt;vswitch_name&gt; to delete the specified  virtual switch (this command will not work if any of the virtual switch ports  are in use)</li>
<li>- -del-pg or -D followed by &lt;portgroup&gt; to delete the specified port  group (this command will not work if the port group is in use)</li>
<li>- -link or -L followed by &lt;pnic&gt; to add a physical adapter to a virtual  switch</li>
<li>- -list or -l to list all virtual switches and port groups</li>
<li>- -mtu or -m to set the maximum transmission unit (MTU) of the virtual  switch</li>
<li>- -pg or -p followed by &lt;port_group&gt; to provide the name of a port  group when using the —vlan option (use the ALL parameter to set VLAN IDs on all  port groups of a virtual switch)</li>
<li>- -vlan or -v to set the VLAN ID for a specific port group (using the  parameter 0 disables all VLAN IDs; using —vlan requires the —pg option)</li>
<li>- -vihost or -h followed by &lt;host&gt; to direct the command to a  particular ESX Server host</li>
</ul>
<p><strong>vicfg-route</strong> Used to configure the default route for VMkernel  ports.</p>
<ul>
<li>- -help to display help text</li>
<li>- -vihost or -h followed by &lt;host&gt; to direct the command to a  particular ESX Server host &lt;gateway&gt; to specify the default gateway to be  used by the VMkernel</li>
</ul>
<p><strong>vicfg-ntp</strong> Used to configure NTP settings.</p>
<ul>
<li>- -help to display help text</li>
<li>- -add or -a followed by &lt;server&gt; to add an NTP server</li>
<li>- -delete or -d followed by &lt;server&gt; to delete an NTP server</li>
<li>- -list or -l to list the configured NTP servers</li>
<li>- -vihost or -h followed by &lt;host&gt; to direct the command to a  particular ESX Server host</li>
</ul>
<p>Hope this helps!</p>
Copyright <b> <a href="http://www.ntsysv.com">Ntsysv.com </a></b>]]></content:encoded>
			<wfw:commentRss>http://www.ntsysv.com/index.php/vmware-esx-management-configuration-troubleshooting-command-line/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

