<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Correlate GuestDiskInfo with VirtualHardware in VMware Aria Automation Orchestrator Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-Aria-Automation/Correlate-GuestDiskInfo-with-VirtualHardware/m-p/2273307#M20079</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That will get you the VcGuestDiskInfo object (&lt;A href="https://www.vmware.com/support/orchestrator/doc/vro-vsphere60-api/html/VcGuestDiskInfo.html" title="https://www.vmware.com/support/orchestrator/doc/vro-vsphere60-api/html/VcGuestDiskInfo.html"&gt;https://www.vmware.com/support/orchestrator/doc/vro-vsphere60-api/html/VcGuestDiskInfo.html&lt;/A&gt;), which just tells you the mount path and the size.&amp;nbsp; Helpful.&amp;nbsp; However, to be useful, you need to be able to get the VcVirtualDisk under vm.config.hardware.device.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, this will show you what the guest OS sees from a mount path standpoint:&lt;/P&gt;&lt;P&gt;for (var ix in u_vm.guest.disk)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log('----------');&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log(ix.toString());&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log('DiskPath: ' + u_vm.guest.disk[ix].diskPath);&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log('Freespace (GB): ' + (u_vm.guest.disk[ix].freeSpace / 1024 / 1024 / 1024).toString());&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log('Capacity (GB): ' + (u_vm.guest.disk[ix].capacity / 1024 / 1024 / 1024).toString());&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, none of that corresponds to anything I've been able to find in other objects.&amp;nbsp; There is no order that universally works that I can find.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for (var ix in u_vm.config.hardware.device)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (u_vm.config.hardware.device[ix] instanceof VcVirtualDisk)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log(ix.toString() + ': ' + u_vm.config.hardware.device[ix].deviceInfo.label);&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log(ix.toString() + ': ' + u_vm.config.hardware.device[ix].deviceInfo.summary);&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log(ix.toString() + ': ' + u_vm.config.hardware.device[ix].diskObjectId);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in general, we need to match these two for loops up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Sep 2016 19:59:51 GMT</pubDate>
    <dc:creator>jarushepic</dc:creator>
    <dc:date>2016-09-30T19:59:51Z</dc:date>
    <item>
      <title>Correlate GuestDiskInfo with VirtualHardware</title>
      <link>https://communities.vmware.com/t5/VMware-Aria-Automation/Correlate-GuestDiskInfo-with-VirtualHardware/m-p/2273302#M20074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to create a workflow to automate disk extend based on free space (less than 10%).&lt;/P&gt;&lt;P&gt;I get the free space with &lt;A href="http://pubs.vmware.com/vsphere-60/topic/com.vmware.wssdk.apiref.doc/vim.vm.GuestInfo.DiskInfo.html"&gt;GuestDiskInfo&lt;/A&gt; -&amp;nbsp; "vm.guest.disk.freeSpace" and "vm.guest.disk.capacity".&lt;/P&gt;&lt;P&gt;The problem is that I can't correlate this to the &lt;A href="http://pubs.vmware.com/vsphere-60/topic/com.vmware.wssdk.apiref.doc/vim.vm.VirtualHardware.html"&gt;VirtualHardware&lt;/A&gt; disk (vm.config.hardware.device) so I can't tell which disk needed to be extend.&lt;/P&gt;&lt;P&gt;I can get what seems like the disk object with " vm.guest.disk[i]" but I don’t know how to use it for something useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any tips on how to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script I use to get the free space – (it's in a very initial stage…)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var disks = vm.guest.disk;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for (i in disks)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt; System.log("DiskPath - " + (disks[i].diskPath));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.log("FreeSpace (GB) - " + (disks[i].freeSpace / 1024 / 1024 / 1024));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.log("Capacity (GB) - " + (disks[i].capacity / 1024 / 1024 / 1024));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((disks[i].freeSpace / disks[i].capacity) &amp;lt;= 0.1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var diskToGrow = disks[i];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var diskNewSize = Math.round(((disks[i].capacity * 1.05) / 1024 / 1024 / 1024));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2016 07:30:58 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-Aria-Automation/Correlate-GuestDiskInfo-with-VirtualHardware/m-p/2273302#M20074</guid>
      <dc:creator>GBrown1983</dc:creator>
      <dc:date>2016-09-30T07:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Correlate GuestDiskInfo with VirtualHardware</title>
      <link>https://communities.vmware.com/t5/VMware-Aria-Automation/Correlate-GuestDiskInfo-with-VirtualHardware/m-p/2273303#M20075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a tricky one...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately I don't have any code to help you with this but perhaps some advice..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which type of OS are you dealing with? I know that I used a powershell script for Windows for the same problem. The Windows volumes have the disk index of the SCSI as a property and so you can relate them that way and then resize the appropriate disk. Match the volume is on the SCSI from the OS with the index from the disk properties and you should then know which disk you are dealing with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Typically with *Nix systems particularly ones using LVM they will want to simply add a VMDK to the VM and then add that disk into the existing volume.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that points you in the right direction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out this link to see the disk properties available to you from the Windows OS&lt;/P&gt;&lt;P&gt;&lt;A href="https://msdn.microsoft.com/en-us/library/aa394515(v=vs.85).aspx" title="https://msdn.microsoft.com/en-us/library/aa394515(v=vs.85).aspx"&gt;Win32_Volume class (Windows)&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2016 11:38:53 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-Aria-Automation/Correlate-GuestDiskInfo-with-VirtualHardware/m-p/2273303#M20075</guid>
      <dc:creator>jacksonecac</dc:creator>
      <dc:date>2016-09-30T11:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Correlate GuestDiskInfo with VirtualHardware</title>
      <link>https://communities.vmware.com/t5/VMware-Aria-Automation/Correlate-GuestDiskInfo-with-VirtualHardware/m-p/2273304#M20076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would love to be able to do this all within vRO.&amp;nbsp; I'd like to have a vRA task that i can present to our SQL Admins and it populates the disk path with stuff from guest info, they pick which one they want to expand, and then vRO expands it.&amp;nbsp; However, we have never been able to figure out how to do this.&amp;nbsp; Right now this is a very manual process where the requester (Linux or WIndows) runs a script to get the UUID of the device.&amp;nbsp; Then we can run some powershell to match the UUID to the "Hard Disk #", then we can manually grow the disk on the VM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really don't want to run powershell or bash in order to do this, i want to do it all in vRO.&amp;nbsp; We have thousands of VMs and vRO has no business logging into them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2016 17:42:00 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-Aria-Automation/Correlate-GuestDiskInfo-with-VirtualHardware/m-p/2273304#M20076</guid>
      <dc:creator>jarushepic</dc:creator>
      <dc:date>2016-09-30T17:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Correlate GuestDiskInfo with VirtualHardware</title>
      <link>https://communities.vmware.com/t5/VMware-Aria-Automation/Correlate-GuestDiskInfo-with-VirtualHardware/m-p/2273305#M20077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is naming. vmware doesn't care whether or not a disk is named C, T, Z... etc. Unfortunately all the app developers, admins etc do care about those names and so since that is what they are referring to then that is how you need to make your connection. To sidestep this you would need the requester to provide the SCSI index and Bus in order to do the expansion without touching the OS layer. &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.vmware.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2016 18:41:21 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-Aria-Automation/Correlate-GuestDiskInfo-with-VirtualHardware/m-p/2273305#M20077</guid>
      <dc:creator>jacksonecac</dc:creator>
      <dc:date>2016-09-30T18:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Correlate GuestDiskInfo with VirtualHardware</title>
      <link>https://communities.vmware.com/t5/VMware-Aria-Automation/Correlate-GuestDiskInfo-with-VirtualHardware/m-p/2273306#M20078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This angered me so I did some digging. I am not sure if this works or not but judging by the API it looks like it is relevant. Check it out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input: Virtualmachine vm, String diskName&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var guest = vm.guest&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var disks = guest.disk;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for each(var i disk in disk)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i.diskPath == diskName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var diskToReize = i;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2016 19:53:29 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-Aria-Automation/Correlate-GuestDiskInfo-with-VirtualHardware/m-p/2273306#M20078</guid>
      <dc:creator>jacksonecac</dc:creator>
      <dc:date>2016-09-30T19:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Correlate GuestDiskInfo with VirtualHardware</title>
      <link>https://communities.vmware.com/t5/VMware-Aria-Automation/Correlate-GuestDiskInfo-with-VirtualHardware/m-p/2273307#M20079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That will get you the VcGuestDiskInfo object (&lt;A href="https://www.vmware.com/support/orchestrator/doc/vro-vsphere60-api/html/VcGuestDiskInfo.html" title="https://www.vmware.com/support/orchestrator/doc/vro-vsphere60-api/html/VcGuestDiskInfo.html"&gt;https://www.vmware.com/support/orchestrator/doc/vro-vsphere60-api/html/VcGuestDiskInfo.html&lt;/A&gt;), which just tells you the mount path and the size.&amp;nbsp; Helpful.&amp;nbsp; However, to be useful, you need to be able to get the VcVirtualDisk under vm.config.hardware.device.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, this will show you what the guest OS sees from a mount path standpoint:&lt;/P&gt;&lt;P&gt;for (var ix in u_vm.guest.disk)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log('----------');&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log(ix.toString());&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log('DiskPath: ' + u_vm.guest.disk[ix].diskPath);&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log('Freespace (GB): ' + (u_vm.guest.disk[ix].freeSpace / 1024 / 1024 / 1024).toString());&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log('Capacity (GB): ' + (u_vm.guest.disk[ix].capacity / 1024 / 1024 / 1024).toString());&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, none of that corresponds to anything I've been able to find in other objects.&amp;nbsp; There is no order that universally works that I can find.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for (var ix in u_vm.config.hardware.device)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (u_vm.config.hardware.device[ix] instanceof VcVirtualDisk)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log(ix.toString() + ': ' + u_vm.config.hardware.device[ix].deviceInfo.label);&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log(ix.toString() + ': ' + u_vm.config.hardware.device[ix].deviceInfo.summary);&lt;/P&gt;&lt;P&gt;&amp;nbsp; System.log(ix.toString() + ': ' + u_vm.config.hardware.device[ix].diskObjectId);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in general, we need to match these two for loops up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2016 19:59:51 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-Aria-Automation/Correlate-GuestDiskInfo-with-VirtualHardware/m-p/2273307#M20079</guid>
      <dc:creator>jarushepic</dc:creator>
      <dc:date>2016-09-30T19:59:51Z</dc:date>
    </item>
  </channel>
</rss>

