<?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 Perl Interface to vCenter in VMware {code} Members</title>
    <link>https://communities.vmware.com/t5/VMware-code-Members/Perl-Interface-to-vCenter/m-p/2906457#M57</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here at Penn State we have some legacy Perl code that creates an inventory of VMs to display to users who are not logged into vSphere client. We are using a custom Perl module (named VM55.pm) to connect to vCenter.&amp;nbsp; Our VM55.pm Perl module uses the VIMRuntime.pm, VIRuntime.pm, VICommon.pm and VILib.pm modules.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We need to add some recently created vSphere Custom Attributes, aka properties, to our VM55.pm code so we can display the new Custom Attributes on the user interface pages.&amp;nbsp; Here is an example from our VM55.pm code of how we are successfully getting some of the existing properties from vCenter:&amp;nbsp;&lt;/P&gt;&lt;P&gt;$customPropertiesHash{"config.hardware.numCoresPerSocket"} = "";&lt;BR /&gt;$customPropertiesHash{"config.hardware.device"} = "";&lt;BR /&gt;$customPropertiesHash{"config.cpuAllocation.shares.shares"} = "";&lt;BR /&gt;$customPropertiesHash{"config.annotation"} = "";&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;##This string works correctly to get the old backup data listed in the "Notes" section of the properties.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is, what is the wording and syntax of the string data that denotes the new custom attributes string data?&amp;nbsp; I need to get the Last Backup date information.&amp;nbsp; Below I show some of my attempts that have not worked:&amp;nbsp;&lt;/P&gt;&lt;P&gt;#$customPropertiesHash{"config.customFields"} = "";&amp;nbsp;&lt;BR /&gt;#$customPropertiesHash{"config.custom.fields"} = "";&lt;BR /&gt;#$customPropertiesHash{"config.customAttributes"} = "";&lt;BR /&gt;#$customPropertiesHash{"config.customFields.lastBackup"} = ""; &amp;nbsp;&lt;/P&gt;&lt;P&gt;I can run a script in PowerCLI to get the properties from vCenter as shown below, including the Last Backup data:&lt;/P&gt;&lt;P&gt;"Name": "deploy-test-c864",&lt;BR /&gt;"CustomFields": "[Application/Service, ] [Backup, ] [Backup Status, Backup Job ID [111282] Client: [vcenter.blue.psu.edu], Backup Set: [defaultBackupSet], Subclient: [Zone-A] Parent Backup Job ID [108449]] [Budget Owner, ] [ClusterInvariantVMMId, ] [Customer, ] [Fixing Contact, ] [Last Backup, 4/25/2022 7:55:28 AM] [OS, ] [OS Patched, ] [Production Level, ] [Server Type, ] [Technical Contacts, ] [VRM Owner, ] [vrmManagedMachine, ]"&lt;/P&gt;&lt;P&gt;I am going to try other strings such as "config.customAttributes.lastBackup", "summary.customFields.lastBackup", "summary.config.customFields.lastBackup" and so on.&amp;nbsp; This is not a very efficient process to find the correct string data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would greatly appreciate any help or opinions in this matter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tad Rimmey&lt;/P&gt;&lt;P&gt;Penn State University&lt;/P&gt;</description>
    <pubDate>Thu, 28 Apr 2022 13:13:59 GMT</pubDate>
    <dc:creator>tadRimmey</dc:creator>
    <dc:date>2022-04-28T13:13:59Z</dc:date>
    <item>
      <title>Perl Interface to vCenter</title>
      <link>https://communities.vmware.com/t5/VMware-code-Members/Perl-Interface-to-vCenter/m-p/2906457#M57</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here at Penn State we have some legacy Perl code that creates an inventory of VMs to display to users who are not logged into vSphere client. We are using a custom Perl module (named VM55.pm) to connect to vCenter.&amp;nbsp; Our VM55.pm Perl module uses the VIMRuntime.pm, VIRuntime.pm, VICommon.pm and VILib.pm modules.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We need to add some recently created vSphere Custom Attributes, aka properties, to our VM55.pm code so we can display the new Custom Attributes on the user interface pages.&amp;nbsp; Here is an example from our VM55.pm code of how we are successfully getting some of the existing properties from vCenter:&amp;nbsp;&lt;/P&gt;&lt;P&gt;$customPropertiesHash{"config.hardware.numCoresPerSocket"} = "";&lt;BR /&gt;$customPropertiesHash{"config.hardware.device"} = "";&lt;BR /&gt;$customPropertiesHash{"config.cpuAllocation.shares.shares"} = "";&lt;BR /&gt;$customPropertiesHash{"config.annotation"} = "";&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;##This string works correctly to get the old backup data listed in the "Notes" section of the properties.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is, what is the wording and syntax of the string data that denotes the new custom attributes string data?&amp;nbsp; I need to get the Last Backup date information.&amp;nbsp; Below I show some of my attempts that have not worked:&amp;nbsp;&lt;/P&gt;&lt;P&gt;#$customPropertiesHash{"config.customFields"} = "";&amp;nbsp;&lt;BR /&gt;#$customPropertiesHash{"config.custom.fields"} = "";&lt;BR /&gt;#$customPropertiesHash{"config.customAttributes"} = "";&lt;BR /&gt;#$customPropertiesHash{"config.customFields.lastBackup"} = ""; &amp;nbsp;&lt;/P&gt;&lt;P&gt;I can run a script in PowerCLI to get the properties from vCenter as shown below, including the Last Backup data:&lt;/P&gt;&lt;P&gt;"Name": "deploy-test-c864",&lt;BR /&gt;"CustomFields": "[Application/Service, ] [Backup, ] [Backup Status, Backup Job ID [111282] Client: [vcenter.blue.psu.edu], Backup Set: [defaultBackupSet], Subclient: [Zone-A] Parent Backup Job ID [108449]] [Budget Owner, ] [ClusterInvariantVMMId, ] [Customer, ] [Fixing Contact, ] [Last Backup, 4/25/2022 7:55:28 AM] [OS, ] [OS Patched, ] [Production Level, ] [Server Type, ] [Technical Contacts, ] [VRM Owner, ] [vrmManagedMachine, ]"&lt;/P&gt;&lt;P&gt;I am going to try other strings such as "config.customAttributes.lastBackup", "summary.customFields.lastBackup", "summary.config.customFields.lastBackup" and so on.&amp;nbsp; This is not a very efficient process to find the correct string data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would greatly appreciate any help or opinions in this matter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tad Rimmey&lt;/P&gt;&lt;P&gt;Penn State University&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 13:13:59 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-code-Members/Perl-Interface-to-vCenter/m-p/2906457#M57</guid>
      <dc:creator>tadRimmey</dc:creator>
      <dc:date>2022-04-28T13:13:59Z</dc:date>
    </item>
  </channel>
</rss>

