VMware Cloud Community
MakeItWork
Enthusiast
Enthusiast

How to add approval properties to vRA 7 External Approvals

Good day all,

Here is how the approval process is setup.

  • Approval policy has a single level, and is setup to use External Approval
  • The external approval workflow is called by an Event Subscription for a Pre Approval
  • The vRO workflow grabs the available data from the input called payload
  • The Workflow then makes the request to the external system (ServiceNow)
  • The WF then polls SNOW to see if the request is approved / rejected, the completes the pre approval.

But I need to add the Number of CPU's, and Memory Size (as a minimum). 

There are only two Properties available under System Properties for the approval level.

Screen Shot 2016-04-25 at 2.42.51 PM.png

I've tried adding VirtualMachine.CPU.Count and VirtualMachine.Memory.Size as a custom property (I also tried vSphere_Machine_1-property name). However fieldValues is never populated.

Screen Shot 2016-04-25 at 2.38.54 PM.png

Any thoughts on how I can add those property values to the payload fieldValues?

Visit us at http://www.cloudnutz.com and twitter @cloudnutz
Reply
0 Kudos
6 Replies
koushik_vmware
Enthusiast
Enthusiast

Dear,

Did you find the way how to get the custom properties in vRO workflow in case of Approval process ?

Basically I would like to get the machine related information/custom properties (memory, CPU, daily Cost etc) in vRO WF and from their I need to send an Approval mail with all these information to the external approvers. Based on these information, the approver can approve/reject the request via email.

Please help me out if you find the way.

Thanks,

Koushik

Reply
0 Kudos
koushik_vmware
Enthusiast
Enthusiast

Dear,

Can you please let me know if you find the way out ?

Thanks,

Koushik

Reply
0 Kudos
MakeItWork
Enthusiast
Enthusiast

Sorry for the delay, I didn't see your first request.

No I have NOT been able to figure that out. 

I reached out the the VMware PSO organization and they told me to change the approval type to catalog item - Virtual Machine as a work around.  Unfortunately I have not had time to test that out yet.

My position is the information is in the system somewhere, but I can't find it in either database (postgres or MS SQL), nor can I find anything in the API that indicates where or how the form data is being held.

I wish you good luck in your endeavor.  Please let me know if you are able to figure it out.

Sincerely,

Dana

Visit us at http://www.cloudnutz.com and twitter @cloudnutz
Reply
0 Kudos
MakeItWork
Enthusiast
Enthusiast

Oops I spoke to soon, I think I found it by accident

Look at this post, Request vRA 7.0.1 Catalog Item from vRO I think if we request the machine using this modified workflow, you will get a bunch of useful information from the JSON.

Here is what I got by uncommenting the customize request data section

{

  "Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.BuildingMachine" : "*",

  "Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.Disposing" : "*",

  "Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.MachineActivated" : "*",

  "Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.MachineProvisioned" : "*",

  "Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.Requested" : "*",

  "Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.UnprovisionMachine" : "*",

  "Hostname" : "CustomMachineNameHere",

  "VLAN12" : {

    "componentTypeId" : "com.vmware.csp.component.cafe.composition",

    "componentId" : null,

    "classId" : "Blueprint.Component.Declaration",

    "typeFilter" : "SNOW*VLAN12",

    "data" : {

      "_hasChildren" : false,

      "description" : null

    }

  },

  "_archiveDays" : 1,

  "_number_of_instances" : 1,

  "vSphere_Machine_1" : {

    "componentTypeId" : "com.vmware.csp.component.cafe.composition",

    "componentId" : null,

    "classId" : "Blueprint.Component.Declaration",

    "typeFilter" : "SNOW*vSphere_Machine_1",

    "data" : {

      "_allocation" : {

        "componentTypeId" : "com.vmware.csp.iaas.blueprint.service",

        "componentId" : null,

        "classId" : "Infrastructure.Compute.Machine.Allocation",

        "typeFilter" : null,

        "data" : {

          "machines" : [ {

            "componentTypeId" : "com.vmware.csp.iaas.blueprint.service",

            "componentId" : null,

            "classId" : "Infrastructure.Compute.Machine.Allocation.Machine",

            "typeFilter" : null,

            "data" : {

              "machine_id" : "",

              "nics" : [ {

                "componentTypeId" : "com.vmware.csp.iaas.blueprint.service",

                "componentId" : null,

                "classId" : "Infrastructure.Compute.Machine.Nic",

                "typeFilter" : null,

                "data" : {

                  "address" : "",

                  "assignment_type" : "Static",

                  "external_address" : "",

                  "id" : null,

                  "load_balancing" : null,

                  "network" : null,

                  "network_profile" : null

                }

              } ]

            }

          } ]

        }

      },

      "_cluster" : 1,

      "_hasChildren" : false,

      "cpu" : 1,

      "datacenter_location" : null,

      "description" : null,

      "disks" : [ {

        "componentTypeId" : "com.vmware.csp.iaas.blueprint.service",

        "componentId" : null,

        "classId" : "Infrastructure.Compute.Machine.MachineDisk",

        "typeFilter" : null,

        "data" : {

          "capacity" : 16,

          "custom_properties" : null,

          "id" : 1460838927066,

          "initial_location" : "",

          "is_clone" : true,

          "label" : "Hard disk 1",

          "storage_reservation_policy" : "",

          "userCreated" : false,

          "volumeId" : 0

        }

      } ],

      "display_location" : false,

      "guest_customization_specification" : "dag-linux-vra",

      "machine_prefix" : null,

      "max_network_adapters" : -1,

      "max_per_user" : 0,

      "max_volumes" : 60,

      "memory" : 2048,

      "nics" : [ {

        "componentTypeId" : "com.vmware.csp.iaas.blueprint.service",

        "componentId" : null,

        "classId" : "Infrastructure.Compute.Machine.Nic",

        "typeFilter" : null,

        "data" : {

          "address" : "",

          "assignment_type" : "Static",

          "external_address" : "",

          "id" : null,

          "load_balancing" : null,

          "network" : null,

          "network_profile" : null

        }

      } ],

      "os_arch" : "x86_64",

      "os_distribution" : null,

      "os_type" : "Linux",

      "os_version" : null,

      "property_groups" : [ null ],

      "reservation_policy" : null,

      "security_groups" : [ ],

      "security_tags" : [ ],

      "storage" : 16

    }

  }

}

Good luck,

Dana

Visit us at http://www.cloudnutz.com and twitter @cloudnutz
Reply
0 Kudos
koushik_vmware
Enthusiast
Enthusiast

Thanks Dana, Yes, I am also able to get the values of CPU, Memory after setting the approval type to catalog item - Virtual Machine.

I executing the catalog request from vRA7. Now I have another issue. I would like to get all the details like Number of Deployments, CPU, Memory, TotalCost, etc.

To get the details of property like 'Number of Deployments' I need to set the approval type to catalog item - Composite BluePrint...Now my question is how this can be achieve ?

Is there any API from there I can get the Number Of deployments of that BluePrint ? I tried to find out that API but couldn't .


Thanks,

koushik

Reply
0 Kudos
koushik_vmware
Enthusiast
Enthusiast

Hello Dana,

Thanks, Now I am able to get all the information from the CatalogItemRequest. There is a method "getRequestData()" in the CatalogItemRequest class. This method did work for me and now I am able to get all the machine related information. I am using the approval type to catalog item - Virtual Machine.

Thanks for your help and assistance.

Thanks,

Koushik

Reply
0 Kudos