<?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 vRA 7.6 / vRO date/time automatically to VM attribute in VMware Aria Automation Tools Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-Aria-Automation-Tools/vRA-7-6-vRO-date-time-automatically-to-VM-attribute/m-p/2317133#M18732</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi together,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got a question regarding how to add date/time automatically to a vm attribute during deployment.&lt;/P&gt;&lt;P&gt;Currently my colleagues need to fill the text field which is linked to VM attribute manually. &lt;/P&gt;&lt;P&gt;They want an automatically filled field in custorm form or a workflow which adds the date/time during deployment to the defined VM attribute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've build a workflow which generates the current date, time but I didn't know how to link them to the VM attribute:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15931044099682101 jive_text_macro" data-renderedposition="173.33334350585938_8_1233_272" jivemacro_uid="_15931044099682101" modifiedtitle="true"&gt;&lt;P&gt;var day = new Date().getDate().toString();&lt;/P&gt;&lt;P&gt;var month = (new Date().getMonth() + 1).toString();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(day.length &amp;lt; 2) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; day = "0" + day;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(month.length &amp;lt; 2) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; month = "0" + month;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var hour = new Date().getHours().toString();&lt;/P&gt;&lt;P&gt;var minute = new Date().getMinutes().toString();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(hour.length &amp;lt; 2) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; hour = "0" + hour;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(minute.length &amp;lt; 2) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; minute = "0" + minute;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var date = day + "." + month + "." + new Date().getFullYear() + " " + hour + ":" + minute;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VM attribute: &lt;SPAN style="color: #303030; font-family: Metropolis, 'Avenir Next', 'Helvetica Neue', Arial, sans-serif; font-size: 11px; background-color: #d9e4ea;"&gt;VMware.Attribute0.Value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Did someone no how to connect them so that I can use this workflow in my blueprint to fill automatically the needed attribute?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you guys.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Jun 2020 17:04:48 GMT</pubDate>
    <dc:creator>n8watcher</dc:creator>
    <dc:date>2020-06-25T17:04:48Z</dc:date>
    <item>
      <title>vRA 7.6 / vRO date/time automatically to VM attribute</title>
      <link>https://communities.vmware.com/t5/VMware-Aria-Automation-Tools/vRA-7-6-vRO-date-time-automatically-to-VM-attribute/m-p/2317133#M18732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi together,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got a question regarding how to add date/time automatically to a vm attribute during deployment.&lt;/P&gt;&lt;P&gt;Currently my colleagues need to fill the text field which is linked to VM attribute manually. &lt;/P&gt;&lt;P&gt;They want an automatically filled field in custorm form or a workflow which adds the date/time during deployment to the defined VM attribute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've build a workflow which generates the current date, time but I didn't know how to link them to the VM attribute:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15931044099682101 jive_text_macro" data-renderedposition="173.33334350585938_8_1233_272" jivemacro_uid="_15931044099682101" modifiedtitle="true"&gt;&lt;P&gt;var day = new Date().getDate().toString();&lt;/P&gt;&lt;P&gt;var month = (new Date().getMonth() + 1).toString();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(day.length &amp;lt; 2) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; day = "0" + day;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(month.length &amp;lt; 2) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; month = "0" + month;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var hour = new Date().getHours().toString();&lt;/P&gt;&lt;P&gt;var minute = new Date().getMinutes().toString();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(hour.length &amp;lt; 2) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; hour = "0" + hour;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(minute.length &amp;lt; 2) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; minute = "0" + minute;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var date = day + "." + month + "." + new Date().getFullYear() + " " + hour + ":" + minute;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VM attribute: &lt;SPAN style="color: #303030; font-family: Metropolis, 'Avenir Next', 'Helvetica Neue', Arial, sans-serif; font-size: 11px; background-color: #d9e4ea;"&gt;VMware.Attribute0.Value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Did someone no how to connect them so that I can use this workflow in my blueprint to fill automatically the needed attribute?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you guys.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2020 17:04:48 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-Aria-Automation-Tools/vRA-7-6-vRO-date-time-automatically-to-VM-attribute/m-p/2317133#M18732</guid>
      <dc:creator>n8watcher</dc:creator>
      <dc:date>2020-06-25T17:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: vRA 7.6 / vRO date/time automatically to VM attribute</title>
      <link>https://communities.vmware.com/t5/VMware-Aria-Automation-Tools/vRA-7-6-vRO-date-time-automatically-to-VM-attribute/m-p/2317134#M18733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;B&gt;n8watcher&lt;/B&gt;​,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think an easy way is to use pre-approval and subscription based on workflow (&lt;A href="https://docs.vmware.com/en/vRealize-Automation/7.2/com.vmware.vra.extensibility.doc/GUID-7B9DF011-2B29-419F-8994-22E16C2F6B07.html" title="https://docs.vmware.com/en/vRealize-Automation/7.2/com.vmware.vra.extensibility.doc/GUID-7B9DF011-2B29-419F-8994-22E16C2F6B07.html"&gt;Scenario: Create a Pre-Approval Workflow Subscription&lt;/A&gt; ). In the pre-approval custom properties, add the custom property you want to modify (&lt;SPAN style="color: #303030; font-family: Metropolis, 'Avenir Next', 'Helvetica Neue', Arial, sans-serif; background-color: #d9e4ea;"&gt;VMware.Attribute0.Name)&lt;/SPAN&gt;, and the value (&lt;SPAN style="color: #303030; font-family: Metropolis, 'Avenir Next', 'Helvetica Neue', Arial, sans-serif; background-color: #d9e4ea;"&gt;VMware.Attribute0.Value) -- &lt;A href="https://docs.vmware.com/en/vRealize-Automation/7.3/com.vmware.vra.prepare.use.doc/GUID-C22E0B76-D7E2-4E66-8D22-EE19DC81A050.html" title="https://docs.vmware.com/en/vRealize-Automation/7.3/com.vmware.vra.prepare.use.doc/GUID-C22E0B76-D7E2-4E66-8D22-EE19DC81A050.html"&gt;Configure the Approval Form to Include System and Custom Properties&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pre-Approval workflow will update the values previous the machine creation in vCenter and will populate the values in vCenter.&lt;/P&gt;&lt;P&gt;Pre-Approval wf needs to have (at least) two output values: approved (boolean) and fieldValues (Properties)&lt;/P&gt;&lt;P&gt;in approved you will have "true" and fieldValues will be the &lt;SPAN style="color: #303030; font-family: Metropolis, 'Avenir Next', 'Helvetica Neue', Arial, sans-serif; background-color: #d9e4ea;"&gt;VMware.Attribute0.Name and &lt;SPAN style="color: #303030; font-family: Metropolis, 'Avenir Next', 'Helvetica Neue', Arial, sans-serif; background-color: #d9e4ea;"&gt;VMware.Attribute0.Value:&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example for pre-approval wf:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var fieldValues = new Properties();&lt;/P&gt;&lt;P&gt;var approved = true;&lt;/P&gt;&lt;P&gt;fieldValues.put("source-provider-&lt;SPAN style="color: #303030; font-family: Metropolis, 'Avenir Next', 'Helvetica Neue', Arial, sans-serif; background-color: #d9e4ea;"&gt;VMware.Attribute0.Name,&lt;SPAN style="color: #303030; font-family: Metropolis, 'Avenir Next', 'Helvetica Neue', Arial, sans-serif; background-color: #d9e4ea;"&gt;VMware.Attribute0.Value);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Leandro. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2020 18:01:09 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-Aria-Automation-Tools/vRA-7-6-vRO-date-time-automatically-to-VM-attribute/m-p/2317134#M18733</guid>
      <dc:creator>lnairn</dc:creator>
      <dc:date>2020-06-26T18:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: vRA 7.6 / vRO date/time automatically to VM attribute</title>
      <link>https://communities.vmware.com/t5/VMware-Aria-Automation-Tools/vRA-7-6-vRO-date-time-automatically-to-VM-attribute/m-p/2317135#M18734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another way can be like the one in:&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/thread/330471"&gt;How set vm-description/notes and get datastore name, where the vm is located&lt;/A&gt;&amp;nbsp; (set vm-description part)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will copy the description info for the machine in vCenter and add the values you want to add there&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This can be executed at the end of machine provisioned with an event subscription.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2020 18:07:25 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-Aria-Automation-Tools/vRA-7-6-vRO-date-time-automatically-to-VM-attribute/m-p/2317135#M18734</guid>
      <dc:creator>lnairn</dc:creator>
      <dc:date>2020-06-26T18:07:25Z</dc:date>
    </item>
  </channel>
</rss>

