VMware Cloud Community
SeanKohler
Expert
Expert

Constrained Change Lease - Freebee

Hi,

A lot of people have noticed in 6.x that Change Lease is less than ideal.  This may change in 7.x (no idea), but for those who have ASD in 6.2.x and are struggling with lease constraints, I have attached a workflow that will allow you to create a Resource Action that sets Goal Posts for your change lease requests.  (e.g from now to one year from now, otherwise request not allowed)  Hopefully a few people will find it useful.

You will have to either:

1. Create a configuration element for cafeHost and lease-months attributes.... and then bind them to the workflow.

-or-

2. Just set them in the workflow to what you want (attribute values).

This could also be run, supplying a VC:VM and a Date value, from within another workflow, but I put it together based on it being a Resource Action Request.  When you create your form in ASD, I recommend you add a field and set it to a Default Read Only VM.name value.  Like below...

lease.jpg

Let me know if you have any questions.

Cheers,

Sean

Reply
0 Kudos
4 Replies
SeanKohler
Expert
Expert

As a point of clarity...

lease2.jpg

Reply
0 Kudos
pizzle85
Expert
Expert

Have you gotten this process to work in 7?

Running it against a VM or a deployment object both return the error:

Status Details

Internal error processing completion of blueprint [CHANGE_LEASE] request [3170caf4-f4c2-4d28-8a79-bdbf3a509847]. Status so far: [SUCCEEDED]

Reply
0 Kudos
pizzle85
Expert
Expert

Looking closer at the logs and fiddler i see that the API doesnt like the string type for the date:

Internal error processing completion of blueprint [CHANGE_LEASE] request [52aaedc7-8174-4836-8b13-430e2901d3b8]. Status so far: [SUCCEEDED]

java.lang.IllegalArgumentException: Unexpected Expiration Date Type

Also looking at a Fiddler trace of the request i see that the type for the date is dateTime:

{"@type":"ResourceActionRequest", "resourceRef":{"id":"abb61224-2f99-431e-a134-5ae6e5a4cac6"}, "resourceActionRef":{"id":"7af32983-fad2-4e11-ae45-8c241db6d829"}, "organization":{"tenantRef":"vsphere.local", "tenantLabel":"vsphere.local", "subtenantRef":"61e49487-51aa-4af7-98cd-c260a53afedb", "subtenantLabel":"YYY"}, "state":"SUBMITTED", "requestNumber":0, "requestData":{"entries":[{"key":"provider-MachineName", "value":{"type":"string", "value":"XXX"}},{"key":"provider-operationId", "value":{"type":"string", "value":"Infrastructure.Machine.Action.ChangeLease"}},{"key":"provider-machineId", "value":{"type":"string", "value":"58efb240-975b-4976-9a9d-f7f14d26cd43"}},{"key":"provider-ExpirationDate", "value":{"type":"dateTime", "value":"2016-07-01T10:15:00.000-0400"}}]}}

I'm going to fiddle with this (no pun intended) some more to see if i can get it working in 7.

Reply
0 Kudos
tchristin
Enthusiast
Enthusiast

Hello,

I'm facing the same problem on vRA 7, did you find any solution pizzle85 ?

The thing that I don't understand about this error message is that the date format provided by Sean is the same as the current API in vRA7 (tracked with Firebug).

I'm trying to change VM lease from vRO but I'm always stuck with the vCACAFE part... On the vCAC VM the "expires" property is always updated but the display in vRA is still using the old value... It drives me crazy ! :smileyangry:

I tried with API to :

  • update "expires" property on vCACVirtualMachine => OK
  • update "lease" property on vCACCAFECatalogResource => NOK
  • update "leaseForDisplay" property on vCACCAFECatalogResource => NOK
  • update "destroyDate" property on on vCACCAFECatalogResource => NOK

And Sean's workflow doesn't work indeed with this strange error message : Internal error processing completion of blueprint [CHANGE_LEASE] request [cc0bdc6d-4850-4eb9-ac25-a1de4a13205b]. Status so far: [SUCCEEDED]  :smileyconfused:

Any help would be greatly appreciated !

Regards,

Tim.


Reply
0 Kudos