Number of RDM

We implement a Microsoft Cluster on two physical hosts in vSphere 5.  So that two virtual machines can access the shared storage, we must create a RDM and assign a unique SCSI controller.  I noticed that there are only four SCSI controllers (marked 0, 1, 2, 3).  SCSI controller 0:0 is used by the host operating system.

This means that we can have 3 RDMs in our cluster?  (1:0, 2:0, 3:0)  One of those is used by the quorum disk, then that leaves 2 available for actual data Lun?  Is this correct?

Every RDM does not have its own controller.  You must just separate controllers from the one used for the operating system (because she needs a different setting).

Tags: VMware

Similar Questions

  • Maximum number of RDM by VM

    Hello

    I wonder if there is a Maximum, or a better Board practice, how many RDM could be added to a virtual machine.

    Currently I have a VM with 8 RDM in physical mode, but in the future I could be in use of up to 20 of RDM.

    If there is a paper on this issue, I'd be happy if someone coul direct me there.

    Hello

    Here are the maximum rates of VM, you can add up to 60 easily.

    SCSI controllers per virtual machine 4

    Devices per SCSI 15 controller

    Devices per virtual machine (Windows) 60

    Devices per virtual machine (Linux) 60

    Thank you

    Samir

    PS: If you think the answer is useful please consider rewarding points.

  • Problem with sh scripts on ESXi 5

    I recently had to solve some problems with delays during renumerisations and restarts due to RDM which is attached to a host ESXi 5 discs. See this article for details http://kb.vmware.com/selfservice/microsites/search.do?language=en_US & cmd = displayKC & externalId = 1016106. Since I had a large number of RDM disks and needed to run the commands on each host I thought that I would write a script. I created the following scripts (just a subset here), but are there problems when it runs:

    Perennial.sh

    esxcli storage device base setconfig d naa.60000970000292600424533033434642 - perpetually reserved = true
    esxcli storage device base setconfig d naa.60000970000292600424533033434643 - perpetually reserved = true
    esxcli storage device base setconfig d naa.60000970000292600424533033443041 - perpetually reserved = true
    esxcli storage device base setconfig d naa.60000970000292600424533033443133 - perpetually reserved = true

    and

    perennial_verify.sh

    esxcli storage device base list d naa.60000970000292600424533033434642 > > storage_list.txt
    esxcli storage device base list d naa.60000970000292600424533033434643 > > storage_list.txt
    esxcli storage device base list d naa.60000970000292600424533033443041 > > storage_list.txt
    esxcli storage device base list d naa.60000970000292600424533033443133 > > storage_list.txt

    I put the files on a data store and gave them execute permissions and they seem to work, however when I run the scripts, they give an error at the end of running something on command not found or something. It does not run all the commands as well. Finally, when the perennial_verify.sh is run more than once something happens in the file storage_list.txt - he had me puzzed for awhile - he showed that the file was different from zero in size, but when I did a cat or less that he would say that the file is not found. Finally I tried to copy the file down in the browser of data store and found that there was a printable character appended to the end - possibly a return carraiage. Now I can not rename the file or delete it - it is impossible to remove. If anyone has any advice on running sh scripts and the correct way to pipe the output to a file I know you more.

    Thank you

    Ed

    What is the exact error do you receive when you try to delete?

    Rather than redirect the output for each order, simply redirect the script in the log file, which will capture the entire script.

    ./perennial_verify.sh > storage_list.txt

  • How to get the number of LUN to physical RDM assigned to VM?

    Hi people,

    Is it possible to get the LUN ID or number of a RDM physical disk attached to a virtual from Windows using PowerCLI machine?

    Thank you.

    Hi Albert,

    the first PowerCLI script will give the LUN ID or the number of physical RDM disks attached to a virtual machine for ESX 3.5 servers:

    Get-VM | `
    Get-HardDisk | `
    Where-Object {$_.DiskType -eq "RawPhysical"} | `
    Select-Object -Property @{N="VM";E={$_.Parent}},
      @{N="HardDisk";E={$_.Name}},
      @{N="Lun";E={$_.ScsiCanonicalName.Split(":")[-1]}}
    

    The second script PowerCLI will give you the LUN ID or number of a RDM physical disk attached to a virtual machine for 4 ESX servers:

    Get-VM | `
    Get-HardDisk | `
    Where-Object {$_.DiskType -eq "RawPhysical"} | `
    Select-Object -Property @{N="VM";E={$_.Parent}},
      @{N="HardDisk";E={$_.Name}},
      @{N="Lun";E={
        $HardDisk = $_
        $lun = Get-VMHost -VM $_.Parent | `
          Get-ScsiLun -LunType Disk | `
          Where-Object {$_.CanonicalName -eq $HardDisk.ScsiCanonicalName}
        [int](Select-String ":L(?\d+)$" `
            -InputObject $lun.RuntimeName).Matches[0].Groups['lunID'].Value
      }}
    

    Thanks to Luke for his blog post the making of a New VIProperty called Monday who gave me the idea for the regular expression.

    Best regards, Robert

    Post edited by: RvdNieuwendijk

  • Add a number of unit logic RAW (RDM) twice in the same VM.

    Hello

    I would like to know if it is possible to add a LUN RAW (RDM) twice inside the virtual machine?

    The idea is to perform a simulation for the Linux Multipath and why I think is necessary see the same disk/LUN twice...

    Any comment or idea will be appreciated.

    Kind regards

    Victor.

    You cannot add twice same LUN to a virtual machine. You can add different LUNS on the same data store.

  • How to set the number of unit and its maximum value in RDMS

    Hello

    I am trying to add RDM vsphere sdk using the code to return the controller below key and the unitNumber:

    public static int[] getFreeDevice (VirtualMachine vMachine, String deviceName) { }

    VirtualDevice [] vDevice = vMachine.getConfig () .getHardware () .getDevice ();

    System.out.println ("DPS->" + dps.length);

    int [retVal] = new int[2];

    for (VirtualDevice vd: vDevice) { }

    if (vd instanceof VirtualSCSIController) { }

    Vscsic = (VirtualSCSIController) vd VirtualSCSIController;

    retVal [0] = vscsic.getKey ();

    retVal [1] = vscsic.getDevice ().

    length +1 ;

    if (retVal [1] == 7)

    retVal [1] = retVal [1] + 1;

    return retVal;

    }

    }

    return null;

    }

    can someone tell me please:

    1 how to get units available, for example for example: 0-15

    2. how to get/set the limit (15)

    3. how to do ROW when the unitNumber reached 15

    4. how to ROW with the next value as SCSI1:0, after reached SCSI0:15

    Thanks in advance.

    Rohit

    Hello

    have you tried manually in your environment in order to add the new controller scsi as "scsi controller 1" for VM? First, try manually, then make sure that the scsi controller option is allow to add a scsi controller more for VM.

    And in your code

    scsiCtrl.setBusNumber (0); I think that the scsi controller 0 is already set. This is so it will be like this scsiCtrl.setBusNumber (1);

    scsiCtrl.setControllerKey (1000); This line will not come because after you add the scsi controller, it will generate key controller. It is not depends on user option

    Apart from that, I think that some description and label is not necessary.

    Thank you

  • Condition of ODA on certain RDM LUN

    My colleague has moved some virtual machines off the coast of our 4.0, new versions of vmware ESX hosts. These VMS had RDM on the hosts. The RDM LUNS were registered hosts, without using the LUN masking procedures. This leaves the RDM LUN in ODA / all the paths to the bottom of the State. There's no issues yet, but I am aware that ODA can cause hosts to have problems with the service pass., disconnect such as vmware, VMs lock etc.  I was wondering the best way to fix this. I am aware that reboot the host can fix it. My question is, are at - it another way to remove the RDM LUN, who are now in a State of ODA?

    I guess you ask about cleaning right after that LUN is "registered" host on fabric or on the table.

    Restart the host should certainly clean it.

    If you can't restart then check this post of Cormac Hogan: best practices: how to properly remove a unit number logic of a host ESX - VMware vSphere Blog - VMware Blogs

    It should give you an idea and some tips on how to clean it properly.

    I hope this helps.

  • How to get space disc + space of a computer virtual RDM

    Hi all

    I would like to know, used by the two RDM + VMDK VM hard drive space

    I get the details using the script below

    Get - VM | Get-hard drive |

    Select @{N = "Name VM"; E={$_. Parent.Name}},

    @{N = 'IP address'; E={@($_. (Parent.guest.IPAddress[0])}},

    @{N = "VM PowerState"; E={@($_. Parent.PowerState)}}.

    @{N = "number of CPU"; E={@($_. Parent.NumCPU)}}.

    @{N = "MemoryInGB"; E={@($_. Parent.MemoryGB)}}.

    @{N = 'Cluster'; E = {Get-Cluster - VM $_.} Parent}},

    @{N = "ESX host"; E = {Get-VMHost - VM $_.} Parent}},

    @{N = 'File'; E={$_. Parent.Folder.Name}},

    @{N = "HD capability"; E={$_. CapacityGB}},

    @{N = "Datastore"; {E = {Get-Datastore - VM $_}},

    I'm looking for an output similar as below

    VM name IP address VM PowerState CPU Count MemoryinGB Cluster ESXHost Capacity(VMDK+RDM) HD Datastore folder

    VM1 10.10.10.10 receptor 4 8 ABC 11.11.11.11 2048 data store 1

    VM210.10.10.11Receptor48ABC ABC 11.11.11.13 3096Data store 2

    If you want just the size of the configured disk (i.e. not the amount actually used)

    Get - VM |

    Select @{N = "Name VM"; E={$_. Name}},

    @{N = 'IP address'; E = {@($_.guest.) (IPAddress[0])}},

    @{N = "VM PowerState"; E={@($_. PowerState)}}.

    @{N = "number of CPU"; E={@($_. NumCPU)}}.

    @{N = "MemoryInGB"; E={@($_. MemoryGB)}}.

    @{N = 'Cluster'; {E = {Get-Cluster - VM $_}},

    @{N = "ESX host"; {E = {Get-VMHost - VM $_}},

    @{N = 'File'; E={$_. Folder.Name}},

    @{N = "HD capability"; E = {[Math]: round (((Get-disque dur-VM $_ |))} Measure-Object-CapacityGB property-sum). (Sum), 2)}},

    @{N = "Datastore"; {E = {Get-Datastore - VM $_}}

  • See the number of paths per LUN by host

    Hello

    I saw so many scripts these days on how to check my connections of storage, but I still don't get the info for that I'm looking. I'd like to see for each host for each LUN (RDM / Datastore) the number of paths. I found scripts that show me the active paths, paths of deaths and work, but none of them helps me to see the number of paths for each host.

    The following Luke good script seems to be a good starting point, but again once it shows total by hba, that I need for each host per lun.

    $esx = get-VMHost vcdvm580.virtualcenter.lan

    foreach ($hba to (VMHostHba Get - VMHost $esx - type "FibreChannel")) {}

    $target = ((get - see $hba. VMhost). Config.StorageDevice.ScsiTopology.Adapter | where {$_.} Adapter - eq $hba. Key}). Goal

    $luns = get-ScsiLun - Hba $hba - LunType 'disk '.

    $nrPaths = ($target | % {$_.}) Lun.Count} | Measure - Object - sum). Sum

    Write-Host $hba. Device ' target: ' $target. County "devices:" $luns. County ' path: ' $nrPaths

    }

    Any help would be appreciated.

    Gabrié

    You mean something like this?

    $esxName = "MyEsx".

    $esx = get-VMHost-name $esxName

    $esxcli = get-EsxCli - VMHost $esxName

    $hba = get-VMHostHba - VMHost $esx - type FibreChannel | Select the name of ExpandProperty-

    $esxcli.storage.core.path.list () |

    Where {$hba - contains $_.} Adapter} |

    Group-object - property feature |

    Select @{N = "MON"; E={$_. Name}},@{N='#path'; E={$_. Group.Count}}

  • Serial number different VPD when using MSCS for pRDM

    Hello

    I'm trying to set up a cluster across boxes using VSphere 5.5 SQL update 2 and R2 Windows Server 2012. Following supported and recommended configuration, but met with a blocker. The RDM are presented to the two guests (power off). When online, the disks are configured and can be used by both hosts respectively. No apparent problems. However, when run the failover cluster validation, CAE serial number is different on the guests. Page 83: UUID is the same but the serial number is different. I think that it is the information on page 80 h. This can be changed? Why is it different for the same LUN presented as shared storage. The logical unit number ID is the same on each host. Failover cluster considers different disks as a result. Any help would be greatly appreciated.

    Thank you

    Jonathan

    Quick update - we have updated our 3rd host to ESXi 5.5 Update 2 and fixed a minor issue of memory on host 2. Has also had a PCIe bus failure that has been resolved by reinstalling the risers. After all this, the CAE now reports the correct serial number. Still no idea what was causing the problem but thankful it is now resolved. Maybe the multiple reboots and the PCIe bus failure could be a cause.

    Thank you

    Jonathan

  • Cannot add to the second VM so once added to a machine virtual of RDM

    Dear Experts,

    In our environment of Esxi 5.0 U2, on a single physical host of Esxi, I created two virtual machines to Win 2008R2, I don't have any MSCS cluster. I created a LUN and presented to the host, the size of the logical unit number is 10 GB. I've added it to VM1 as RDM (virtual) and it is perfectly correct, I'm able to see in windows. When I tried the same add RDM of VM2, I found the choice of the RDM is grayed out, why is, it is not possible to allow 2 virtual machines see same RDM?

    I've attached screenshots to understand how it looks. The SCSI bus sharing on VM_1, I chose virtual to share a "vdisk" between VMS in same host, but that did not help either, I realized later, it is to share a "vdisk" and I'm looking for using RDM even in two VM

    Please see what could be the reason and if this is possible or not possible, what are the technical reasons?

    waiting for response.

    Thank you

    Hello Mustafa, in your previous answer to me you advised me 'use the existing drive' and attach to VM second, now with your answer you mention it will damage the drive.

    Sorry initially I Although your use of some clustering software that's why I advised to use the existing drive. Since your not using any clustering software, this will damage the drive.

  • How to find all the controller ID: target used for the mapping of RDM on virtual machine

    I want to get a list of all the target ID used for ROW mapping on each controller.  Then next time, I can use the remaining ID of the target for RDM disk mapping using the perl script.

    I checked findVMsWithRDMs.pl but it shows an ID used target for each disc RDM. I use 5.5 ESXi servers and SDK for perl.

    Thank you

    Celine

    You will have to list all config.hardware.device devices, and then find the raw disk support type (to select the ROW).  Then look at the number of drive.  Then use it's value of controllerKey to get the controllers in config.hardware.device with the corresponding key and then get its value busNumber.  So it's busNumber:UnitNumber for the SCSI ID.

    You'll probably want to get all used SCSI identification numbers (use a hash such as BusNumber:UnitNumber-1 online).  Then you can quickly search number the first available bus.  That's what I generally find a free SCSI ID to add a new disk (including the ROW).

  • RDM to delete and recreate the mapping of RDM file and fix

    Hello

    I wrote the following script, but it works fine except it does not create the mapping of RDM file.

    If I comment out the following lines, it works fine.

    $fileMgr.DeleteDatastoreFile_Task ($name, $datacenter)

    $spec.deviceChange [0] .fileOperation = "crΘer".

    Here is the code below

    Replace-VM-RDM function {}

    Param ($scsiid, $rdmname, $vmname, $filename)

    < #.

    Convert SCSI address in Vmware format

    # >

    $scsicontroller = $null

    $scsiid_split = $null

    $scsiid_split = $scsiid.split(":")

    $scsicontroller =($scsiid_split[0])

    # SCSI VMware in the GUI controller ID is a number greater than the real controller id

    $scsicontroller = [int] $scsicontroller + 1

    # Vmware waiting conntroller with 4-character id

    $scsicontroller =($scsicontroller.) (ToString()) + "000".

    $scsicontroller

    # SCSI LOGICAL UNIT NUMBER

    $scsilun = $null

    # VMware SCSI LUN ID in the GUI is a higher number than the id real lun

    $scsilun = [int]($scsiid_split[1]) #+ 1

    ###

    $vm = get-VM-name '$vmname ' | Get-View

    IF (!) (($filename))) {}

    $RDMFile = $rdmname.split("") [0] + "_RDM.vmdk"

    $filename = (($vm.)) (Config.Files.VmPathName). Replace("$vmname.vmx","$RDMFile"))

    }

    $esx is get-view $vm. Runtime.Host

    < #.

    Download CanonicalName RDM Lun

    # >

    $rdmCanonicalName = $null

    $rdmCanonicalName = (($esx.)) Config.StorageDevice.ScsiLun | where {$_.} DisplayName - eq $rdmname}). CanonicalName)

    $rdmDevicePath = (($esx.)) Config.StorageDevice.ScsiLun | where {$_.} DisplayName - eq $rdmname}). DevicePath)

    foreach ($dev in $vm. Config.Hardware.Device) {}

    If (($dev.)) GetType()). {Name - eq "VirtualDisk")}

    If (($dev.Backing.CompatibilityMode-eq "physicalMode") - or)

    ($dev.Backing.CompatibilityMode-eq "virtualMode")) {}

    If (($dev.)) ControllerKey - eq "$scsicontroller") - and ($dev. UnitNumber - eq "$scsilun")) {}

    # Remove the hard drive

    $hd = get-disk hard $vm.name | where {$_.} Filename - eq $dev. Backing.FileName}

    $hd | Remove-hard drive - confirm: $false

    Write-Host "file name:" $dev.backing.fileName "

    Write-Host "Disk Mode:" $dev.backing.diskMode

    $dev.backing.deviceName

    $dev.backing.lunUuid

    $DevKey = $dev.key

    $CapacityInKB = $ dev. CapacityInKB

    $fileMgr = get-View (view Get ServiceInstance). Content.fileManager

    $datacenter = (get-View (Get - VM $VMname |)) Get-Datacenter) USER.USER) .get_MoRef)

    foreach ($disk in $vm. LayoutEx.Disk) {}

    if($Disk.) Key - eq $dev. Key) {}

    foreach ($chain in $disk. {String)

    foreach ($file in $chain.) FileKey) {}

    $name = $vm. LayoutEx.File [$file]. Name

    $fileMgr.DeleteDatastoreFile_Task ($name, $datacenter)

    }

    }

    continue

    }

    }

    }

    }

    Else if (($dev.)) ControllerKey - eq "$scsicontroller") - and ($dev. UnitNumber - eq "$scsilun")) {Write-Host "Selected SCSI address [$scsiid] is not a RDM"}

    }

    }

    #$hd1 = New-disk hard - VM $vmname - DeviceName $rdmDevicePath - DiskType RawPhysical # this line works

    $spec = $null

    $spec = new-Object VMware.Vim.VirtualMachineConfigSpec

    $spec.deviceChange = @)

    $spec.deviceChange += new-Object VMware.Vim.VirtualDeviceConfigSpec

    $spec.deviceChange [0] = new-Object VMware.Vim.VirtualDisk .device

    $spec.devicechange [0].device.capacityInKB = $CapacityInKB

    $spec.deviceChange [0].device.backing = new-Object VMware.Vim.VirtualDiskRawDiskMappingVer1BackingInfo

    $spec.deviceChange [0].device.backing.fileName = $filename

    $spec.deviceChange [0].device.backing.compatibilityMode = "physicalMode".

    $spec.deviceChange [0].device.backing.diskMode = «»

    $spec.deviceChange [0].device.backing.lunUuid = (($esx.)) Config.StorageDevice.ScsiLun | where {$_.} DisplayName - eq $rdmname}). UUID)

    $spec.deviceChange [0].device.connectable = new-Object VMware.Vim.VirtualDeviceConnectInfo

    $spec.deviceChange [0].device.connectable.startConnected = $true

    $spec.deviceChange [0].device.connectable.allowGuestControl = $false

    $spec.deviceChange [0].device.connectable.connected = $true

    # Take the next unused volume for HD key

    $spec.deviceChange [0].device.key = $DevKey + 1

    # 7 SCSIID UnitNUmber is reserved for the controller - then go to 8.

    If ($scsilun - eq 6) {$scsilun = $scsilun + 1}

    # Take the next unit for the HD number

    $spec.deviceChange [0].device.unitnumber = $scsilun

    # Key device for the SCSI controller

    $spec.deviceChange [0].device.controllerKey = $scsicontroller

    # Create vmdk file

    $spec.deviceChange [0] .fileOperation = "crΘer".

    $spec.deviceChange [0] .operation = 'Add '.

    $vm = get - View (Get - VM $VMname) USER.USER

    $vm. ReconfigVM_Task ($spec)

    }

    Replace-VM-RDM $vmname $scsiid $rdmname $filename

    I am working, it just need to reorganization and then the Devicename was wrong.

    Here's the script working.

    Replace-VM-RDM function {}

    Param ($scsiid, $rdmname, $vmname, $filename)

    <>

    Convert SCSI address in Vmware format

    #>

    $scsicontroller = $null

    $scsiid_split = $null

    $scsiid_split = $scsiid.split(":")

    $scsicontroller =($scsiid_split[0])

    # SCSI VMware in the GUI controller ID is a number greater than the real controller id

    $scsicontroller = [int] $scsicontroller + 1

    # Vmware waiting conntroller with 4-character id

    $scsicontroller =($scsicontroller.) (ToString()) + "000".

    $scsicontroller

    # SCSI LOGICAL UNIT NUMBER

    $scsilun = $null

    # VMware SCSI LUN ID in the GUI is a higher number than the id real lun

    $scsilun = [int]($scsiid_split[1]) #+ 1

    ###

    $vm = get-VM-name '$vmname ' | Get-View

    IF (!) (($filename))) {}

    $RDMFile = $rdmname.split("") [0] + "_RDM.vmdk"

    $filename = (($vm.)) (Config.Files.VmPathName). Replace("$vmname.vmx","$RDMFile"))

    }

    $esx is get-view $vm. Runtime.Host

    <>

    Download CanonicalName RDM Lun

    #>

    $rdmCanonicalName = $null

    $rdmCanonicalName = (($esx.)) Config.StorageDevice.ScsiLun | where {$_.} DisplayName - eq $rdmname}). CanonicalName)

    $rdmDevicePath = (($esx.)) Config.StorageDevice.ScsiLun | where {$_.} DisplayName - eq $rdmname}). DevicePath)

    foreach ($dev in $vm. Config.Hardware.Device) {}

    If (($dev.)) GetType()). {Name - eq "VirtualDisk")}

    If (($dev.Backing.CompatibilityMode-eq "physicalMode") - or)

    ($dev.Backing.CompatibilityMode-eq "virtualMode")) {}

    If (($dev.)) ControllerKey - eq "$scsicontroller") - and ($dev. UnitNumber - eq "$scsilun")) {}

    # Remove the hard drive

    $hd = get-disk hard $vm.name | where {$_.} Filename - eq $dev. Backing.FileName}

    $hd | Remove-hard drive - confirm: $false - DeletePermanently

    Write-Host "file name:" $dev.backing.fileName "

    Write-Host "Disk Mode:" $dev.backing.diskMode

    $dev.backing.deviceName

    $dev.backing.lunUuid

    $DevKey = $dev.key

    $CapacityInKB = $ dev. CapacityInKB

    <#$fileMgr =="" get-view="" (get-view="">

    $datacenter = (get-View (Get - VM $VMname |)) Get-Datacenter) USER.USER) .get_MoRef)

    foreach ($disk in $vm. LayoutEx.Disk) {}

    if($Disk.) Key - eq $dev. Key) {}

    foreach ($chain in $disk. {String)

    foreach ($file in $chain.) FileKey) {}

    $name = $vm. LayoutEx.File [$file]. Name

    $fileMgr.DeleteDatastoreFile_Task ($name, $datacenter)

    }

    }

    continue

    }

    }#>

    }

    }

    Else if (($dev.)) ControllerKey - eq "$scsicontroller") - and ($dev. UnitNumber - eq "$scsilun")) {Write-Host "Selected SCSI address [$scsiid] is not a RDM"}

    }

    }

    #$hd1 = New-disk hard - VM $vmname - DeviceName $rdmDevicePath - DiskType RawPhysical # this line works

    $spec = $null

    $spec = new-Object VMware.Vim.VirtualMachineConfigSpec

    $spec.deviceChange = new-Object VMware.Vim.VirtualDeviceConfigSpec [] (1)

    $spec.deviceChange [0] = new-Object VMware.Vim.VirtualDeviceConfigSpec

    # Create vmdk file

    $spec.deviceChange [0] .fileOperation = "crΘer".

    $spec.deviceChange [0] .operation = 'Add '.

    $spec.deviceChange = new-Object VMware.Vim.VirtualDeviceConfigSpec [] (1)

    $spec.deviceChange [0] = new-Object VMware.Vim.VirtualDeviceConfigSpec

    $spec.deviceChange [0] .operation = 'Add '.

    $spec.deviceChange [0] .fileOperation = "crΘer".

    $spec.deviceChange [0] = new-Object VMware.Vim.VirtualDisk .device

    $spec.deviceChange [0].device.key = - 100

    $spec.deviceChange [0].device.backing = new-Object VMware.Vim.VirtualDiskRawDiskMappingVer1BackingInfo

    $spec.deviceChange [0].device.backing.fileName = "$filename".

    $spec.deviceChange [0].device.backing.deviceName = (($esx.)) Config.StorageDevice.ScsiLun | where {$_.} DisplayName - eq $rdmname}). DevicePath)

    $spec.deviceChange [0].device.backing.compatibilityMode = "physicalMode".

    $spec.deviceChange [0].device.backing.diskMode = «»

    $spec.deviceChange [0].device.connectable = new-Object VMware.Vim.VirtualDeviceConnectInfo

    $spec.deviceChange [0].device.connectable.startConnected = $true

    $spec.deviceChange [0].device.connectable.allowGuestControl = $false

    $spec.deviceChange [0].device.connectable.connected = $true

    # Key device for the SCSI controller

    $spec.deviceChange [0].device.controllerKey = [int] $scsicontroller

    # 7 SCSIID UnitNUmber is reserved for the controller - then go to 8.

    If ($scsilun - eq 6) {$scsilun = $scsilun + 1}

    # Take the next unit for the HD number

    $spec.deviceChange [0].device.unitnumber = [int] $scsilun

    $spec.deviceChange [0].device.capacityInKB = [int] $CapacityInKB

    $vm = get - View (Get - VM $VMname) USER.USER

    $vm. ReconfigVM ($spec)

    }

    Replace-VM-RDM $vmname $scsiid $rdmname $filename

  • Adding multiple RDMs to a virtual machine

    Hello community... we do a lot of fun virtual project of the SQL cluster, running on ESXi 5.0. Without going too much into the details of design, I'm looking to try to generate scripts, adding a bunch of RDM (45ish) for a virtual machine. The RDM were presented to the guests, so the next step is to add the ROW appropriate to the virtual machine in the right order.  Here is a partial list of the available RDM:

    lunlist.png

    Based on our design, I know that 46 LUN must go in SCSI 1:1, 47 LUN must go to SCSI 2:1, 48 LUN must go to SCSI 3:1, and so on. I have a worksheet that has a correlation between LUN ID and SCSI ID required.  I can also manually add 1:0, 2:0, 3:0 for created controllers. What I would do is script the rest.

    I saw a number of scripts, and I don't quite see what I need.  To begin with, how can I specify LUN ID?  From there the questions keep coming. Any ideas/suggestions?  Thank you!

    The error is because there are 2 controllers returned (the same one twice).

    If you have 2 connections open vSphere? Make one

    Global $: defaultviservers

    If there is more than 1 entry displayed, you should check if you are in multi mode. Make one

    Get-PowerCLIConfiguration

    scopes 1 says "multiple"?

    If so, cut 1 vSphere connections. For example, by

    Disconnect-ViServer-Server $global: defaultviservers [0] - confirm: $false

    Then check if the SCSI controller Get returns only 1 object.

  • How to get the list of RDM?

    Hi all

    In our environment both of RDM is presented to different virtual machines in physical compatibility mode. It was very difficult for me to keep track

    Could you get it someone please let me know, how to get the list of the RDM presented to ESXI 5.0 host?

    Thank you!

    Ravindra Reddy

    Thank you... A P... for your response tools RV is the right tool, but I wanted to naa number of LUNS as well.

    After 2 hours, I had below power CLI command to get the list of the virtual machine.

    PowerCLI C:\ > Get - VM | Get-hard drive - DiskType "RawPhysical", "RawVirtual" | Select name, Parent, ScsiCanonicalName, DiskType | FL | Out-file C:\RDMlist.xlx

    Thank you!

Maybe you are looking for