VMware Cloud Community
Windspirit
Hot Shot
Hot Shot
Jump to solution

Looking for the right Custom Properties for event VMPSMasterWorkflow32.EVENT.ReconfigureVM

I`m having problems finding the correct Custom properties fro the events VMPSMasterWorkflow32.EVENT.ReconfigureVM so that I get more information into vRO.

For the normal VM provisioning process the stuff was mapped by pretty good here: vRealize Automation 7 – Enabling the Event Broker » Extending Clouds see the spreadsheet. However I cant not figure out where to get that information. No vmware doc seams to have a list or some ideas

What i want to do is hook into the reconfigure Action. The reconfigure action triggers the following (vRA7.1) events:

  • VMPSMasterWorkflow32.EVENT.ReconfigureVM.Pending
  • VMPSMasterWorkflow32.EVENT.ReconfigureVM.Successful
  • VMPSMasterWorkflow32.EVENT.ReconfigureVM.Complete
  • VMPSMasterWorkflow32.EVENT.ReconfigureVM.Failed

But without the customer property I only get this information from the payload:

/lifecycleState/phase : EVENT

/lifecycleState/state : VMPSMasterWorkflow32.VMPSMasterWorkflow32

/lifecycleState/event : VMPSMasterWorkflow32.VMPSMasterWorkflow32.EVENT.ReconfigureVM.Complete

/componentId : vSphere_Machine_1

/blueprintName : test

/componentTypeId : Infrastructure.CatalogItem.Machine.Virtual.vSphere

/IaaSTimeoutId : 1019

/endpointId : 398eb55d-a68e-4ff2-8f1b-07d4d4bafb93

/machine/externalReference : vm-618

/machine/owner : configurationadmin@vsphere.local

/machine/name : test31

/machine/id : e2824606-c8e1-4678-9f9d-6f19611ce9ad

/machine/type : 0

/requestId : 06fdb66f-1253-45a7-b6d5-e40e86483f0e

__asd_requestedBy

__asd_tenantRef

__asd_targetResourceProviderTypeId

__asd_requestInstanceId

__asd_requestInstanceTypeId

__asd_catalogRequestId

__asd_requestedFor

__asd_targetResourceId

__asd_requestInstanceTimestamp

__asd_targetResourceTypeId

__asd_correlationId

__asd_requestTraceId

__asd_targetResourceProviderId

What I need would be the the machine properties of the VM, such as:

/machine/properties/VirtualMachine.Memory.Size : 1024

/machine/properties/VirtualMachine.Cafe.Blueprint.Component.Cluster.Index : 0

/machine/properties/VirtualMachine.CPU.Count : 1

/machine/properties/__Clone_Type : CloneWorkflow

/machine/properties/__clonespec : Linux

/machine/properties/VirtualMachine.Admin.TotalDiskUsage : 5120

/machine/properties/VirtualMachine.Disk0.Label : Hard disk 1

Anyone?

PS: you can rad the properties pretty easy with the following vRO workflow:

function getSubproperties(subject,prop){

    for each (subkey in prop.keys) {

        subcontent=prop.get(subkey);

        if ((typeof subcontent) == "object"){

            getSubproperties((subject+"/"+subkey),subcontent);

        } else {

            System.log((subject+"/"+subkey) + " : " + subcontent); 

        }

    }

}

for each (key in payload.keys) {

    content=payload.get(key);

    if ((typeof content) == "object"){

        getSubproperties(("/"+key),content);

    } else {

            System.log("/"+key + " : " + content); 

    }

}

Reply
0 Kudos
1 Solution

Accepted Solutions
sascha_milic
Hot Shot
Hot Shot
Jump to solution

Hi,

did you try to add Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.VMPSMasterWorkflow32 with value "*" to your Blueprint?

That simply tells the Event Broker to add the custom properties to the schema (for all global events).

Same like Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.BuildMachine with value "*" in case you want to get the custom properties in that state.



View solution in original post

Reply
0 Kudos
7 Replies
sascha_milic
Hot Shot
Hot Shot
Jump to solution

Hi Daniel,

to get custom properties populated into the schema / payload you need to use the names of the corresponding states (means you can't address events).

So for the global events you are using: Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.VMPSMasterWorkflow32

For all other events the corresponding state name: i.e. Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.Requested for the event VMPSMasterWorkflow32.Requested.EVENT.OnProvisionMachine

With 7.1 all the new "Reconfigure" events were added to the list of global events.

HTH

Sascha

Reply
0 Kudos
Windspirit
Hot Shot
Hot Shot
Jump to solution

Hi,

Im not sure what you like to say. Maybe I made myself not clear enough.

Im searching for the correct Custom Property that populates the Change event. I tried several different ones. But none is working.

In the meantime I found a workaround using an vRO Action:

Input is the VC-VM that is part of the payload the output is Properties.

//get Infrahost

var infraHost = Server.findAllForType("vCAC:VCACHost")[0];

//search for VCAC VM

virtualMachine=Server.findAllForType("vCAC:VirtualMachine", "ExternalReferenceId eq '" + vcvm.id + "'")[0];

//read properties

//form VCAC ACTIOBN: getPropertiesFromVirtualMachine

var properties = new Properties();

properties.put("VirtualMachineID", virtualMachine.virtualMachineID);

var virtualMachineEntity = vCACEntityManager.readModelEntity(infraHost.id, "ManagementModelEntities.svc", "VirtualMachines", properties, null);

var vmProperties = new Properties();

var virtualMachinePropertiesEntities = virtualMachineEntity.getLink(infraHost, "VirtualMachineProperties");

for each (var virtualMachinePropertiesEntity in virtualMachinePropertiesEntities) {

    var propertyName = virtualMachinePropertiesEntity.getProperty("PropertyName");

    var propertyValue = virtualMachinePropertiesEntity.getProperty("PropertyValue");

    //System.log("Found property " + propertyName + " = " + propertyValue);

    vmProperties.put(propertyName, propertyValue);

}

return vmProperties;

Reply
0 Kudos
sascha_milic
Hot Shot
Hot Shot
Jump to solution

Hi,

did you try to add Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.VMPSMasterWorkflow32 with value "*" to your Blueprint?

That simply tells the Event Broker to add the custom properties to the schema (for all global events).

Same like Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.BuildMachine with value "*" in case you want to get the custom properties in that state.



Reply
0 Kudos
Windspirit
Hot Shot
Hot Shot
Jump to solution

Thnaks thats working now. I was sure I had tried that one...maybe I did something stupidly wrong...happens.

SAY....is there any way to find out what has been changed? I had hopes that the property "virtualMachineAddOrUpdateProperties - Properties of the virtual machine to be added or updated(Array Of Infrastructure.CustomProperty)" that is shown in the Event Manager Subciption Page will give me the information, however its not part of the payload.

Thats the payload I´m getting:

[2016-09-19 08:56:10.120] [I] /lifecycleState/phase : EVENT

[2016-09-19 08:56:10.121] [I] /lifecycleState/state : VMPSMasterWorkflow32.VMPSMasterWorkflow32

[2016-09-19 08:56:10.122] [I] /lifecycleState/event : VMPSMasterWorkflow32.VMPSMasterWorkflow32.EVENT.ReconfigureVM.Complete

[2016-09-19 08:56:10.123] [I] /componentId : vSphere_Machine_1

[2016-09-19 08:56:10.124] [I] /blueprintName : test

[2016-09-19 08:56:10.125] [I] /componentTypeId : Infrastructure.CatalogItem.Machine.Virtual.vSphere

[2016-09-19 08:56:10.126] [I] /IaaSTimeoutId : 1189

[2016-09-19 08:56:10.127] [I] /endpointId : 398eb55d-a68e-4ff2-8f1b-07d4d4bafb93

[2016-09-19 08:56:10.128] [I] /machine/externalReference : vm-661

[2016-09-19 08:56:10.129] [I] /machine/owner : configurationadmin@vsphere.local

[2016-09-19 08:56:10.130] [I] /machine/name : test35

[2016-09-19 08:56:10.131] [I] /machine/id : 44b279f4-965a-48d3-a53a-b5586e5c7929

[2016-09-19 08:56:10.132] [I] /machine/type : 0

[2016-09-19 08:56:10.133] [I] /machine/properties/VirtualMachine.Cafe.Blueprint.Id : test

[2016-09-19 08:56:10.134] [I] /machine/properties/VirtualMachine.Disk0.Name : Hard disk 1

[2016-09-19 08:56:10.135] [I] /machine/properties/__InterfaceType : vSphere

[2016-09-19 08:56:10.136] [I] /machine/properties/VirtualMachine.Network0.PrimaryDns : 192.168.220.10

[2016-09-19 08:56:10.137] [I] /machine/properties/StateOperationEvent : False

[2016-09-19 08:56:10.138] [I] /machine/properties/VirtualMachine.Network0.DnsSuffix : mylab.local

[2016-09-19 08:56:10.139] [I] /machine/properties/__VirtualMachine.Allocation.InitialMachineState : SubmittingRequest

[2016-09-19 08:56:10.140] [I] /machine/properties/VirtualMachine.Cafe.Blueprint.Component.TypeId : Infrastructure.CatalogItem.Machine.Virtual.vSphere

[2016-09-19 08:56:10.141] [I] /machine/properties/VirtualMachine.Admin.UUID : 503cf638-82a8-e2bc-1b37-48198c508e72

[2016-09-19 08:56:10.142] [I] /machine/properties/__api.request.id : f810f0d6-f4f0-4991-bac6-f02754b9b689

[2016-09-19 08:56:10.143] [I] /machine/properties/VirtualMachine.Disk0.Size : 5

[2016-09-19 08:56:10.144] [I] /machine/properties/proptest : false

[2016-09-19 08:56:10.145] [I] /machine/properties/__api.request.callback.service.id : f84819c6-1e97-4e3e-9c26-e7d2d0b5e1d9

[2016-09-19 08:56:10.146] [I] /machine/properties/VirtualMachine.Cafe.Blueprint.Name : test

[2016-09-19 08:56:10.147] [I] /machine/properties/Cafe.Shim.VirtualMachine.TotalStorageSize : 5

[2016-09-19 08:56:10.148] [I] /machine/properties/__Legacy.Workflow.ImpersonatingUser : configurationadmin@vsphere.local

[2016-09-19 08:56:10.149] [I] /machine/properties/__Legacy.Workflow.User : configurationadmin@vsphere.local

[2016-09-19 08:56:10.150] [I] /machine/properties/__VirtualMachine.ProvisioningWorkflowName : CloneWorkflow

[2016-09-19 08:56:10.151] [I] /machine/properties/VirtualMachine.Network0.DnsSearchSuffixes : mylab.local

[2016-09-19 08:56:10.152] [I] /machine/properties/VirtualMachine.Network0.NetworkProfileName : 220

[2016-09-19 08:56:10.153] [I] /machine/properties/VirtualMachine.Network0.SubnetMask : 255.255.255.0

[2016-09-19 08:56:10.154] [I] /machine/properties/VirtualMachine.Disk0.ExternalID : 6000C290-812b-e852-06f4-acbe436cea66

[2016-09-19 08:56:10.155] [I] /machine/properties/__datacollected_ipaddress : 192.168.220.121

[2016-09-19 08:56:10.156] [I] /machine/properties/VirtualMachine.Network0.AddressType : Static

[2016-09-19 08:56:10.157] [I] /machine/properties/__Cafe.Request.VM.LeaseDays : 1

[2016-09-19 08:56:10.158] [I] /machine/properties/__request_reason :

[2016-09-19 08:56:10.159] [I] /machine/properties/__Cafe.Root.Request.Id : e436424b-8492-4624-8b06-ed445a93aba6

[2016-09-19 08:56:10.160] [I] /machine/properties/_number_of_instances : 1

[2016-09-19 08:56:10.161] [I] /machine/properties/VirtualMachine.Admin.AgentID : 3fc83c42-1092-04d4-4627-ab5fd7ea58cb

[2016-09-19 08:56:10.162] [I] /machine/properties/VirtualMachine.Disk0.IsClone : true

[2016-09-19 08:56:10.163] [I] /machine/properties/VirtualMachine.Network0.MacAddress : 00:50:56:bc:71:36

[2016-09-19 08:56:10.164] [I] /machine/properties/__Cafe.Request.VM.ArchiveDays : 1

[2016-09-19 08:56:10.165] [I] /machine/properties/__Cafe.Request.VM.HostnamePrefix : test

[2016-09-19 08:56:10.166] [I] /machine/properties/__clonefromid : 88a47c18-e390-4b28-bc1f-d4ee020cd851

[2016-09-19 08:56:10.167] [I] /machine/properties/VirtualMachine.Disk0.DeviceID : SCSI (0:0)

[2016-09-19 08:56:10.168] [I] /machine/properties/__Cafe.Request.BlueprintType : 1

[2016-09-19 08:56:10.169] [I] /machine/properties/VirtualMachine.Memory.Size : 1188

[2016-09-19 08:56:10.170] [I] /machine/properties/VirtualMachine.Admin.Hostname : myCluster

[2016-09-19 08:56:10.171] [I] /machine/properties/VirtualMachine.Cafe.Blueprint.Component.Cluster.Index : 0

[2016-09-19 08:56:10.172] [I] /machine/properties/VirtualMachine.CPU.Count : 1

[2016-09-19 08:56:10.173] [I] /machine/properties/__Clone_Type : CloneWorkflow

[2016-09-19 08:56:10.174] [I] /machine/properties/__clonespec : Linux

[2016-09-19 08:56:10.175] [I] /machine/properties/VirtualMachine.Admin.TotalDiskUsage : 5

[2016-09-19 08:56:10.176] [I] /machine/properties/VirtualMachine.Disk0.Label : Hard disk 1

[2016-09-19 08:56:10.177] [I] /machine/properties/trace_id : tuKnOjRS

[2016-09-19 08:56:10.178] [I] /machine/properties/__trace_id : tuKnOjRS

[2016-09-19 08:56:10.179] [I] /machine/properties/__iaas_request_binding_id : faf3101c-773a-45c2-9544-ab009eebb1f1

[2016-09-19 08:56:10.180] [I] /machine/properties/VirtualMachine.Cafe.Blueprint.Component.Id : vSphere_Machine_1

[2016-09-19 08:56:10.181] [I] /machine/properties/VirtualMachine.Network0.Address : 192.168.220.121

[2016-09-19 08:56:10.182] [I] /machine/properties/Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.VMPSMasterWorkflow32 : *

[2016-09-19 08:56:10.183] [I] /machine/properties/VirtualMachine.Disk0.Storage : pEsxi__SSD1T

[2016-09-19 08:56:10.184] [I] /machine/properties/Vrm.ProxyAgent.Uri : https://iaas.mylab.local/VMPS2Proxy

[2016-09-19 08:56:10.185] [I] /machine/properties/VirtualMachine.Storage.Name : pEsxi__SSD1T

[2016-09-19 08:56:10.186] [I] /machine/properties/__clonefrom : smallRHEL6

[2016-09-19 08:56:10.187] [I] /machine/properties/VirtualMachine.Network0.Gateway : 192.168.220.2

[2016-09-19 08:56:10.188] [I] /machine/properties/VirtualMachine.Network0.Name : 220Net

[2016-09-19 08:56:10.189] [I] /machine/properties/VirtualMachine.Disk0.IsFixed : False

[2016-09-19 08:56:10.190] [I] /requestId : f810f0d6-f4f0-4991-bac6-f02754b9b689

Reply
0 Kudos
sascha_milic
Hot Shot
Hot Shot
Jump to solution

Great that's working now!

virtualMachineAddOrUpdateProperties and virtualMachineDeleteProperties are the new way to add/change or delete custom properties. Just fill a property type parameter with your desired changes and bind it as output parameter. Very convenient, nice feature 🙂


What do you mean exactly with "changes"? From what state to what other state? What kind of changes do you want to track?

Reply
0 Kudos
Windspirit
Hot Shot
Hot Shot
Jump to solution

Hi,

yeah...i got that now.

What I want to hook in was the change event. Menaing when you chnage /reconfigure a VM the event " VMPSMasterWorkflow32.EVENT.ReconfigureVM'" is triggert and i wondered if I get infos on waht was chnaged.

But I have a workaround. Now that I get the current config, I can check against the one that was previously done and compair them.

Thanks you have been a great help

Reply
0 Kudos
oiiio
Contributor
Contributor
Jump to solution

Hi Daniel,

Can you please describe how did you workaround comparing the Changes in the Reconfigure event ?

We are having the same problem and trying to figure it out.

Thanks.

Reply
0 Kudos