Skip to main content
Delphix

Determining VMDK - SCSI controller and Target Mapping in ESXCLI for Delphix VMs (Masking, Reporting, or Virtualization) (KBA1123)

 

 

The majority of VMware administrative tasks are completed through vSphere desktop or web client. It is sometimes required to determine current device configuration via ESXCLI.

This document reviews the methodology for determining disk mapping using ESXCLI, for the purposes of Delphix troubleshooting.  For example, determining the SCSI virtual controller and target ID configured for a given storage device, to correlate with what the VM has detected or configured.

 

Note

Note:

This document is not intended to replace VMware references. It is recommended to consult a VMware admin/ VMware Support should be if the output collected does not match the formats discussed.

The examples below references a Delphix Reporting VM (formerly known as Mission Control). Note that the process is identical for all Delphix platforms and versions released.

Example & Methodology

This example uses a virtual machine with the following configuration:

  • 1x Delphix Reporting VM, with default OVA deployment (1 root disk)
  • 2x additional SCSI disks added, 2GB and 3GB

To determine VMDK - SCSI controller and Target Mapping 

  1. Determine the VM world ID using vim-cmd vmsvc/getallvms | grep <VM name>
    The left-most column provides the world ID. 

For this example, look for VM named seanmc, which is indicated by world ID 33778.

[root@delong:~] vim-cmd vmsvc/getallvms | grep sean
Skipping invalid VM '28866'
Skipping invalid VM '32605'
33544   sean5220                         [zfs_sean5220] dlpx-5.2.2.0-562-61155cf8/dlpx-5.2.2.0-562-61155cf8.vmx                                         solaris10_64Guest       vmx-08    Delphix Engine Version 5.2.2.0, VM Hardware Version 8
33778   seanmc                           [zfs_seanmc] delphix-reporting-1.4.2.0/delphix-reporting-1.4.2.0.vmx                                           centos64Guest           vmx-07              

  1. With the relevant world ID, list all configured devices with vim-cmd vmsvc/device.getdevices <world id>
    The resulting output will be multiple pages long depending on the configuration and the sections of concern have the following headings:
vim.vm.device.VirtualLsiLogicController
vim.vm.device.VirtualDisk

As the titles suggest these sections of output provide the detail for each virtual SCSI controller and virtual disk respectively.  The relevant information can be obtained from the output of vim-cmd for a more concise display using grep.

The following command details this (assuming world ID is retrieved in Step 1):

vim-cmd vmsvc/device.getdevices 33778 | egrep '(vim.vm.device.VirtualLsiLogicController|key|label|vim.vm.device.VirtualDisk|fileName|datastore|controllerKey|unitNumber|capacityInKB|uuid)'

Although additional device output beyond the SCSI controller and disk(s) will be returned, this will provide a summarized view of the current device mappings, extracted below:   

...
      (vim.vm.device.VirtualLsiLogicController) {
         key = 1000, 
            label = "SCSI controller 0", 
         controllerKey = 100, 
         unitNumber = 3, 
      (vim.vm.device.VirtualLsiLogicController) {
         key = 1001, 
            label = "SCSI controller 1", 
         controllerKey = 100, 
         unitNumber = 4, 
         key = 3002, 
            label = "CD/DVD drive 1", 
         controllerKey = 201, 
         unitNumber = 0
      (vim.vm.device.VirtualDisk) {
         key = 2000, 
            label = "Hard disk 1", 
         backing = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {
            fileName = "[zfs_seanmc] delphix-reporting-1.4.2.0/delphix-reporting-1.4.2.0.vmdk", 
            datastore = 'vim.Datastore:10.42.0.1:/dcenter/seanmc', 
            uuid = "6000C298-0c98-ea0a-0c86-565befc31fcd", 
            parent = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) null, 
         controllerKey = 1000, 
         unitNumber = 0, 
         capacityInKB = 52428800, 
         vFlashCacheConfigInfo = (vim.vm.device.VirtualDisk.VFlashCacheConfigInfo) null, 
      (vim.vm.device.VirtualDisk) {
         key = 2016, 
            label = "Hard disk 2", 
         backing = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {
            fileName = "[zfs_seanmc] delphix-reporting-1.4.2.0/delphix-reporting-1.4.2.0_1.vmdk", 
            datastore = 'vim.Datastore:10.42.0.1:/dcenter/seanmc', 
            uuid = "6000C295-e11e-25b0-9add-590b91edad26", 
            parent = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) null, 
         controllerKey = 1001, 
         unitNumber = 0, 
         capacityInKB = 2097152, 
         vFlashCacheConfigInfo = (vim.vm.device.VirtualDisk.VFlashCacheConfigInfo) null, 
      (vim.vm.device.VirtualDisk) {
         key = 2017, 
            label = "Hard disk 3", 
         backing = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {
            fileName = "[zfs_seanmc] delphix-reporting-1.4.2.0/delphix-reporting-1.4.2.0_2.vmdk", 
            datastore = 'vim.Datastore:10.42.0.1:/dcenter/seanmc', 
            uuid = "6000C295-5a4b-8904-2724-9fc58a011cbb", 
            parent = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) null, 
         controllerKey = 1001, 
         unitNumber = 1, 
         capacityInKB = 3145728,    
...
  1. The above output determines:
  • There are two configured SCSI controllers
    • SCSI controller 0, with key 1000
    • SCSI controller 1, with key 1001
  • There are three virtual disk devices configured
    • Virtual Disk "Hard disk 1", ~50GB in size, provisioned to SCSI controller 0 (key 1000), and unitNumber (target) 0
    • Virtual Disk "Hard disk 2", ~2GB in size, provisioned to SCSI controller 1 (key 1001), and unitNumber (target) 0
    • Virtual Disk "Hard disk 3", ~3GB in size, provisioned to SCSI controller 1 (key 1001), and unitNumber (target) 1
  • The fileName parameter provides the relevant VMDK file location

Additional information can be determined if needed from the complete command output, but for this example the output captured is reduced to focus on controller and target numbers.