All the VM Info

Hello

I'm pretty new to get - view using the old wires form the master LucD I wrote the Code below, but I need to add some clarification in the code.

LucD can you please help me.

Need information to fetch:

NAA Mon of each hard drive output

Lun ID of the NAA

VMConfigFile

VMDKpath for each hard drive

Size of this hard

-------------------------------------

Something went wrong in the code failed to get the information

IP address (some virtual machines contains multiple IP addresses)

network card (I love... NIC 1 etc.)

need information of port group of DVS b/c, that some virtual machines are on DVS

=============

foreach($vm in (Get-View -ViewType VirtualMachine -Property Name,runtime.powerState,Guest.net,Config.Hardware.numCPU,Config.Hardware.MemoryMB,Runtime.Host,Guest.GuestFullName,Config.GuestFullName,Parent,ResourcePool,Config.Hardware.Device,Config.version,guest.toolsversionstatus)){
   # $t = Get-View $vm.Parent -Property Name,Parent
    #$path = $t.Name
    #while($t.GetType().Name -eq "Folder"){
     #   $t = Get-View $t.Parent
      #  if($t.Name -ne "vm"){
       #     $path = $t.Name + "/" + $path
        #}
    #}
    $t = Get-View $vm.ResourcePool -Property Name,Parent
    while($t.getType().Name -eq "ResourcePool"){
       $t = Get-View $t.Parent -Property Name,Parent
    }
        if($t.GetType().Name -eq "ClusterComputeResource"){
        $cluster = $t.Name
        }
        else{
            $cluster = "Stand Alone Host"
        }
    while($t.getType().Name -ne "Datacenter"){
        $t = Get-View $t.Parent -Property Name,Parent
    }
    $datacenter = $t.Name
   
    $vm.Config.Hardware.Device | where {$_.GetType().Name -eq "VirtualDisk"} |
    Select @{N="VM";E={$vm.Name}},
    @{N='powerState';E={$vm.runtime.powerState}},
    #@{N='IP';E={$add=($vm.Guest.Net | %{$_.IpAddress})}.(([string]::Join(',',$add)))},
    @{N='NumCPU';E={$vm.config.Hardware.NumCpu}},
    @{N='Memory GB';E={$vm.Config.Hardware.MemoryMB| %{[math]::Round($_/1kb,2)}}},
    @{N='VMHost';E={(Get-View -Id $vm.Runtime.Host).name}},
    @{N='GuestOS';E={$vm.Guest.GuestFullName}},
    @{N='ConfiguredOS';E={$vm.Config.GuestFullName}},
    #@{N="Folder";E={$path}},
    @{N="Cluster";E={$cluster}},
    @{N="Datacenter";E={$datacenter}},
    @{N="Scsi";E={($_.DeviceInfo.Label).BusNumber}},
    @{N="Hard Disk";E={$_.DeviceInfo.Label}},
    @{N="Disk datastore";E={$_.Backing.Filename.Split(']')[0].TrimStart('[')}},
    @{N="Disk capacity GB";E={$_.CapacityInKB| %{[math]::Round($_/1MB,2)}}},
    @{N="Disk type";E={
            if($_.Backing.GetType().Name -match "flat"){
                "Flat"
            }
            else{
                $_.Backing.CompatibilityMode
            }}},
   @{N="HW Version";E={$vm.Config.version}},
   @{N="Tools Status";E={$vm.guest.toolsversionstatus}},
   @{N="NIC Name";E={($vm.config.hardware.device | where {($_.DeviceInfo.Label -like "Network*")}).name}},
   @{N="Mac"; E={($vm.Config.Hardware.Device | where{$_.DeviceInfo.Label -like "Network*"}).MacAddress}},
   @{N="Portgroup"; E={($vm.Config.Hardware.Device | where{$_.DeviceInfo.Label -like "Network*"}).DeviceInfo.Summary}}
}

Example of output:

output.JPG

Try like this

foreach ($vm in (Get-View - ViewType VirtualMachine-Name, runtime.powerState, Boulevard, Config.Hardware.numCPU, Config.Hardware.MemoryMB, Runtime.Host, Guest.GuestFullName of property,

Config.GuestFullName, Parent, ResourcePool, Config.Hardware.Device, Config.version, guest.toolsversionstatus,

Config.Files.VMPathName)) {}

$t is get-view $vm. ResourcePool-name of the Parent property

While ($t.GetType ().) (Name - eq 'ResourcePool') {}

$t = get-view $t.Parent - the name of the Parent property

}

If ($t.GetType ().) {Name - eq "ClusterComputeResource")}

$cluster = $t.Name

}

else {}

$cluster = "stand alone host."

}

While ($t.GetType ().) Name - not "data center") {}

$t = get-view $t.Parent - the name of the Parent property

}

$datacenter = $t.Name

$vm. Config.Hardware.Device | where {$_.} GetType(). Name - eq "VirtualDisk"} |

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

@{N = "powerState"; E = {$VM. Runtime.powerState}},

@{N = "IP"; E = {[string]: join (",",($vm.)} Boulevard | %{$_. IpAddress | where {$_.} Split('.'). {Count - eq 4} | %{$_}}))}},

@{N = "NumCPU"; {E = {$VM.config.hardware.NumCpu}}.

@{N = 'Memory GB'; E = {$vm. Config.Hardware.MemoryMB | "% {[math]: Round($_/1kb,2)}}},"

@{N = "$vmhost"; E = {$script: esx = Get - views - Id $vm.} Runtime.Host; {{$script: esx.name}},

@{N = "GuestOS"; E = {$vm. Guest.GuestFullName}},

@{N = "ConfiguredOS"; E = {$vm. Config.GuestFullName}},

#@ {N = 'File'; E = {$path}},

@{N = 'Cluster'; E = {$cluster}},

@{N = 'Center'; E = {$datacenter}},

@{N = "Scsi"; E={$_. UnitNumber}},

@{N = 'Hard drive'; E={$_. DeviceInfo.Label}},

@{N = 'Disc datastore'; E={$_. Backing.Filename.Split(']') [0]. TrimStart('[')}},

@{N = "Drive GB of capacity"; E={$_. CapacityInKB | "% {[math]: Round($_/1MB,2)}}},"

@{N = "Disc Type"; E = {}

if($_.) Backing.GetType (). Name - match "flat") {}

"Flat".

}

else {}

$_.Backing.CompatibilityMode

}}},

@{N = "DeviceName"; E = {}

if($_.) Backing.GetType (). Name - match 'raw') {}

$_. Backing.DeviceName

}

else {}

$script: lunnaa = (Get-View-Id $_.) Backing.Datastore). Info.Vmfs.Extent [0]. DiskName

$script: lun = $script: esx. Config.StorageDevice.ScsiLun | where {$_.} {CanonicalName - eq $script: lunnaa}

$script: lun. Descriptor of | where {$_.} ID-match "vml"} | Select Id - ExpandProperty

}}},

@{N = "LUN NAA"; E = {}

if($_.) Backing.GetType (). Name - match 'raw') {}

$lunUuid = $_. Backing.LunUuid

$script: lun = $script: esx. Config.StorageDevice.ScsiLun | where {$_.} UUID - eq $lunUuid}

$script: lun. CanonicalName

}

else {}

$script: lunnaa

}}},

@{N = "LUN ID"; E = {}

$dev = $script: esx. Config.StorageDevice.PlugStoreTopology.Device | where {$_.} LUN - eq $script: lun. Key}

$script: esx. Config.StorageDevice.PlugStoreTopology.Path | where {$_.} Device - eq $dev. Key} |

Select - first of all 1 - ExpandProperty LunNumber

}},

@{N = "VMConfigFile"; {E = {$VM.config.files.VMpathname}}.

@{N = "VMDKPath"; E={$_. Backing.FileName}},

@{N = "HW Version"; E = {$vm. Config.version}},

@{N = 'Tools status'; E = {$VM. Guest.toolsversionstatus}},

@{N = "NETWORK card name"; E = {($vm.config.hardware.device | where {($_.)})} (DeviceInfo.Label-like_"réseau_*")}). DeviceInfo.Label}},

@{N = 'Mac'; E = {($vm.)} Config.Hardware.Device | where {$_.} ({DeviceInfo.Label - like the "Network *"}). MacAddress}},

@{N = "Portgroup"; E = {}

$nic = $vm. Config.Hardware.Device | where {$_.} {DeviceInfo.Label - like the "Network *"}

[channel]: join ("," ", ())

$nic | %{

if($_.) DeviceInfo.Summary - notmatch 'DVSwitch') {}

$_. DeviceInfo.Summary

}

else {}

Get-view ViewType-DistributedVirtualPortgroup property name - filter @{"Key" = $_.} Backing.Port.PortgroupKey} |

Select the name of ExpandProperty-

}}))}}

}

Tags: VMware

Similar Questions

  • When I installed firefox I lost all info of 'Favorites' that has no filter and I can't find the latest browser. Find out all the this info?

    When I installed firefox I didn't that I loose access to information of 'Favorites' that was on my old browser from microsoft. I got info really important that I can't see how to get now.

    See https://support.mozilla.org/kb/import-favorites-from-internet-explorer

  • I've updated my firefox and now when I open firefox the page with all the new info returns

    new update

    (1) what is your definition of home page?

    (2) attach a screenshot of what you are referring. Not familiar with any function of tour.

  • Not all the info is pn saw a page

    We have http://www-03.ibm.com/software/lotus/symphony/spreadsheetsForum.nsf/AllByUNID/37D031F1FCD781FE85257A1C0047638C?open & forum = Questions % 20and % 20Troubleshooting & row = 1 of page

    If we open it in Chrome 19.0.1084.56 m, then we see all the info in the topic

    "IBM Lotus Symphony 3 RU on Russian Windows XP Professional SP3 (32 bit)
    We have MS Office 2007 SP3 excel file. Cell A1 contains formula (=(20-2+1)+(31-22+1)+(40-33+1)+1+2+(53-49+1)+2+4+2+1+2+3+3+2+1+1+3+2+1+2+2+2+2+3+1+4+(135-131+1)+2+1+1+(153-147+1)+1+1+2+3+(172-169+1)+1+1+1+1+3+1+(198-194+1)+2+1+1+3+2+2+2+1+(232-225+1)+3+2+2+3+3+1+1+(270-261+1)+(275-272+1)+(282-277+1)+3+2+( 308-292+1)+4+1+1+(325-320+1)+4+1+2+1+1+1+(359-355+1)+2+2+2+(376-371+1)+3+2+1+(392-387+1)+1+2+1+1+1+2+2+4+2+1+2+(437-433+1)+1+1+(450-446+1)+1+5+1+5+1+1+2+1+3+(492-486+1)+4+1+(506-501+1)+(513-509+1)+1+1+1+(531-524+1)+1+1+2+1+3+2+1+1+1+2+(577-571+1)+3+4+5+2+ 1+1+1+1+1+1+3+3+2+1+4+1+1+1+2+2+2+1+3+2+1+1+1+2+1+3+3+3+2+3+2+2+2+6+1+4+3+2+8+3+2+15+1+6+1+3+4+3+4+4+4+2+7+8+1+5) and we have total amount = 536If we try to open that file in Symphony 3 , then we see that cell A1 contains ANOTHER formula, which is truncated =(20-2+1)+(31-22+1)+(40-33+1)+1+2+(53-49+1)+2+4+2+1+2+3+3+2+1+1+3+2+1+2+2+2+2+3+1+4+(135-131+1)+2+1+1+(153-147+1)+1+1+2+3+(172-169+1)+1+1+1+1+3+1+(198-194+1)+2+1+1+3+2+2+2+1+(232-225+1)+3+2+2+3+3+1+1+( 270-261+1)+(275-272+1)+(282-277+1)+3+2+(308-292+1)+4+1+1+(325-320+1)+4+1+2+1+1+1+(359-355+1)+2+2+2+(376-371+1)+3+2+1+(392-387+1)+1+2+1+1+1+2+2+4+2+1+2+(437-433+1)+1+1+(450-446+1)+1+5+1+5+1+1+2+1+3+(492-486+1)+4+1+(506-501+1)+(513-509+1)+1+1+1+(531-524+1)+1+1+2+1+3+2+1+1+ 1+2+(577-571+1)+3+4+5+2+1+1+1+1+1+1+3+3+2+1+4+1+1+1+2+2+2+1+3+2+1+1+1+2+1+3+3+3+2+3+2+2+2+6+1+4+3+2+8+3+2+15+1+6+1+3+4+3+4+4+4+2) et nous avons quantité totale = 515Last opérateurs (+ 7 + 8 + 1 + 5) qui ont été dans MS Office in the Symphony mysteriously disappeared from formula and amount total changed. Symphony shows not all messages. If we try to add missing operators in the Symphony (not even all alone) in the formula, then we immediately get "error 512". Exactly the same problem exists in Apache Open Office 3.4.0 https://issues.apache.org/ooo/show_bug.cgi?id=119451 and Libreoffice 3.5.4 https://bugs.freedesktop.org/show_bug.cgi?id=50419 if perform us the same operations in Microsoft Office 2007 SP3, then fine (we can even add a few operators more, and everything will be fine). I would like to attach files from the example here, but cannot do so. You can see the example files in Bugzilla for the corresponding products. »

    If we try to open this page in FF 13, then we see only the first two lines

    "IBM Lotus Symphony 3 RU on Russian Windows XP Professional SP3 (32 bit)
    We have MS Office 2007 SP3 excel file. Cell A1 contains the formula (= (20-2 + 1)-(31-22-1) +(40-33+1) + 1 + 2 + (53-49 + 1) "+ 2 + 4 + 2 + 1 +")

    and all the other info is truncated.

    The same problem is with Opera 12

    Which is caused by a lack of white-space: pre-wrap; CSS rule.

    Add code to the file in the chrome folder userContent.css

    Customization files (interface) userChrome.css and userContent.css (Web sites) are located in the chrome folder in the user profile folder.

    @-moz-document domain(www-03.ibm.com){
     pre{ white-space: pre-wrap !important; }
    }
  • How do I Start Up Firefox 14.01 in safe mode, with all the Add ons disabled, if do not have to restart?

    Using Dell PC/Windows XP. I love how Firefox is running in SafeMode so inflated as usual. I would like to be able to start Firefox in safe mode, without having to always restart Firefox to get in safe mode. Anyway to do it? Thank you very much!!!

    Ok. Thank you guys created and a new profile and restarted and all kind of memory freed, but of course Firefox is practically naked, so is expected.
    Checked the plugins and extensions, no major problems that are not there, I could see. I have a Gig of RAM installed around a little more, do not think I can add as many more on my old Dell PC of 2005. So I'll just switch to Firefox Safe mode when memory begins to be tight. Thanks again guys for all the good info!

  • Suddenly, I hear all the sounds of e-mail downloads

    I can listen to CDs, but when I download the emails that contain sounds, I don't get it, he used

    Hello


    1. what e-mail services you use?
    2. don't you make changes to your machine before the problem?

    Your question does contain all required information necessary for help us to you to. Please re - write your question, this time make sure you have all the necessary info and we will try to help.

    http://support.Microsoft.com/kb/555375

    Also, I suggest that you contact the provider of e-mail with the number

    I use yahoo and hotmail. I am currently using clear that my my wireless connection.  The only thing I did screw this to the top of my computer was down load itunes and with it a kind of virus detection, not allowing my computer working properly, so I restored it to an earlier date.  I don't know what a thread is.

  • Lightroom: Export with all the metadata includes the objective data

    When I export photos from Lightroom to photo site appears all the EXIF metadata, but not my lenses. Lightroom recognize my goal, but when I export image with the option "All metadata" the objective data is not exported. Why? Maybe not important but I want to get all the metadata with my photos.

    ScreenShot.jpg

    Hello!

    There must be something else, perhaps with the importer of photo website? When I export with the option to include all the metadata info from the lens is also included. It is usually written by the camera in EXIF fields data. Sounds like your camera is written this info since Lightroom can see it.

    If you have another application of image processing (you camera manufacturer, Preview, etc) see if a file exported from that behaves the same way when you import into your photo site.

  • I followed the instructions and LOST all my Firefox info. and software!

    I think I've given about all the details that I have on this terrible problem! Help, please!
    AOL posted a notice that I should upgrade to the new Firefox, I tried. I downloaded a new - and remove the old a / and AFTER I have done - the new version of Firefox has written it will not work on this computer, not BEFORE! So, I lost my older Firefox with EVERYTHING on it! I have the app w / bookmarks on my iPhone? Does that mean that I can find my old Firefox with all my info. ? Help

    Because you are using an Intel Mac with OSX 10.4.1 last to work are the Firefox 3.6

    The current 3.6. * update can be found at http://www.mozilla.org/en-US/firefox/all-older.html

  • Hello. I'm just a beginner and I downloaded the itunes 12.3.3 update and now when I right click on a work of art albums all disappear from the track of this album. I also have problems with my get info tab. All of my info from the album crashes.

    Hello. I'm just a beginner and I downloaded the itunes 12.3.3 update and now when I right click on a work of art albums all disappear from the track of this album. I also have problems with my get info tab. All of my info from the album crashes.

    This can help (from turingtest2):

    Fix iTunes for Windows security permissions

  • If I delete all the info on my old Mac so I can make a donation, it will affect my new Mac?

    IF I delete all the info on my old Mac, so it can be given, which will affect my new Mac?

    Follow the instructions in > what to do before you sell or give away your Mac - Apple Support

  • How to draw all the info my old to my new laptop computor

    Original title: draw all the information in my old laptop to the new

    How to draw all the info my old to my new laptop computor

    Hello

    1. What are the operating systems installed on both computers?

    2 you want to transfer all the settings from the old computer to the new computer?

    You can use Windows Easy Transfer to perform the task.

    http://Windows.Microsoft.com/en-us/Windows7/products/features/Windows-easy-transfer

    Hope this information helps

  • Media Player Windows XP automatically wrong info for my titles. How can I stop all the automatic update of news media?

    Windows XP Media Player is automatically putting the wrong info for my pieces for example the name of the album and the cover.

    How can I stop all the automatic update of news media?

    Windows XP, the version of Windows Media player to date. ' Retrieve additional information on the internet "is not checked.

    "Rearrange music in rip music folder, using rip music settings" is not checked

    "Keep my ratings stars as global ratings in files" is unchecked

    "Maintaining the codecs automatically" is unchecked.

    Under Privacy Options, everything is disabled except "set clock on devices automatically.

    Thank you for your help in this endevor.

    Hello

    1 how long have you been faced with this problem?
    2. don't you make changes on the computer before this problem?
    3. what version of windows media player do you use?

    Try the fix tool in the following article and verify.
    Solve the problems of Windows Media Player video and other media or library
    http://support.Microsoft.com/mats/windows_media_player_diagnostic/

    See also:
    Resources for the resolution of problems in Windows Media Player
    http://support.Microsoft.com/kb/843509

  • My screen on my laptop is amplified and can not get all the info on the screen... How to make all this fit?

    My screen seems to be enlarged and cannot get all the info on the screen... How to make all this fit?

    Go to the website of the manufacturer of your laptop > drivers and downloads Section > key in your model number > look for the latest Vista drivers > download/install them.

    http://Windows.Microsoft.com/en-AU/Windows-Vista/change-screen-resolution

    Change the screen resolution

    Screen resolution refers to the clarity of the text and images on your screen. At higher resolutions, items appear sharper. They appear also smaller, so more items adapted to the screen. At lower resolutions, fewer items adapted to the screen, but they are larger and easier to see. At very low resolutions, however, images may have serrated edges.

    See you soon,.

    Mick Murphy - Microsoft partner

  • I am unable to buy all the apps in canada. I can't change your addess canada for payment info

    I am unable to buy all the apps in canada. I can't change your addess canada for payment info.

    I can browse all apps in the store, but the difficulty to buy. When I submit all my credit card details, I can't change the United States in the Canada.

    Hi Vandu,

    There seems to be a problem when purchasing apps.
     
    You must contact Microsoft Store for assistance.
     
     
    Good day!
  • All the keywords entered in Lightroom CC no appear in the Photoshop Info file

    HI: The solution to this problem seems like it's pretty easy, but I have not found an answer after a little research. So I apologize in advance if it is dealt with elsewhere.

    Here's the situation. In Lightroom CC, I type in the Keywords field all the keywords I want to be associated with an image. Before you export the image file to a folder on my computer, I select "Include all the metadata" and check "Write keywords as Lightroom hierarchy." But when I opened the image in Photoshop, only some of these keywords appear in the Info file. (These same words also appear if, in Lightroom, I select 'Will Export' in the menu dropdown next to "Keyword Tags.")

    I do not - and have you not want - to do anything fancy with my Keywords. I just want to type the words in the box of Keywording in Lightroom and all these words have same show when I or someone else, opens this file in Photoshop.

    Thanks for any advice you have to offer.

    How can I do that no matter what keyword I have type in the in the Keywording field in Lightroom displays all the time with no matter what image I get in? In other words, I have to go through my long string of keywords in my list of keywords and check each keyword individually (which could be really very long)?

    My default, all keywords must include on export checked.  Try to test a new keyword - is it verified?

    I've seen a few reports over the years of catalogs in which a large number of keywords had somehow got unchecked.  Unfortunately, it is impossible to batch edit keywords, your only option is to examine each keyword in turn.

Maybe you are looking for