Angels Technology

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Friday, January 25, 2013

powercli : get lun ids the raw disks of your virutal machine

Posted on 8:57 AM by Unknown
Nice script I found to get the lun ids for your vm
 Thanks pelicano


$vm= "VMNAMEHERE"
if (Get-VM $VM)
{
$Disks= Get-VM $VM | Get-HardDisk | Where {$_.DiskType -eq “RawPhysical”}

Foreach ($Disk in $Disks) {

$Lun= Get-SCSILun $Disk.SCSICanonicalName -VMHost (Get-VM $VM).VMHost
$Lun.RuntimeName.Substring($Lun.RuntimeName.LastIndexof(“L”)+1)

}

}




update:
here is another good script  that I used to find what vmdk a particular lun number is associated with

Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | 
where { $_.ScsiCanonicalName -eq  "naa.600601607290250060ae06da248be111"} |
 Select Parent,Name,DiskType,ScsiCanonicalName,DeviceName | fl
 
Thanks to:
http://virtuallyhyper.com/2012/06/powercli-script-identify-which-vm-using-rdm-lun-identified-naa-id-lun/
 
Read More
Posted in esx, esxi, powercli, powershell | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • Convert your physical RDM (rdmp) to a virtual RDM (rdmv)
    So you have a raw disk mapping on your virtual machine in esxi   and you wanted to convert it from a rdmp to a rdmv. Using the VMware cli...
  • How to read PSOD errors on your esxi host
    Here are some links that are useful to help you interpret why psod errors are happening. Machine Check Exception errors: mce http://kb.vmwar...
  • How to run a powershell script for vmware : walkthrough
    Here is a walk through on how to make and run a powershell /powercli script The methods also apply to powershell but this is target towa...
  • Esxi : Recovering from a bad update : Last known good configuration for vmware
    Recovering from a bad update. Press Shift+R at the boot prompt. Esxi should fall back to the last known good state. You have t o be real fas...
  • Browsing Vmware logs in the DCUI (view esxi logs via console)
    Why would you view your logs in the console? Well sometimes it's the only place that is accessible if there is an error. Go to your DC...
  • Vmware DRS anti affinity rules wont let you enter maintenance mode for a esxi host
    You have a DRS rule that specifies that 2 vms need to be kept apart: In this case: 250-FT and 250sql3 For larger clusters with multiple...
  • Check esxi host's disk latency / storage performance using DAVG in esxtop
    Do youyour virutal machine's seem slow? Is it your vm or is it your disk storage or san? This is how we can check. What is davg This...
  • Powercli script to check vmotion compatibility to another host
    This thread here shows you how to test vmotion compatibility to a specific host. It’s a good starting point. The return value are usin...
  • How to add a Raw disk to your esx host (RDM)
    RDM, raw device mapping allows for a virtual guest to access a provisioned disk or lun directly and perform operations on it. Use physical...
  • convert thick disk to thin using a command line via the vmkfstools on the esxi host
    So you have a thick provisioned disk and you want to convert it to a thin provisioned disk. Another issue you have is that you don’t have ...

Categories

  • 5.1
  • backup
  • cloud
  • cluster
  • command line
  • console
  • converter
  • cpu
  • datacenter
  • datastore
  • datastore. rdm
  • DCUI
  • dell
  • disaster recovery
  • display
  • DR
  • e1000
  • e1000e
  • ec2
  • esx
  • esxi
  • esxtop
  • extent
  • Good for enterprise
  • HA
  • hcl
  • host
  • HP
  • ibm
  • iometer
  • iscsi
  • iso
  • linked mode
  • logs
  • MAC
  • memory
  • NFS
  • NIC
  • NTP
  • ova
  • ovf
  • p2v
  • pcie
  • performance
  • phone
  • powercli
  • powershell
  • PSOD
  • raid
  • RDM
  • resource pool
  • rvtools
  • scsi
  • sddc
  • snapshots
  • SQL
  • SRM
  • ssh
  • storage
  • svmotion
  • syslog collector
  • v2v
  • vapp
  • vcenter
  • vcloud
  • vcp
  • veeam
  • VI console
  • vm
  • vmdk
  • VMFS
  • vmkfstools
  • vmotion
  • VMUG
  • vmware
  • vmware tools
  • vmware.esxi
  • vmxnet3
  • vsphere
  • vum
  • web client
  • windows

Blog Archive

  • ▼  2013 (28)
    • ►  October (2)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (14)
    • ►  May (1)
    • ►  April (1)
    • ►  March (5)
    • ►  February (1)
    • ▼  January (1)
      • powercli : get lun ids the raw disks of your virut...
  • ►  2012 (138)
    • ►  December (2)
    • ►  November (13)
    • ►  October (26)
    • ►  September (19)
    • ►  August (35)
    • ►  July (34)
    • ►  June (9)
Powered by Blogger.

About Me

Unknown
View my complete profile