Collect VM information using PostProvisionSource object

A PostProvisionSource object is created with information about a virtual machine that is collected during provisioning. Users can use this normalized object to retrieve all required provider-specific information about each VM instance.

Details provided and obtained during VM provisioning, such as IP address and operating system type, are stored in a normalized object called PostProvisionSource on the workflow scratchpad. The following is an example for retrieving the stored information from the normalized object.
        var ipAddress = workflow.scratchpad.PostProvisionSource.instances[0].ip_address;
        var os = workflow.scratchpad.PostProvisionSource.instances[0].os;
A PostProvisionSource object is created after provisioning with the collected IP address and the populated private IP address. It can also contain additional properties if so desired. A sample PostProvisionSource object look like:
{
        "instances" : [
          { "os": "Linux"
          "ip_address": "02.03.06.05",
          "primary_private_ip": "10.0.0.0"}
         ]
        "extension" : {} // other custom properties may be added to this extension object
         }
The normalized object is then created based on the mapping table.
 Property          Value                                            Active
 instances         scratchpad.provisionResult.return_instances       true                       
    
Note that different information is collected for each cloud provider.

Sample PostProvisionSource object for an EC2 instance

The PostProvisionSource object for an Amazon EC2 instance contains both common and AWS-specific properties.

Example of a PostProvisionSource object for EC2

The following PostProvisionSource object is created with VM information collected during provisioning of an instance in EC2.
{
        "instances" : [
        { 
          "availabilityZone": "us-west",
          "dns": "ec2-0160903.aws.com",
          "image_id": "ai356tleqjk71",
          "instance_id": "b13w345pmc",
          "instance_name_tag": "ec2-7-1",
          "instance_state": "7",
          "instance_type": "d1-ety",
          "ip_address": "09.03.17.08",
          "os": "linux",
          "private_dns": "ilr434j930j-3",
          "primary_private_ip": "02.10.01.40",
          "root_device_name": "null",
          "root_device_type": "inst-wei",
          "subnet_id": "savt-784b2fg",
          "tags": {
             "Name": "ec2na7nql",
             "Tag Set": "MLQ49AG02",
             "User Name": "System Administrator"
           },
       "volumes": [     
       ],
       "vpc_id": "vza3bf83df71dy"
      }
     ]
     "extension" : {} // other custom properties may be added to this extension object
   }
  

Sample PostProvisionSource object for an Azure instance

The PostProvisionSource object for an Azure instance contains both common and Azure-specific properties.

Example of a PostProvisionSource object for Azure

The following PostProvisionSource object is created with VM information collected during provisioning of an instance in Azure.
{
        "instances" : [
          { 
           "admin_username": "qzrwnfsj",
           "computer_name": "qzrwnfsj470",
           "container": "hcqi",
           "disks": "[]",
           "image_id": "23vejd903d9231071438fdfho3cnxt891",
           "ip_address": "02.401.200.13",
           "name": "qzrwnfsj470",
           "os": "Linux",
           "primary_private_ip": "03.0.0.40",
           "region": "West US",
           "state": "on",
           "vm_size": "Basic A0"}
        ]   
        "extension" : {} // other custom properties may be added to this extension object
      }
    

Sample PostProvisionSource object for a VMware instance

The PostProvisionSource object for an Azure instance contains both common and VMware-specific properties.

Example of a PostProvisionSource object for VMware

The following PostProvisionSource object is created with VM information collected during provisioning of an instance in VMware.
{  
        "instances" : [
        { 
         "config": "Yes",
         "config_automation": "Yes",
         "cpus": "1",
         "datastore_morid": "dst32c7i3",
         "disks": "[{\"provisionMode\":\"fr\",\"size\":\"25\"}]",
         "hostname": "gjerr",
         "instanceUuid": "lafjPN1nf4457jfbsD03FDN",
         "ip_address": "01.02.04.03",
         "memory": "123",
         "morid": "v4559",
         "name": "fbiwerier493",
         "network_config": "dhcp",
         "os": "Linux",
         "serialNumber": "VMWare483 jiejf3 343 034fjAL23NA33043 30efj34878n,
         "template": "b392djkf39j20cn3j03jazxsd",
         "uuid": "3483vnhg4s3nfw3910j043h4",
         "vcenter": "03.01.04.05"
        }
        ]   
        "extension" : {} // other custom properties may be added to this extension object
        }