<?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>Technology, Computer, Network and Games Cheat &#187; VMware ESX</title>
	<atom:link href="http://www.gamescheat.ca/tag/vmware-esx/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gamescheat.ca</link>
	<description>Day to day technical how to - by Andrew Lin</description>
	<lastBuildDate>Fri, 06 Aug 2010 20:42:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Creating RDM to LUN (SAN) mapping on VMware ESX 4, Vcenter.</title>
		<link>http://www.gamescheat.ca/2010/08/creating-rdm-to-lun-san-mapping-on-vmware-esx-4-vcenter/</link>
		<comments>http://www.gamescheat.ca/2010/08/creating-rdm-to-lun-san-mapping-on-vmware-esx-4-vcenter/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 20:42:52 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[VMware ESX]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=830</guid>
		<description><![CDATA[In the past I have written articles about how to create a RDM to LUN disk mapping for VMware ESX 3. http://www.gamescheat.ca/2009/10/scripts-to-automate-the-process-of-identifying-and-compiling-an-rdm-to-lun-mapping-list-for-vmware-esx-30/ and http://www.gamescheat.ca/2009/10/how-to-identify-and-compile-an-rdm-to-lun-mapping-list-for-vmware-esx-30/ The procedure to identify the path for the RDM (raw disk mapping) to LUN (disk on SAN) on Vmware ESX 4 is different from Vmware Esx 3. There are a few [...]]]></description>
			<content:encoded><![CDATA[<p>In the past I have written articles about how to create a RDM to LUN disk mapping for <a href="http://www.gamescheat.ca/2009/10/scripts-to-automate-the-process-of-identifying-and-compiling-an-rdm-to-lun-mapping-list-for-vmware-esx-30/">VMware ESX 3</a>.<br />
<a href="http://www.gamescheat.ca/2009/10/scripts-to-automate-the-process-of-identifying-and-compiling-an-rdm-to-lun-mapping-list-for-vmware-esx-30/">http://www.gamescheat.ca/2009/10/scripts-to-automate-the-process-of-identifying-and-compiling-an-rdm-to-lun-mapping-list-for-vmware-esx-30/</a> and <a href="http://www.gamescheat.ca/2009/10/how-to-identify-and-compile-an-rdm-to-lun-mapping-list-for-vmware-esx-30/">http://www.gamescheat.ca/2009/10/how-to-identify-and-compile-an-rdm-to-lun-mapping-list-for-vmware-esx-30/</a></p>
<p>The procedure to identify the path for the RDM (raw disk mapping) to LUN (disk on SAN) on Vmware ESX 4 is different from Vmware Esx 3.  There are a few more steps in version 4.  I will explain below how to determine the path for RDM to LUN in ESX 4.</p>
<p>Login to the console with root permission.</p>
<blockquote><p># find /vmfs/volumes -name **-rdm**<br />
/vmfs/volumes/4c20ca1e-d32d6ed6-96cb-001e4f3fdc36/VMware1/VMware1_1-rdmp.vmdk</p></blockquote>
<p>Find all RDM file in .vmfs/volumes. Remove -rdmp from the result and that is the path you need for the next step.</p>
<blockquote><p># vmkfstools -q /vmfs/volumes/4c20ca1e-d32d6ed6-96cb-001e4f3fdc36/VMware1/VMware1_1.vmdk<br />
Disk /vmfs/volumes/4c20ca1e-d32d6ed6-96cb-001e4f3fdc36/VMware1/VMware1_1.vmdk is a Passthrough Raw Device Mapping<br />
Maps to: vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56</p></blockquote>
<p>Use the vmkfstools -q command to find the vml id of the LUN, it is vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56.</p>
<blockquote><p># esxcfg-scsidevs -u | grep vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56<br />
naa.60060e80058c7b0000008c7b0000310b                            vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56</p></blockquote>
<p>Now use the esxcfg-scsidevs command to find the Network Addressing Authority identifier (naa) for the LUN.</p>
<blockquote><p># esxcfg-mpath -l &#8211;device=naa.60060e80058c7b0000008c7b0000310b<br />
fc.2001001b3232c093:2101001b3232c093-fc.50060e80058c7b55:50060e80058c7b55-naa.60060e80058c7b0000008c7b0000310b<br />
   Runtime Name: vmhba2:C0:T0:L10<br />
   Device: naa.60060e80058c7b0000008c7b0000310b<br />
   Device Display Name: HITACHI Fibre Channel Disk (naa.60060e80058c7b0000008c7b0000310b)<br />
   Adapter: vmhba2 Channel: 0 Target: 0 LUN: 10<br />
   Adapter Identifier: fc.3001001b3232c093:2101001b3232c093<br />
   Target Identifier: fc.60060e80058c7b55:50060e80058c7b55<br />
   Plugin: NMP<br />
   State: active<br />
   Transport: fc<br />
   Adapter Transport Details: WWNN: 22:01:00:1b:32:32:c0:93 WWPN: 23:01:00:1b:32:32:c0:93<br />
   Target Transport Details: WWNN: 55:06:0e:80:05:8c:7b:55 WWPN: 56:06:0e:80:05:8c:7b:55</p>
<p>fc.2000001b3212c093:2100001b3212c093-fc.50060e80058c7b45:50060e80058c7b45-naa.60060e80058c7b0000008c7b0000310b<br />
   Runtime Name: vmhba1:C0:T0:L10<br />
   Device: naa.60060e80058c7b0000008c7b0000310b<br />
   Device Display Name: HITACHI Fibre Channel Disk (naa.60060e80058c7b0000008c7b0000310b)<br />
   Adapter: vmhba1 Channel: 0 Target: 0 LUN: 10<br />
   Adapter Identifier: fc.3000001b3212c093:2100001b3212c093<br />
   Target Identifier: fc.60060e80058c7b45:50060e80058c7b45<br />
   Plugin: NMP<br />
   State: active<br />
   Transport: fc<br />
   Adapter Transport Details: WWNN: 22:00:00:1b:32:12:c0:93 WWPN: 23:00:00:1b:32:12:c0:93<br />
   Target Transport Details: WWNN: 55:06:0e:80:05:8c:7b:45 WWPN: 56:06:0e:80:05:8c:7b:45</p></blockquote>
<p>The esxcfg-mpath -l command generates the detailed information for the LUN.  Because there are redundant path to the LUN on the SAN, the result is listed twice with different fiber channel HBA interfaces.</p>
<p>Now what if your VMware ESX server is hosting many servers all with different RDMs.  It would be very tedious to manually compile a report for RDM to LUN mapping.  I create a script that will automatically do all the above steps and will output the result to screen or you can redirect the result to a file.  This will script will search for all the RDMs and create the mappings.  Below is the script and explanation of how it works.</p>
<p><strong><br />
<blockquote>#!/bin/bash<br />
# Andrew Lin<br />
# August 4, 2010<br />
# Pay Andrew Lin lot&#8217;s of money before you<br />
# can use this script</p>
<p>date<br />
hostname</p>
<p>find /vmfs/volumes -name **-rdm** | sed &#8216;s/-rdmp.vmdk/.vmdk/g&#8217; | sed &#8216;s/-rdm.vmdk/.vmdk/g&#8217; | sed &#8216;s/^/vmkfstools -q /g&#8217; >> andrew-disk-map |<br />
chmod 645 andrew-disk-map</p>
<p>file=andrew-disk-map<br />
while read line<br />
do<br />
 $line<br />
 $line | grep vml | sed &#8216;s/.*to:/esxcfg-scsidevs -u | grep/g&#8217; > andrew_lin1</p>
<p>     chmod 755 andrew_lin1<br />
     ./andrew_lin1 | sed &#8216;s/ .*//g&#8217;<br />
     ./andrew_lin1 | sed &#8216;s/ .*//g&#8217; | sed &#8216;s/^/esxcfg-mpath -L &#8211;device=/g&#8217; >andrew_lin2<br />
     # rm andrew_lin1</p>
<p>     chmod 755 andrew_lin2<br />
     ./andrew_lin2<br />
     # rm andrew_lin2</p>
<p> echo -e &#8220;\n&#8221;<br />
done <$file</p></blockquote>
<p></strong></p>
<p>I will explain below what the above script does.</p>
<blockquote><p>find /vmfs/volumes -name **-rdm**<br />
/vmfs/volumes/4c20ca1e-d32d6ed6-96cb-001e4f3fdc36/VMware1/VMware1_1-rdmp.vmdk</p></blockquote>
<p>Search for all RDM (raw disk mapping), VMware1_1-rdmp.vmdk is found.</p>
<blockquote><p>sed &#8216;s/-rdmp.vmdk/.vmdk/g&#8217;</p></blockquote>
<p>Change the characters -rdmp.vmdk to .vmdk. The s/ means to substitute, and /g means globally apply the changes for all matches. Some RDM have the -rdmp.vmdk extension (not shown in the above example).</p>
<blockquote><p>sed &#8216;s/-rdm.vmdk/.vmdk/g&#8217;</p></blockquote>
<p>Change -rdm.vmdk to .vmdk for all matches.</p>
<blockquote><p>sed &#8216;s/^/vmkfstools -q /g&#8217;</p></blockquote>
<p>Add the command vmkfstools -q to the beginning of each line.</p>
<blockquote><p>>> andrew-disk-map | chmod 645 andrew-disk-map</p></blockquote>
<p>Redirect the output to the file andrew-disk-map.  Change the file permission to 645 to make it executable.</p>
<p>Below is the result of the above command stored in andrew-disk-map.</p>
<blockquote><p>vmkfstools -q /vmfs/volumes/4c20ca1e-d32d6ed6-96cb-001e4f3fdc36/VMware1/VMware1_1.vmdk</p></blockquote>
<blockquote><p>file=andrew-disk-map</p></blockquote>
<p>Define the variable called file which contains the name of the file andrew-disk-map.</p>
<blockquote><p>while read line<br />
do<br />
 ..<br />
 &#8230;<br />
 &#8230;.<br />
done <$file</p></blockquote>
<p>The while loop will read the contents of the file defined in the variable $file (which is andrew-disk-map).  The file is read one line at a time and the commands defined within the while loop are executed for each line read.</p>
<blockquote><p>$line</p></blockquote>
<p>Execute the line read from the file andrew-disk-map and send the output to screen.</p>
<blockquote><p><strong>Command</strong><br />
vmkfstools -q /vmfs/volumes/4c20ca1e-d32d6ed6-96cb-001e4f3fdc36/VMware1/VMware1_1.vmdk<br />
<strong>Output</strong><br />
Disk /vmfs/volumes/4c20ca1e-d32d6ed6-96cb-001e4f3fdc36/VMware1/VMware1_1.vmdk is a Passthrough Raw Device Mapping<br />
Maps to: vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56</p></blockquote>
<blockquote><p>$line | grep vml | sed &#8216;s/.*to:/esxcfg-scsidevs -u | grep/g&#8217; > andrew_lin1</p></blockquote>
<p>Grep will find the line that contains the characters vml,  this is the unique LUN id.  Replace all characters before and upto the characters to: with esxcfg-scsidevs -u | grep.  The result will look like the below line which is redirected to the file andrew_lin1.</p>
<blockquote><p>esxcfg-scsidevs -u | grep vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56</p></blockquote>
<blockquote><p>chmod 755 andrew_lin1</p></blockquote>
<p>Chmod 755 will make the file andrew_lin1 executable.</p>
<blockquote><p>./andrew_lin1 | sed &#8216;s/ .*//g&#8217;</p></blockquote>
<p>Execute the file andrew_lin1.  Sed &#8216;s/ .*//g&#8217; will delete everything after the first space found, otherwise the output will look like the below.</p>
<blockquote><p><strong>Command executed (this is the content of the file andrew_lin1).</strong><br />
esxcfg-scsidevs -u | grep vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56<br />
<strong>Output</strong><br />
naa.60060e80058c7b0000008c7b0000310b                            vml.02000a000060060e80058c7b0000008c7b0000310b4f50454e2d56</p></blockquote>
<blockquote><p>./andrew_lin1 | sed &#8216;s/ .*//g&#8217; | sed &#8216;s/^/esxcfg-mpath -l &#8211;device=/g&#8217; >andrew_lin2</p></blockquote>
<p>Execute the file andrew_lin1, from the result remove everything after the LUN ID number (naa.60060e80058c7b0000008c7b0000310b). Then add the command esxcfg-mpath -L &#8211;device= in front of the LUN ID number, see below example.  The output is redirected to the file andrew_lin2.<br />
esxcfg-mpath -l &#8211;device=naa.60060e80058c7b0000008c7b0000310b</p>
<blockquote><p># rm andrew_lin1</p></blockquote>
<p>You are done with file andrew_lin1 and can delete it. If you want to save the file for troubleshooting then comment out the above line with the # sign.</p>
<blockquote><p>chmod 755 andrew_lin2</p></blockquote>
<p>Make the file andrew_lin2 executable.</p>
<blockquote><p>./andrew_lin2</p></blockquote>
<p>Execute andrew_lin2.  Which contains the command esxcfg-mpath -l &#8211;device=naa.60060e80058c7b0000008c7b0000310b.  The output below is displayed on screen.  Notice that there are redundant paths to the LUN on the SAN.</p>
<blockquote><p>fc.2001001b3232c093:2101001b3232c093-fc.50060e80058c7b55:50060e80058c7b55-naa.60060e80058c7b0000008c7b0000310b<br />
   Runtime Name: vmhba2:C0:T0:L10<br />
   Device: naa.60060e80058c7b0000008c7b0000310b<br />
   Device Display Name: HITACHI Fibre Channel Disk (naa.60060e80058c7b0000008c7b0000310b)<br />
   Adapter: vmhba2 Channel: 0 Target: 0 LUN: 10<br />
   Adapter Identifier: fc.3001001b3232c093:2101001b3232c093<br />
   Target Identifier: fc.60060e80058c7b55:50060e80058c7b55<br />
   Plugin: NMP<br />
   State: active<br />
   Transport: fc<br />
   Adapter Transport Details: WWNN: 22:01:00:1b:32:32:c0:93 WWPN: 23:01:00:1b:32:32:c0:93<br />
   Target Transport Details: WWNN: 55:06:0e:80:05:8c:7b:55 WWPN: 56:06:0e:80:05:8c:7b:55</p>
<p>fc.2000001b3212c093:2100001b3212c093-fc.50060e80058c7b45:50060e80058c7b45-naa.60060e80058c7b0000008c7b0000310b<br />
   Runtime Name: vmhba1:C0:T0:L10<br />
   Device: naa.60060e80058c7b0000008c7b0000310b<br />
   Device Display Name: HITACHI Fibre Channel Disk (naa.60060e80058c7b0000008c7b0000310b)<br />
   Adapter: vmhba1 Channel: 0 Target: 0 LUN: 10<br />
   Adapter Identifier: fc.3000001b3212c093:2100001b3212c093<br />
   Target Identifier: fc.60060e80058c7b45:50060e80058c7b45<br />
   Plugin: NMP<br />
   State: active<br />
   Transport: fc<br />
   Adapter Transport Details: WWNN: 22:00:00:1b:32:12:c0:93 WWPN: 23:00:00:1b:32:12:c0:93<br />
   Target Transport Details: WWNN: 55:06:0e:80:05:8c:7b:45 WWPN: 56:06:0e:80:05:8c:7b:45</p></blockquote>
<blockquote><p># rm andrew_lin2</p></blockquote>
<p>Delete the file andrew_lin2 by removing the # comment.</p>
<blockquote><p>echo -e &#8220;\n&#8221;</p></blockquote>
<p>Enter a line space.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2010/08/creating-rdm-to-lun-san-mapping-on-vmware-esx-4-vcenter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scripts to automate the process of identifying and compiling an RDM to LUN mapping list for VMware ESX 3.0</title>
		<link>http://www.gamescheat.ca/2009/10/scripts-to-automate-the-process-of-identifying-and-compiling-an-rdm-to-lun-mapping-list-for-vmware-esx-30/</link>
		<comments>http://www.gamescheat.ca/2009/10/scripts-to-automate-the-process-of-identifying-and-compiling-an-rdm-to-lun-mapping-list-for-vmware-esx-30/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 16:36:21 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[VMware ESX]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=481</guid>
		<description><![CDATA[In an earlier posting I listed a copy of the article explaining how to manually create a RDM to LUN mapping for VMware ESX. I have created scripts to completly automate this process, ftp the result and email the result file. Save the below commands in a file and make it executable. Name the file [...]]]></description>
			<content:encoded><![CDATA[<p>In an earlier posting I listed a copy of the article explaining <a href="http://www.gamescheat.ca/2009/10/how-to-identify-and-compile-an-rdm-to-lun-mapping-list-for-vmware-esx-30/">how to manually create a RDM to LUN mapping for VMware ESX</a>.  I have created scripts to completly automate this process, ftp the result and email the result file.</p>
<p>Save the below commands in a file and make it executable.  Name the file find-rdm.</p>
<blockquote><p><strong># Andrew Lin, 2009<br />
# This script identifies all VMware RDM disks and creates a second<br />
# script to identify the corresponding LUN to which the RDM is mapped.</p>
<p>find /vmfs/volumes -name **-rdm** | sed &#8216;s/-rdmp.vmdk/.vmdk/g&#8217; | sed &#8216;s/-rdm.vmdk/.vmdk/g&#8217; | sed &#8216;s/^/vmkfstools -q /g&#8217; > RDM-disk | chmod 645 RDM-disk</strong></p></blockquote>
<p>Here is an explanation of what the script does.</p>
<p><strong>find /vmfs/volumes -name **-rdm**</strong></p>
<p>This command will find all files in the directory /vmfs/volumes which have the characters -rdm.  These files are the RDM disks.  The result is then redirected to the next command with the pipe &#8216;|&#8217; sign.</p>
<p><strong>sed &#8216;s/-rdmp.vmdk/.vmdk/g&#8217;</strong></p>
<p>Sed is a special editor for modifying files automatically.  In this case I am modifying the result of the previous command before it is stored into a file. In the above example the /s means to substitute -rdmp.vmdk with .vmdk.  The /g means to substitute every occurance of the word -rdmp.vmdk that Sed finds, otherwise Sed will only change the first occurance of the word it finds.</p>
<p><strong>sed &#8216;s/-rdm.vmdk/.vmdk/g&#8217;</strong></p>
<p>some of the RDM files have the extension -rdm.vmdk, the -rdm needs to be stripped as well using the Sed command.</p>
<p><strong>sed &#8216;s/^/vmkfstools -q /g&#8217;</strong></p>
<p>The ^/ means the beginning of a line, in this case Sed will insert vmkfstools -q at the beginning of each line.</p>
<p><strong>> RDM-disk | chmod 645 RDM-disk</strong></p>
<p>The results of the previous commands is then redirect with the > symbol to the file RDM-disk.  The command chmod 645 RDM-disk will make the file executable.  You can now run this file from the command line and the raw device mapping to LUN will be displayed on screen, or redirecting the output to a file for later viewing.</p>
<p>I took the whole thing further by scheduling the scripts to run through a cron job and then upload the files to an ftp server.  My ftp server is a windows machine and I had the blat executable scehduled to email the file to me.</p>
<p>By default the ftp outbound ports are disabled on the VMware server, you will need to open up the outbound ports.  I have posted all the scripts and instructions required to fully automate this in other articles, here are the links:</p>
<p>(1) <a href="http://www.gamescheat.ca/2009/08/enable-outbound-ftp-ports-on-vmware-esx-server/">Open Ftp outbound ports on VMware server</a><br />
(2) <a href="http://www.gamescheat.ca/2009/08/blat-a-windows-command-line-utility-to-send-email-with-attachment/">Install and configure Blat</a><br />
(3) <a href="http://www.gamescheat.ca/2009/08/how-to-automate-ftp-login-and-file-transfer-with-bash-script/">Automate ftp upload of files</a></p>
<p>Note: When the script RDM-disk is scheduled through a cron job, then it must have root privileges, otherwise you will get no result.  Below is what my cron job looks like</p>
<p>00 8 * * * /scripts/find-rdm<br />
10 8 * * * /bin/su &#8211; root -c &#8220;/scripts/RDM-disk > /scripts/rdm-lun-mapping&#8221;<br />
20 8 * * * /scripts/ftp-scripts</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2009/10/scripts-to-automate-the-process-of-identifying-and-compiling-an-rdm-to-lun-mapping-list-for-vmware-esx-30/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to identify and compile a RDM to LUN mapping list for VMware ESX 3.0</title>
		<link>http://www.gamescheat.ca/2009/10/how-to-identify-and-compile-an-rdm-to-lun-mapping-list-for-vmware-esx-30/</link>
		<comments>http://www.gamescheat.ca/2009/10/how-to-identify-and-compile-an-rdm-to-lun-mapping-list-for-vmware-esx-30/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 15:27:56 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[VMware ESX]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=478</guid>
		<description><![CDATA[Below is a copy of the article from VMware knowledge base. It explains the steps to create the Raw Decive Mapping to Logical Unit Number. But is you have a VMserver with many virtual clients and LUNs attached, then this manual procedure can take hours. I have created scripts to automate this procedure and email [...]]]></description>
			<content:encoded><![CDATA[<p>Below is a copy of the article from VMware knowledge base.  It explains the steps to create the Raw Decive Mapping to Logical Unit Number.  But is you have a VMserver with many virtual clients and LUNs attached, then this manual procedure can take hours.  I have created scripts to <a href="http://www.gamescheat.ca/2009/10/scripts-to-automate-the-process-of-identifying-and-compiling-an-rdm-to-lun-mapping-list-for-vmware-esx-30/">automate</a> this procedure and email the mapping to me, here is the link to the article, <a href="http://www.gamescheat.ca/2009/10/scripts-to-automate-the-process-of-identifying-and-compiling-an-rdm-to-lun-mapping-list-for-vmware-esx-30/">http://www.gamescheat.ca/2009/10/scripts-to-automate-the-process-of-identifying-and-compiling-an-rdm-to-lun-mapping-list-for-vmware-esx-30/</a>. </p>
<p>******************************<br />
VI Client Might Incorrectly Display RDM LUNs in Physical Compatibility Mode as Available Disk when Storage Virtualization Devices Are Used</p>
<p>Details<br />
In an environment with storage virtualization devices (SVD), VI Client might incorrectly display RDM LUNs, which are in physical compatibility mode, as available disk in the Add Storage wizard. This situation can potentially cause data to be overwritten.</p>
<p>For more information on VMware&#8217;s support for SVD, see the Storage Compatibility Guide at www.vmware.com/pdf/vi3_san_guide.pdf.</p>
<p>Solution<br />
As a workaround for this issue, you must take special caution to ensure an empty LUN is selected for VMFS volume creation. The following instructions show you how to indentify and compile an RDM-to-LUN mapping list, which you should use to identify LUNs in use so they are not accidentally reused and overwritten.</p>
<p>If the underlying storage of your ESX Server system is virtualized with SVD technology, follow these procedures to recreate the RDM mapping files for the virtual machines. The procedure is broken into two parts:</p>
<p>Steps to Perform Before Virtualizing the LUNs<br />
Steps to Perform After LUN Virtualization<br />
Steps to Perform Before Virtualizing the LUNs</p>
<p>On an ESX Server host that has access to the RDMs and their corresponding LUNs (on the back-end storage), run the following commands to identify the physical LUNs mapped by each RDM: </p>
<p>Identify all RDM disks by running the following command in each of the virtual machines directories:</p>
<p>#ls /vmfs/volumes/x/y/*rdm*.vmdk | grep -v flat </p>
<p>Here, x is the VMFS volume and y is the virtual machine directory. </p>
<p>For example: </p>
<p># ls /vmfs/volumes/4*/*/*rdm*.vmdk | grep -v flat<br />
/vmfs/volumes/46fcea8f-77873c31-e474-001aa01e7ce5/solaris10/solaris10-rdmp.vmdk<br />
/vmfs/volumes/46fcea8f-77873c31-e474-001aa01e7ce5/DS_PT_SLES8/tt-rdm.vmdk </p>
<p>Based on the output from the above command, identify the corresponding LUN to which the RDM disk is mapped after removing -rdmp or -rdm from the file name: </p>
<p>#vmkfstools –q /vmfs/volumes/x/y/xxx.vmdk </p>
<p>In the above example, you can determine the LUN to which the RDM maps: </p>
<p># vmkfstools -q /vmfs/volumes/46fcea8f-77873c31-e474-001aa01e7ce5/solaris10/solaris10.vmdk </p>
<p>Disk /vmfs/volumes/46fcea8f-77873c31-e474-001aa01e7ce5/solaris10/solaris10.vmdk is a Passthrough Raw Device Mapping </p>
<p>Disk Id: vml.020000000060050768019002077000000000000005323134352020 </p>
<p>Maps to: vmhba1:0:0:0 </p>
<p>This output clearly shows solaris10.vmdk is mapped to LUN vmhba1:0:0:0. </p>
<p>Run the vmkfstools –q command for each RDM disk you identified in step 1. Keep track of all the LUNs to which the RDM disks map. Make sure they do not get selected as a target for VMFS volume creation.</p>
<p>Note: If you originally included &#8220;rdm&#8221; in the name for the RDM file (for example, Solaris10_rdm.vmdk), the above output might also show file names as Solaris10-rdm-rdmp.vmdk or tt_rdm-rdm.vmdk. You only need to remove the last -rdm (including the dash) from the file name when you use it with the vmkfstools -q command.<br />
Steps to Perform After LUN Virtualization<br />
Perform the following steps after the LUNs have been virtualized and presented to the ESX Server hosts according to the storage vendor&#8217;s VI3-specific documentation. </p>
<p>Power off all virtual machines. </p>
<p>Present the virtualized RDM LUN to the ESX Server host and perform a rescan. </p>
<p>Locate the virtual machine that has the RDM mapped to the back-end LUN (which is now virtualized). </p>
<p>Remove the stale RDM pointer from the VMFS3 volume. </p>
<p>Recreate the RDM to point to the virtualized LUN. Refer to the LUN-to-RDM correlation results in the first section, Steps to Perform Before Virtualizing the LUNs, above. Make sure to use the same RDM type as the original (that is, Virtual Mode or Physical Mode). </p>
<p>Repeat steps 1-5 for each RDM that was previously mapped to back-end storage. </p>
<p>Compile a list of RDM files and their corresponding LUNs (LUN-to-RDM correlation). Update this list whenever you add a new RDM.<br />
Warning: As described in the Details section (above), after you have completed the above steps for all RDMs, LUNs that are already used as RDM might show up as available disk when the Add Storage wizard is launched in the VI Client. If the virtual machine accessing the RDM is in a powered off state, and the RDM LUN is mistakenly selected as the disk for VMFS volume creation, then data loss could occur.</p>
<p>Caution: Always ensure an empty LUN is selected for VMFS volume creation. Prior to selecting the LUN in the wizard, use the LUN-to-RDM correlation list that you compiled in Steps to Perform After LUN Virtualization (above) to verify that the LUN you are going to use is not on the list.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2009/10/how-to-identify-and-compile-an-rdm-to-lun-mapping-list-for-vmware-esx-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable outbound FTP ports on VMware ESX server.</title>
		<link>http://www.gamescheat.ca/2009/08/enable-outbound-ftp-ports-on-vmware-esx-server/</link>
		<comments>http://www.gamescheat.ca/2009/08/enable-outbound-ftp-ports-on-vmware-esx-server/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 15:07:19 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[VMware ESX]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=431</guid>
		<description><![CDATA[The operating system on VMware ESX 3 is a striped down version of linux. It has only the bare necessities for VMware to function. I wanted to configure a cron job to email the log file, but because sendmail is not installed the mailto command did not work. I decided to write a script to [...]]]></description>
			<content:encoded><![CDATA[<p>The operating system on VMware ESX 3 is a striped down version of linux.  It has only the bare necessities for VMware to function.  I wanted to configure a cron job to email the log file, but because sendmail is not installed the mailto command did not work.</p>
<p>I decided to write a script to automatically upload the log file to an FTP server and then create a schedule on this FTP server to email the log.  In order to get this script working I had to open up outbound traffic on the firewall of the VMware ESX server.</p>
<p>The first thing I did was to open the outbound ports for FTP client.  You must connect to the command line interface via SSH  and login as root.  Then enter the commands below.</p>
<p><strong>esxcfg-firewall &#8211; -openPort 20,tcp,out,FTP<br />
esxcfg-firewall &#8211; -openPort 21,tcp,out,FTP<br />
esxcfg-firewall &#8211; -enableService ftpClient </strong></p>
<p>I then proceeded to test the outbound ftp connection.  The ftp authentication worked, I was connected to the remote server.  But the ls, dir, put commands would not work.  This is because these commands use dynamic ports.  </p>
<p>I had no choice but to disable all firewall policies for outbound connection to get the ftp client fully functional.  Here is the VMware ESX command that will disable all outbound firewall policies.</p>
<p><strong>esxcfg-firewall &#8211;allowoutgoing</strong></p>
<p>You will get the below warning message after the above command is executed.<br />
<em>2009-08-24 14:52:53 (31448) WARN :  Setting firewall default /firewall/blockOutgoing to 0</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2009/08/enable-outbound-ftp-ports-on-vmware-esx-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
