{"id":672,"date":"2015-03-15T15:36:01","date_gmt":"2015-03-15T04:36:01","guid":{"rendered":"http:\/\/threemillion.net\/blog\/?p=672"},"modified":"2015-05-19T15:07:35","modified_gmt":"2015-05-19T05:07:35","slug":"get-view-regular-key-value-information","status":"publish","type":"post","link":"https:\/\/threemillion.net\/blog\/?p=672","title":{"rendered":"Get-View Regular Key Value Information"},"content":{"rendered":"<p>Some useful values from PowerCLI Get-View of VMware Virtual Infrastructure for use in scripts. I have also included some example data and notes. I have found that when writing scripts you end up using many of the same keys regularly. So this is a small list to save having to find this information each time.<\/p>\n<p><strong>Virtual Machine<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$vm = Get-View -ViewType VirtualMachine -Filter @{&quot;Name&quot;=&quot;&quot;}\r\n\r\n$vm.\r\nName                VCAC6\r\n\r\n$vm.config.\r\nGuestFullName       SUSE Linux Enterprise 11 (64-bit)\r\nVersion             vmx-07\r\nTemplate            false\r\nGuestId             sles11_64Guest\r\nAnnotation          vCloud Automation Center enables.....\r\n\r\n$vm.config.Tools.\r\nToolVersion         2147483647\r\n\r\n$vm.config.Hardware.\r\nNumCPU              2\r\nNumCoresPerSocket   1\r\nMemoryMB            8192\r\n\r\nvm.config.hardware.device\r\nType = VMware.Vim.VirtualDisk\r\nCapacityInKB\r\n\r\n$vm.config.Files.\r\nVMPathName          [loaclvmfs02-ocz] vCAC6\/vCAC6.vmx\r\n\r\n$vm.Runtime.\r\nPowerState          poweredOff\r\nMemoryOverhead      254865408\r\n\r\n$vm.Summary.Storage.\r\nCommitted           5420092483         (UsedSpace)\r\nUncommitted         35647188992        (Thin space not yet used)\r\n\r\nCommitted = UsedSpace\r\nCommitted + Uncommitted = Provisioned Space\r\n\r\n$vm.Summary.Config.\r\nNumEthernetCards    1\r\nNumVirtualDisks     2\r\n\r\n$vm.Summary.Guest.\r\nIpAddress    192.168.1.25\r\n\r\n$vm.config.BootOptions.\r\nBootDelay           3000     (milliseconds to wait before booting VM, maximum allowed is 10,000)\r\nEnterBIOSSetup      $true\r\n\r\n<\/pre>\n<p><strong>VMHost<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$vmhost = Get-View -Viewtype HostSystem -Filter @{&quot;Name&quot;=&quot;&quot; }\r\n\r\n$vmhost.\r\nName                pesx01.localdomain\r\n\r\n$vmhost.Summary.Hardware.\r\nVendor              Gigabyte Technology Co., Ltd.\r\nModel               X58A-UD3R\r\nMemorySize          25768087552\r\nCpuModel            Intel(R) Core(TM) i7 CPU    950  @  3.07Ghz\r\nCpuMhz              3064\r\nNumCpuPks           1\r\nNumCpuCores         4\r\nNumCputhreads       8\r\n\r\n$vmhost.config.Product.\r\nVersion             5.5.0\r\nBuild               1892794\r\n\r\n$vmhost.hardware.\r\nAsset number \r\nService tag\r\n\r\nParam(\r\n  [VMware.Vim.ManagedEntity]\r\n  $vmhost\r\n)\r\n<\/pre>\n<p><strong>Datastores<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ds = Get-View -ViewType Datastore -Filter @{&quot;Name&quot;=&quot;&quot;}\r\n\r\n$ds.\r\nName                localvmfs01-samsung\r\n\r\n$ds.Info.\r\nFreeSpace           942653046784\r\nurl                 \/vmfs\/volumes\/4d5997e7-c73dee74-d1aa-001b219c053f\r\n\r\n$ds.Info.Vmfs.\r\nMajorVersion        3\r\nVersion             3.46\r\nssd                 false\r\nType                VMFS\r\nCapacity            995627106304\r\n\r\n$ds.vm.\r\n[0]...[n]           VirtualMachine-10     (Where n is the number of virtual machines)\r\nLength              7          (the number of Virtual Machines either on this datastore or have a connection to something on the datastore. For example they have a mapping to an ISO file. It does not matter whether the mapping is connected or not it shows up if the path is in the Virtual Machine Settings. So in this example there are 3 VMs and 4 VMs with ISO files.)\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Some useful values from PowerCLI Get-View of VMware Virtual Infrastructure for use in scripts. I have also included some example data and notes. I have found that when writing scripts <a href=\"https:\/\/threemillion.net\/blog\/?p=672\" class=\"more-link\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[49],"tags":[55],"class_list":["entry","author-admin","post-672","post","type-post","status-publish","format-standard","category-powercli","tag-get-view"],"_links":{"self":[{"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=672"}],"version-history":[{"count":4,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/672\/revisions"}],"predecessor-version":[{"id":711,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/672\/revisions\/711"}],"wp:attachment":[{"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/threemillion.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}