5 Replies Latest reply on Jul 7, 2011 2:25 AM by LucD

    Match disks path to SCSI id from OS

    A.Mikkelsen Expert
    vExpert

      Hi,

       

      I'm been trying to create a script that lists witch OS mountpoint (C: or /), are placed on witch VMDK files, without any luck.

      I need it, to be able to automate the disk extend process.

       

      Any idears!!!!!!!

       

      The script needs to be able to do the pairing without interacting with the OS - Only through VMware tools...

       

      Hope someone has an idear.

       

      I have looked at the following site, but they don't supply the needed info, or uses WMI.

      http://ict-freak.nl/2009/10/11/powercli-virtual-machine-disk-vmdk-info-v2-analyze-data-with-excel/

      http://www.virtu-al.net/2010/01/27/powercli-virtual-machine-disk-usage/

       

      BR.

      A. Mikkelsen

        • 1. Re: Match disks path to SCSI id from OS
          mattboren Master
          vExpert

          Hello, Anders-

           

          I have looked a fair bit for a way to make a correlation, and have come up with nothing, so far.

           

          But, to be sure about what you are looking for:  you want to know what SCSI ID (like, SCSI 0:0 or SCSI 0:1) corresponds with what volume/partition within the guest?  Or, you are trying to figure out which volume is in which VMDK file?  (or both?)

           

          And, are there any assumptions/facts in place here, like:

          0)  are the guests are only one OS family or another (Windows, or Linux, or..), or are they mixed?

          1)  is there possibly more than one (1) volume/partition on a SCSI device or VMDK?

          2)  other?

           

          Just trying to think of things that might help us get to the solution...

          • 2. Re: Match disks path to SCSI id from OS
            LucD Guru
            Community WarriorsvExpertUser Moderators

            In our PowerCLI book we provide a function, called Get-VMDiskMapping, that will do this mapping.

            The function uses the Invoke-VMScript cmdlet to launch a VBS script inside the guest OS to get the partition info through WMI.

            So no external WMI calls !

             

            Of course we prefer you get the book, but we made the functions from the book publically available.

            See PowerCLI Book: Download Scripts, Functions and Modules.

            Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
            • 3. Re: Match disks path to SCSI id from OS
              A.Mikkelsen Expert
              vExpert

              Hi Matt,

               

              Sorry for the late answer - my mail has been down do to flodding.

               

              Yes, I'm trying to match a volume/partition with a SCSI id so I can automate the extention process.

              Yes, I also need to pair a volume/partition to a VMDK file.

               

              1. For the time beeing only Windows.
              2. Yes, there can be multible volume/partitions in a VMDK
              3. I'm trying to do all without the need for host and guest credentials

               

              I have got it to work with credentials - still missing driveletter.

               

              A. Mikkelsen

              • 4. Re: Match disks path to SCSI id from OS
                A.Mikkelsen Expert
                vExpert

                Hi LucD,

                 

                Just boughtthe book - still waiting for delevery

                • 5. Re: Match disks path to SCSI id from OS
                  LucD Guru
                  User ModeratorsvExpertCommunity Warriors

                  Thanks.

                  You can already download the function, there is help available inline.

                  Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz