This is the only fool-proof method I have found for cross referencing virtual hard disks in Virtual Center with their associated disk labels in Windows 2008. I haven't worked out the automation of this yet, but hopefully soon.
Compare the VMname.vmx values to the Location and Target ID from disk properties in Windows Disk Management. Hope this helps!
scsi1.pciSlotNumber = "224" << Location = 224
scsi1.present = "true"
scsi1.sasWWID = "50 05 05 66 f5 a5 1b c0"
scsi1.sharedBus = "none"
scsi1.virtualDev = "pvscsi"
scsi1:0.ctkEnabled = "false"
scsi1:0.deviceType = "scsi-hardDisk"
scsi1:0.fileName = "dbsyst30_1.vmdk" << Target ID = 0. Name matches in VC. see img
**UPDATE 11/20/2016 - Martin posted a script that accomplishes this that may work for some of you. Check it out here:
https://communities.vmware.com/thread/443964?start=0&tstart=0
I would consider this way to be pretty fool proof. Thanks for the blog!
ReplyDeleteThe only thing that I did not quite understand is why you considered the "virtual device node" as misleading? I only look at the SCSI (X.X) part of the value, ignoring the "Hard disk X" verbiage. The first value 0, 1, 2, 3 you can line up with the location ID in windows. Granted that each server may give a different location ID based on what comes from the VMX, but it lines up the same for each disk on the same SCSI controller. The next number 0 - 15 matches up with the target ID 100% of the time.
Anyway, like I said in the beginning your document is 100% fool proof method for server 2008 and server 2012. At least every time I had any doubt I found it to be accurate.
Hey thanks for the comment. I had put a lot of work into a script that would do this for me...until I found some errors with the vdn where it would report a value inconsistent with the disk. To prove this would take a bit more effort then I have right now but you can be certain that 98% of the time you are correct. When I scripted this and then hand checked I had 4 disks out of 400+ that were inconsistent (GRAH!). That is when I engaged vmware for a little wtf session. I should revisit this now that we are on 5.5 or maybe wait till 6.0. Either way glad it helped at least a little.
DeleteThis only works for non-RDMs :(
ReplyDeleteThx a lot. It does work for RDMs
ReplyDeleteThx a lot for this trick. I think it does work for RDM at least I hope as I have used this solution to match windows 2012 disk to VM disk for RDM luns...
ReplyDeleteSorry, I don't understand this.. how does your first images correlate to the second image? somewhat confused..
ReplyDeleteany info would be greatly appreciated...
Hi, I'm trying to use this information in a script. Have you figured out how to get the Location (224) in a script? You can query many things about disks but I haven't found a way to get the Location (PCI slot of the SCSI controller, 224 in this case)
ReplyDeleteSee reply below.
DeleteI see no related replies below :(
DeleteCan you share a piece of PowerShell code to make a PoC case? Or at least two parts of code - one to get VMX file info and another one to get Windows disk location info. That'd very helpful.
Thank you in advance.
Stan
I am working on exact the same Problem at the moment: Identity the LUN/RDM used in Windows on the respecting Bus/Port. I will be using a mapping-xml.
DeleteHowever, the missing Piece for me ist getting the Location-Attribute from within Windows.
Did any1 manage to get the Location-Attribute either by PowerShell, .NET, COM or WMI?`
Thanks,
FS
Unfortunately no and I have been pulled away from vmware mostly. I would think at the very least you could use some kind of GUI emulation tool like AutoIt to grab it from the GUI window. It perplexed me for awhile. This was developed for version 5.0 I believe. Post back if you work it out, this page still gets a lot of hits and people would like to know.
ReplyDeleteUpdated VMware article with scriptable methodology for your manual way.
ReplyDeletehttps://communities.vmware.com/thread/443964?start=0&tstart=0
HTH
Martin
Awesome Martin, glad someone put the time into this! As vmware is kind of off my plate right now so has this problem been. Been so busy I haven't even been paying attention to my blog. I will update the main body.
Delete