<?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>Thu, 26 May 2011 18:48:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>How to extend the filesystem on a Vmware ESX guest Red Hat Linux server</title>
		<link>http://www.gamescheat.ca/2011/05/how-to-extend-the-filesystem-on-a-vmware-esx-guest-red-hat-linux-server/</link>
		<comments>http://www.gamescheat.ca/2011/05/how-to-extend-the-filesystem-on-a-vmware-esx-guest-red-hat-linux-server/#comments</comments>
		<pubDate>Thu, 26 May 2011 18:48:10 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[VMware ESX]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=889</guid>
		<description><![CDATA[Being the administrator of a large Linux shop, I have had to extend the filesystems on the Red Hat Linux server a few times. Each time I had the opportunity to extend the filesystem, I found that I struggled to remember the commands and steps. This is because Linx is a very command line driven [...]]]></description>
			<content:encoded><![CDATA[<p>Being the administrator of a large Linux shop, I have had to extend the filesystems on the Red Hat Linux server a few times.  Each time I had the opportunity to extend  the filesystem, I found that I struggled to remember the commands and steps.  This is because Linx is a very command line driven operating system.  All right that is not completely true anymore, some variants of Linux have graphical interfaces.  Such as Red Hat has the graphical Logical Volume Manager (LVM), but I find the LVM to be buggy and unreliable at times. Personally I find it more reliable and easier to extend the filesystem using the command line interface.</p>
<p><strong>The sequence to extend the filesystem is as follow.</strong><br />
(1) Add the new disk.  In my case I was running Red Hat Enterprise 5 Linux as a guest operating system in Vmware ESX server.  I simply had to increase the disk size using the Vmware Vcenter interface, under edit setting, disk provisioning.  You will need to reboot the guest OS after to recognize the new disk size.</p>
<p>(2) Partition the new disk space using fdisk.</p>
<p>(3) Initialize the new partition, using the command pvcreate.  Run partprobe to update the kernel.</p>
<p>(4) Extend the existing volume group with the new partition using the command vgextend.</p>
<p>(5) Extend the existing logical volume group using lvextend.</p>
<p>(6) Grow the filesystem with the command resize2fs.</p>
<p><strong>Take a snapshot of the existing disks and to understand how they are partitioned.</strong><br />
The fdisk command will display the configuration of the existing disks. In this example there are two disks, a 10.7 GB /dev/sda and /dev/sdb which is 21.4 GB.  Disk sda has two partitions, sda1 and sda2. The second disk sdb has only one partition sdb1.</p>
<blockquote><p>
[root@linux_server ~]# fdisk -l</p>
<p>Disk /dev/sda: 10.7 GB, 10737418240 bytes<br />
255 heads, 63 sectors/track, 1305 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>  ice Boot      Start         End      Blocks   Id  System<br />
/dev/sda1   *           1          13      104391   83  Linux<br />
/dev/sda2              14        1305    10377990   8e  Linux LVM</p>
<p>Disk /dev/sdb: 21.4 GB, 21475491840 bytes<br />
255 heads, 63 sectors/track, 2610 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>  ice Boot      Start         End      Blocks   Id  System<br />
/dev/sdb1               1        2610    20964793+  8e  Linux LVM</p></blockquote>
<p>You also need to take a snapshot of how the partitions are allocated to the volume groups.  In the below example, the result of pvscan indicates that sda2 is mapped to the volume group VolGroup00.  But where is sda1?  Well sda1 is mapped to the /boot filesystem, you will see it when you issue the mount command.  You can also use the command pvs or pvdisplay instead of pvscan.</p>
<blockquote><p>[root@linux_server ~]# pvscan<br />
  PV /dev/sdb1   VG gfs_vg       lvm2 [19.99 GB / 8.99 GB free]<br />
  PV /dev/sda2   VG VolGroup00   lvm2 [9.88 GB / 0    free]<br />
  Total: 2 [29.84 GB] / in use: 2 [29.84 GB] / in no VG: 0 [0   ]</p></blockquote>
<p>The mount command will show you that /dev/sda1 is mounted as /boot.  In this example we will be extending the / (root) filesystem.</p>
<blockquote><p>[root@linux_server ~]# mount<br />
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)<br />
proc on /proc type proc (rw)<br />
sysfs on /sys type sysfs (rw)<br />
devpts on /dev/pts typepts (rw,gid=5,mode=620)<br />
/dev/sda1 on /boot type ext3 (rw)<br />
tmpfs on /dev/shm type tmpfs (rw)<br />
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)<br />
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)<br />
none on /sys/kernel/config type configfs (rw)<br />
/dev/mapper/gfs_vg-gfs_lv on /mnt/gfs type gfs2 (rw,noatime,nodiratime,hostdata=jid=0:id=196609:first=0)</p></blockquote>
<p><strong>Add the new disk or extend the existing disk in Vmware.</strong><br />
Expand the disk sda using the VMware Vcenter management console.  Under the summary tab of the guest server, go to edit settings &#8211; disk provisioning. Simply increase the disk size and then reboot the guest OS.</p>
<p><strong>Partition the disk</strong><br />
After the guest server has been rebooted it should see the size increment in sda.  You now need to partition the new disk space using the command fdisk.</p>
<blockquote><p>[root@linux_server ~]# fdisk /dev/sda</p>
<p>The number of cylinders for this disk is set to 2610.<br />
There is nothing wrong with that, but this is larger than 1024,<br />
and could in certain setups cause problems with:<br />
1) software that runs at boot time (e.g., old versions of LILO)<br />
2) booting and partitioning software from other OSs<br />
   (e.g., DOS FDISK, OS/2 FDISK)</p>
<p>Command (m for help): m  <strong>(select m to display the help screen)</strong><br />
Command action<br />
   a   toggle a bootable flag<br />
   b   edit bsd disklabel<br />
   c   toggle the dos compatibility flag<br />
   d   delete a partition<br />
   l   list known partition types<br />
   m   print this menu<br />
   n   add a new partition<br />
   o   create a new empty DOS partition table<br />
   p   print the partition table<br />
   q   quit without saving changes<br />
   s   create a new empty Sun disklabel<br />
   t   change a partition&#8217;s system id<br />
   u   change display/entry units<br />
   v   verify the partition table<br />
   w   write table to disk and exit<br />
   x   extra functionality (experts only)</p>
<p>Command (m for help): n <strong>(select n to add a new partition)</strong></p>
<p>Command action<br />
   e   extended<br />
   p   primary partition (1-4)<br />
p <strong>(select p to create a primary partition)</strong><br />
Partition number (1-4): 3 (enter 3 for partition number, we already know from the output of fdisk -l that sda1 and sda2 already exist, therefore the new partition will be sda3)</p>
<p>First cylinder (1306-2610, default 1306): <strong>(hit the enter key to accept the default)</strong><br />
Using default value 1306<br />
Last cylinder or +size or +sizeM or +sizeK (1306-2610, default 2610): <strong>(press the enter key to accept the default. You can also select something lower than 2610, if you do not want to use all available free disk space)</strong><br />
Using default value 2610</p>
<p>Command (m for help): t <strong>(select t to change the system id)</strong><br />
Partition number (1-4): 3 <strong>(select the new partition number)</strong><br />
Hex code (type L to list codes): 8e <strong>(Enter 8e which is the code for Linux LVM)</strong><br />
Changed system type of partition 3 to 8e <strong>(Linux LVM)</strong></p>
<p>Command (m for help): p <strong>(this will print the partition table, verify the changes you made)</strong></p>
<p>Disk /dev/sda: 21.4 GB, 21474836480 bytes<br />
255 heads, 63 sectors/track, 2610 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>  ice Boot      Start         End      Blocks   Id  System<br />
/dev/sda1   *           1          13      104391   83  Linux<br />
/dev/sda2              14        1305    10377990   8e  Linux LVM<br />
/dev/sda3            1306        2610    10482412+  8e  Linux LVM</p>
<p>Command (m for help): w <strong>(this will write the table tto disk committing it)</strong><br />
The partition table has been altered!<br />
Calling ioctl() to re-read partition table.<br />
WARNING: Re-reading the partition table failed with error 16:ice or resource busy.<br />
The kernel still uses the old table.<br />
The new table will be used at the next reboot.<br />
Syncing disks.</p>
<p>Note: <strong>(May have to hit enter to get command prompt back)</strong></p></blockquote>
<p><strong>Initialize the physical volume</strong><br />
Initialize the new physical volume with the command pvcreate /dev/sda3. If you have not rebooted the operating system after creating the new partition, then you will need to run partprobe for the kernel to recognize the new partition. Or else you will get an error.</p>
<blockquote><p>[root@linux_server ~]# pvcreate /dev/sda3<br />
 ice /dev/sda3 not found (or ignored by filtering).</p></blockquote>
<p>Run partrobe to update the kernel.</p>
<blockquote><p>[root@linux_server]# partprobe -s<br />
/dev/sda: msdos partitions 1 2 3<br />
/dev/sdb: msdos partitions 1</p></blockquote>
<p>Initialize the partition.</p>
<blockquote><p>[root@linux_server]# pvcreate /dev/sda3<br />
  Physical volume &#8220;/dev/sda3&#8243; successfully created</p></blockquote>
<p><strong>Add new physical volume to the volume group VolGroup00</strong><br />
The command vgdisplay will show you the specifics of the existing volume groups. Note the VG size is 9.88 GB. You can also use vgs and vgscan to display a different view of all volume groups.</p>
<blockquote><p>[root@linux_server ~]# vgdisplay<br />
  &#8212; Volume group &#8212;<br />
  VG Name               gfs_vg<br />
  System ID<br />
  Format                lvm2<br />
  Metadata Areas        1<br />
  Metadata Sequence No  7<br />
  VG Access             read/write<br />
  VG Status             resizable<br />
  Clustered             yes<br />
  Shared                no<br />
  MAX LV                0<br />
  Cur LV                2<br />
  Open LV               2<br />
  Max PV                0<br />
  Cur PV                1<br />
  Act PV                1<br />
  VG Size               19.99 GB<br />
  PE Size               4.00 MB<br />
  Total PE              5118<br />
  Alloc PE / Size       2816 / 11.00 GB<br />
  Free  PE / Size       2302 / 8.99 GB<br />
  VG UUID               ws74W5-bejg-UUqe-ReFJ-ip6i-4Ixy-CAKkDC</p>
<p>  &#8212; Volume group &#8212;<br />
  VG Name               VolGroup00<br />
  System ID<br />
  Format                lvm2<br />
  Metadata Areas        1<br />
  Metadata Sequence No  3<br />
  VG Access             read/write<br />
  VG Status             resizable<br />
  MAX LV                0<br />
  Cur LV                2<br />
  Open LV               2<br />
  Max PV                0<br />
  Cur PV                1<br />
  Act PV                1<br />
  VG Size               9.88 GB<br />
  PE Size               32.00 MB<br />
  Total PE              316<br />
  Alloc PE / Size       316 / 9.88 GB<br />
  Free  PE / Size       0 / 0<br />
  VG UUID               KxKjSV-yOQl-T0gR-vse1-Z0RO-nJfM-FQxMZ0</p></blockquote>
<p>Add sda3 to VolGroup00</p>
<blockquote><p>[root@linux_server]# vgextend /dev/VolGroup00 /dev/sda3<br />
  Volume group &#8220;VolGroup00&#8243; successfully extended</p>
<p>Note that the VG size has increased to 19.84 GB.<br />
[root@linux_server]# vgdisplay<br />
  &#8212; Volume group &#8212;<br />
  VG Name               gfs_vg<br />
  System ID<br />
  Format                lvm2<br />
  Metadata Areas        1<br />
  Metadata Sequence No  7<br />
  VG Access             read/write<br />
  VG Status             resizable<br />
  Clustered             yes<br />
  Shared                no<br />
  MAX LV                0<br />
  Cur LV                2<br />
  Open LV               2<br />
  Max PV                0<br />
  Cur PV                1<br />
  Act PV                1<br />
  VG Size               19.99 GB<br />
  PE Size               4.00 MB<br />
  Total PE              5118<br />
  Alloc PE / Size       2816 / 11.00 GB<br />
  Free  PE / Size       2302 / 8.99 GB<br />
  VG UUID               ws74W5-bejg-UUqe-ReFJ-ip6i-4Ixy-CAKkDC</p>
<p>  &#8212; Volume group &#8212;<br />
  VG Name               VolGroup00<br />
  System ID<br />
  Format                lvm2<br />
  Metadata Areas        2<br />
  Metadata Sequence No  4<br />
  VG Access             read/write<br />
  VG Status             resizable<br />
  MAX LV                0<br />
  Cur LV                2<br />
  Open LV               2<br />
  Max PV                0<br />
  Cur PV                2<br />
  Act PV                2<br />
  VG Size               19.84 GB<br />
  PE Size               32.00 MB<br />
  Total PE              635<br />
  Alloc PE / Size       316 / 9.88 GB<br />
  Free  PE / Size       319 / 9.97 GB<br />
  VG UUID               KxKjSV-yOQl-T0gR-vse1-Z0RO-nJfM-FQxMZ0</p></blockquote>
<p><strong>Extend the Logical Volume Group /dev/VolGroup00/LogVol00 which is mounted as the root filesystem.</strong><br />
Display the specifics for all logical volume with lvdisplay.  You can also use lvscan or lvs to display a summarized view.</p>
<blockquote><p>[root@linux_server]# lvdisplay<br />
  &#8212; Logical volume &#8212;<br />
  LV Name                /dev/gfs_vg/gfs_lv<br />
  VG Name                gfs_vg<br />
  LV UUID                NZrcfq-6Shf-z5cZ-fWJM-fQVi-wOTa-kPhUVG<br />
  LV Write Access        read/write<br />
  LV Status              available<br />
  # open                 1<br />
  LV Size                10.00 GB<br />
  Current LE             2560<br />
  Segments               1<br />
  Allocation             inherit<br />
  Read ahead sectors     auto<br />
  &#8211; currently set to     256<br />
  Blockice           253:2</p>
<p>  &#8212; Logical volume &#8212;<br />
  LV Name                /dev/gfs_vg/quorum_lv<br />
  VG Name                gfs_vg<br />
  LV UUID                Pr27bq-X1AM-U6WC-ceJd-dlIu-AipK-pFRfAE<br />
  LV Write Access        read/write<br />
  LV Status              available<br />
  # open                 1<br />
  LV Size                1.00 GB<br />
  Current LE             256<br />
  Segments               1<br />
  Allocation             inherit<br />
  Read ahead sectors     auto<br />
  &#8211; currently set to     256<br />
  Blockice           253:3</p>
<p>  &#8212; Logical volume &#8212;<br />
  LV Name                /dev/VolGroup00/LogVol00<br />
  VG Name                VolGroup00<br />
  LV UUID                n4QGnw-R9Wj-RHXU-Q1QO-X2aa-vKdx-Js3fwp<br />
  LV Write Access        read/write<br />
  LV Status              available<br />
  # open                 1<br />
  LV Size                8.88 GB<br />
  Current LE             284<br />
  Segments               1<br />
  Allocation             inherit<br />
  Read ahead sectors     auto<br />
  &#8211; currently set to     256<br />
  Blockice           253:0</p>
<p>  &#8212; Logical volume &#8212;<br />
  LV Name                /dev/VolGroup00/LogVol01<br />
  VG Name                VolGroup00<br />
  LV UUID                qqyXcr-nys3-K7MO-LsbU-5CL8-d2hR-MyliKF<br />
  LV Write Access        read/write<br />
  LV Status              available<br />
  # open                 1<br />
  LV Size                1.00 GB<br />
  Current LE             32<br />
  Segments               1<br />
  Allocation             inherit<br />
  Read ahead sectors     auto<br />
  &#8211; currently set to     256<br />
  Blockice           253:1</p></blockquote>
<p>Extend /dev/VolGroup00/LogVol00 using lvextend. The option -l +100%FREE will use up all available disk space.  You can also specify the size with the option -L18G, which will extend the logical volume to 18 GB. The option -L+1G will add another gigabyte to the logical volume.</p>
<blockquote><p>[root@linux_server]# lvextend -l +100%FREE /dev/VolGroup00/LogVol00<br />
  Extending logical volume LogVol00 to 18.84 GB<br />
  Logical volume LogVol00 successfully resized</p></blockquote>
<p><strong>Extend the filesystem</strong><br />
We are almost done, the last step is to extend the filesystem.</p>
<p>Record the size of the existing filesystems with the df -h command.</p>
<blockquote><p>[root@linux_server]# df -h<br />
Filesystem            Size  Used Avail Use% Mounted on<br />
/dev/mapper/VolGroup00-LogVol00<br />
                      8.6G  8.0G  205M  98% /<br />
/dev/sda1              99M   19M   75M  21% /boot<br />
tmpfs                 490M     0  490M   0% /dev/shm<br />
/dev/mapper/gfs_vg-gfs_lv<br />
                      9.8G  584M  9.2G   6% /mnt/gfs</p></blockquote>
<p>Expand the filesystem /dev/mapper/VolGroup00-LogVol00 which is mounted on /. The command resize2fs can be used to enlarge or shrink ext2 or ext3 filesystems that are unmounted. On Linux kernel version that is equal or greater than 2.6, resize2fs can expand a mounted ext3 filesystem only.</p>
<blockquote><p>[root@linux_server]# resize2fs /dev/mapper/VolGroup00-LogVol00<br />
resize2fs 1.39 (29-May-2006)<br />
Filesystem at /dev/mapper/VolGroup00-LogVol00 is mounted on /; on-line resizing required<br />
Performing an on-line resize of /dev/mapper/VolGroup00-LogVol00 to 4939776 (4k) blocks.<br />
The filesystem on /dev/mapper/VolGroup00-LogVol00 is now 4939776 blocks long.</p></blockquote>
<p>Verify that /dev/mapper/VolGroup00-LogVol00 has increased in size.</p>
<blockquote><p>[root@linux_server]# df -h<br />
Filesystem            Size  Used Avail Use% Mounted on<br />
/dev/mapper/VolGroup00-LogVol00<br />
                       19G  8.0G  9.4G  46% /<br />
/dev/sda1              99M   19M   75M  21% /boot<br />
tmpfs                 490M     0  490M   0% /dev/shm<br />
/dev/mapper/gfs_vg-gfs_lv<br />
                      9.8G  584M  9.2G   6% /mnt/gfs</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2011/05/how-to-extend-the-filesystem-on-a-vmware-esx-guest-red-hat-linux-server/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>How to map to a remote NFS directory from a VMware ESX 4 server.</title>
		<link>http://www.gamescheat.ca/2010/11/how-to-map-to-a-remote-nfs-directory-from-a-vmware-esx-4-server/</link>
		<comments>http://www.gamescheat.ca/2010/11/how-to-map-to-a-remote-nfs-directory-from-a-vmware-esx-4-server/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 12:00:02 +0000</pubDate>
		<dc:creator>Andrew Lin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[VMware ESX]]></category>

		<guid isPermaLink="false">http://www.gamescheat.ca/?p=842</guid>
		<description><![CDATA[I ran into this error while trying to mount a NFS directory on a remote server from my Vmware ESX4 server. My Vmware esx server is called esx4-server and the remote NFS server is called remote-server. I executed the mount commant and got the below error. [root@esx4-server /]# mount -t nfs remote-server:/home/andrew/mnt mount.nfs: Input/output error [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into this error while trying to mount a NFS directory on a remote server from my Vmware ESX4 server.  My Vmware esx server is called esx4-server and the remote NFS server is called remote-server.<br />
I executed the mount commant and got the below error.<br />
<strong>[root@esx4-server /]# mount -t nfs remote-server:/home/andrew/mnt<br />
mount.nfs: Input/output error</strong><br />
I then decided to use the -v (verbose) option for mount.  This will list the mounting process in verbose, it is better for troubleshooting.<br />
<strong>[root@esx4-server /]# mount -vt nfs remote-server:/home/andrew/mnt<br />
mount: trying 192.20.66.88 prog 100003 vers 3 prot tcp port 2049<br />
mount: trying 192.20.66.88 prog 100005 vers 3 prot udp port 32794<br />
mount.nfs: Input/output error</strong></p>
<p>I then checked the log files for more information, and below are the messages I saw.<br />
<strong>[root@esx4-server /]# cat /var/log/messages<br />
Oct 26 10:32:30 esx4-server vobd: Oct 26 10:32:30.936: 159470608100us: [esx.problem.vmfs.nfs.mount.connect.failed] Failed to mount to server 192.20.66.88 mount point /VMLibrary/. Error: Unable to connect to NFS server.<br />
Oct 26 11:36:50 esx4-server kernel: [162970.448490] portmap: server localhost not responding, timed out<br />
Oct 26 11:36:50 esx4-server kernel: [162970.453525] RPC: failed to contact portmap (errno -5).</strong><br />
From the log file I was able to determine that the pormap service was not started. It is required to map to a remote NFS directory.  I then proceeded with starting the protmap service.<br />
service portmap start</p>
<p>To esure that the service starts automatically when the server reboots use the below command.<br />
<strong>chkconfig portmap on</strong><br />
You may also have to stop the firewall service on the esx server with the command <strong>service firewall stop</strong>.  To prevent it from starting after a reboot, <strong>chkconfig firewall off</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gamescheat.ca/2010/11/how-to-map-to-a-remote-nfs-directory-from-a-vmware-esx-4-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>3</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>2</slash:comments>
		</item>
	</channel>
</rss>

