Quantcast
Channel: vStable.com» Virtualization
Viewing all articles
Browse latest Browse all 10

Refresher: Mounting a CDROM in ESXi 4.1 and ESXi 5 (vsish)

$
0
0

Not having the legacy Service Console found in ESX adds a additional complexity to some administrative tasks performed on ESXi hypervisors. One such task is mounting a CDROM or DVD directly to an ESXi console session (busybox). You might be wondering why one would want to mount a disc to the console session? Consider a scenario where you want to copy an ISO file from a local CDROM or DVD to a VMFS datastore attached to the same ESXi host (via FC, iSCSI, or local storage) at a remote location; you can simply ship a CDROM/DVD containing the raw ISO file to the remote location and use the instructions below to copy the ISO to a VMFS Datastore where it can then be mounted by Virtual Machines. By mounting the CDROM directly in the ESXi console you can issue standard Unix copy commands to move files from a CDROM disc over to a VMFS datastore.

The first task that needs to be done is to load the ISO9660 kernel module. Without the module loaded you will not be able to mount the CDROM drive. You can check to see if the module is already loaded by running vmkload_mod -l and check to see if you have an entry in the loaded modules labelled “iso9660″. If the module is not listed in the output you will need to run the following command to load the kernel module (note: the iso9660 module will likely not be loaded):

# vmkload_mod iso9660

The command will return “Module iso9660 loaded successfully” if the kernel module loaded properly.

Now that the kernel module is loaded you can now issue the command to mount the CDROM. In ESXi, the command “vsish” is used to mount a CDROM. However, vsish uses the CDROM drive Device Path as an input so you must obtain the Device Path first. The easiest way to obtain the CDROM drive Device Path is to run the esxcfg-mapth command and grep the specific information:

# esxcfg-mpath -l | grep -i cd-rom

If your CDROM drive was detected as a device during the ESXi boot process the above command should look similar to “Device Display Name: Local TSSTcorp CD-ROM (mpx.vmhba0:C0:T0:L0)”. The important part is not the brand name information but the information that begins with “mpx”. In the example provided here, the device path I will use in the vsish command is “mpx.vmhba0:C0:T0:L0″.

Now issue the vsish command to mount the CDROM:

# vsish -e set /vmkModules/iso9660/mount mpx.vmhba0:C0:T0:L0

It’s that simple. After the above command is issued you will now see the CDROM disc label in /vmfs/volumes. You can now copy files directly from the CDROM to a VMFS datastore using simple Unix cp commands. Interacting with the CDROM drive is just like interacting with standard Datastores available in the /vmfs/volumes path.

To cleanup, just issue the below commands to unmount (note: its umount not unmount) and unload the vmkernel module:

# vsish -e set /vmkModules/iso9660/umount mpx.vmhba0:C0:T0:L0
# vmkload_mod -u iso9660

The last item to note is that all of the above processes can be done without impacting Virtual Machines running on the ESXi host. Additionally, this process has been tested on ESXi 4.1 and later.


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images