VMware Cloud Community
aenagy
Hot Shot
Hot Shot

Custom property '__clonefrom' cannot be from predefined custom properties [vRA 7.6]

I have a property definition for "__clonefrom" which calls a vRO action based on some inputs, i.e. this value is not directly user selectable. This property is added to an IaaS blueprint through a property group. After entering data to all of the input fields this property ("__clonefrom") value is valid. When I submit the request I get the error:

#<request number> - Provision <name of blueprint>

Failed

The following component requests failed:

RHEL. Allocation request [

  Composition RequestId: [c7895cc6-47de-4686-a5f6-215cf841ddef],

  CompTypeId: [Infrastructure.CatalogItem.Machine.Virtual.vSphere],

  BlueprintId: [<name of blueprint>],

  CompId: [RHEL],

  BlueprintRequestId: [4d535fea-ea03-425a-a388-a3847df02df7],

  RootCafeRequestId: [c120670c-cbec-46e8-924d-755d885f8a71],

  SubtenantId: [076500b0-c051-4a37-afa7-28c167bbee3f]

] with binding id [a02c0279-1c8e-4985-a14f-9894e763f648] failed with [Custom property '__clonefrom' cannot be from predefined custom properties].

Previously I had a property definition for "clonefrom" which called the same vRO action and behaved correctly but the resulting request used the incorrect template.The reason for using "__clonefrom" instead of "CloneFrom" (Custom Properties C ) is due to the fact that I found references to "__clonefrom" in the post clone workflow payloads that are executed.

Why is this error being generated and/or how to I specify which template to use when cloning?

Thanks in advance.

12 Replies
daphnissov
Immortal
Immortal

Custom properties with double underscores are system-level properties and cannot be defined in the property dictionary. You can still set them, but that has to be done internally to vRO.

But the main crux of your problem is how to define that value, probably dynamically, based on request form inputs. I have done this several different ways and all of them pretty easy, but those customers have used the SovLabs Property Toolkit. If you're not using that, you'll have to monkey around in vRO at whatever EBS stage you want to design your own logic to manipulate that value.

Reply
0 Kudos
aenagy
Hot Shot
Hot Shot

daphnissov​:

1) This is a bit confusing as the same approach is working for "__ReservationPolicyID". Is there something different about "__clonefrom" and "__ReservationPolicyID" that I'm missing?

2) Paying for SovLabs Property Toolkit would, I anticipate, be a tough sell given the eminent migration to vRA 8 and it would be used to solve this one problem. The client already has a solution built using a "approval-com.vmware.cafe.catalog.request.pre" subscription and workflow. The problem is that while this solution works fine for IaaS submissions using the web console it breaks when using the REST interface (CloudClient, Orchestrator, CodeStream). Specifically, the code that retrieves the properties from the machine request isn't able to find the properties for requests submitted using the REST interface. I'm not going to post the source as its over 500 lines and was provided by PSO. Having studied this code it appears to be using

vCACCAFEEntitiesFinder.getCatalogItemRequest( cafeHost , requestId )

to obtain the request followed by

cafeHost.createCatalogClient().get( "/consumer/catalogItems/" + catItemId )

, if that doesn't work then it tries

vCACCAFEEntitiesFinder().findCatalogItems( cafeHost , catItemId )

. In any case the script isn't able to retrieve the property values entered by the user. Is there a better EB subscription or better method for retrieving properties from the request?

Reply
0 Kudos
daphnissov
Immortal
Immortal

For #1, the differences between those two are that __CloneFrome is an IaaS entity property and is required for Clone workflows whereas __reservationPolicyId is not and isn't required at all.

For #2, haven't gotten into that when it comes to property extraction when requests are made via Web vs REST, but machineRequested PRE is often the best (and applicable) stage at which to manipulate __CloneFrom if you can get the payload.

Reply
0 Kudos
unhappyvra
Enthusiast
Enthusiast

+1 @daphnissov

I use com.vmware.csp.iaas.blueprint.service.machine.lifecycle.provision - PRE to override __CloneFrom (because content library doesn't work - shame-shame-shame on you, VMware) - works great (7.2 - 7.6).

Reply
0 Kudos
daphnissov
Immortal
Immortal

Well, to be honest, the Content Library has some pretty major gaps still making its adoption in a CMP a little sketch.

Reply
0 Kudos
aenagy
Hot Shot
Hot Shot

unhappyvra​:

​Which lifecycle state name?

Reply
0 Kudos
unhappyvra
Enthusiast
Enthusiast

VMPSMasterWorkflow32.Requested , State phase - PRE

Reply
0 Kudos
aenagy
Hot Shot
Hot Shot

unhappyvra​:

I created a new workflow to calculate the new value of "__clonefrom" and send it back to vRA. I know the value is updated because in a later subscription (VMPSMasterWorkflow32.BuildingMachine PRE) I see the updated value in the payload dump. vRA gets as far as VMPSMasterWorkflow32.MachineProvisioned PRE before throwing a:

#<request number> - Provision <blueprint name>

-

Failed

The following component requests failed: RHEL. Allocation request [

Composition RequestId: [c7895cc6-47de-4686-a5f6-215cf841ddef],

CompTypeId: [Infrastructure.CatalogItem.Machine.Virtual.vSphere],

BlueprintId: [<name of blueprint>],

CompId: [RHEL],

BlueprintRequestId: [4d535fea-ea03-425a-a388-a3847df02df7],

RootCafeRequestId: [c120670c-cbec-46e8-924d-755d885f8a71],

SubtenantId: [076500b0-c051-4a37-afa7-28c167bbee3f]

] with binding id [a02c0279-1c8e-4985-a14f-9894e763f648] failed with [Custom property '__clonefrom' cannot be from predefined custom properties].

What am I missing?

Reply
0 Kudos
aenagy
Hot Shot
Hot Shot

Using this link (Transfer Custom Properties between vRA and vRO [Geir's Wiki of things to remember] ) I finally got this to work by changing the EB subscription to fire on VMPSMasterWorkflow32.BuildingMachine PRE and using the following code to update the "__clonefrom" property:

var virtualMachineAddOrUpdateProperties = wfaPayload.virtualMachineAddOrUpdateProperties || new Properties()

if ( null == mycustomCloneFrom || 0 == mycustomCloneFrom.length ){

} else {

  var machineProperties = new Properties()

  machineProperties.put( "__clonefrom" , mycustomCloneFrom )

  var machine = new Properties()

  machine.put( "properties" , machineProperties )

  virtualMachineAddOrUpdateProperties.put( "machine" , machine )

}

This took some trial an error but I finally got it to update vRA properly.

I have seen references (Using custom property in vRA/vCAC deploy VM in specific datacenter using local templates -Post02 – V...  and Event broker and CloneFrom ) to updating the property "CloneFrom". Anyone know the difference between "__clonefrom" and "CloneFrom" and which one is the recommended property to update?

Reply
0 Kudos
zmCZ
Contributor
Contributor

I needed similar thing just recently and found you can add custom property "cloneFrom" to you deployment which will make the override possible, just without the underscrores.

I'm using custom form and it allows me to select which template will be used for deployment.

Reply
0 Kudos
zmCZ
Contributor
Contributor

this is how it looks in form designer

First value is the actual name of template , second is what is displayed to user in select box

Works perfectly for me ,  running on Version: 7.6.0 (Build: 13027133)

Reply
0 Kudos
daphnissov
Immortal
Immortal

Yes cloneFrom has been around for a while as an override custom property. But you can still specify the system-level property __cloneFrom as well.