n8watcher
Contributor
Contributor

vRA 7.6 / vRO date/time automatically to VM attribute

Hi together,

I've got a question regarding how to add date/time automatically to a vm attribute during deployment.

Currently my colleagues need to fill the text field which is linked to VM attribute manually.

They want an automatically filled field in custorm form or a workflow which adds the date/time during deployment to the defined VM attribute.

I've build a workflow which generates the current date, time but I didn't know how to link them to the VM attribute:

var day = new Date().getDate().toString();

var month = (new Date().getMonth() + 1).toString();

if(day.length < 2) {

  day = "0" + day;

}

if(month.length < 2) {

  month = "0" + month;

}

var hour = new Date().getHours().toString();

var minute = new Date().getMinutes().toString();

if(hour.length < 2) {

  hour = "0" + hour;

}

if(minute.length < 2) {

  minute = "0" + minute;

}

var date = day + "." + month + "." + new Date().getFullYear() + " " + hour + ":" + minute;

VM attribute: VMware.Attribute0.Value

Did someone no how to connect them so that I can use this workflow in my blueprint to fill automatically the needed attribute?

Thank you guys.

Reply
0 Kudos