Hello guys!
I am working on utilizing the Orchestrator to enable auto provision and customization of the vCloud.
My (hopefully) last problem, remains the organization's policy setting which is:
vApp template Lease:
Maximum storage lease (30 days)
This is the default, and apparently, the example workflow for creating an organization, has no way to change this!
I am talking about this bit:
Apparently, the deleteOnStorageLeaseExpiration only affects the Storage cleanup: (Move to Expired Items or Permanently Delete) - but not the Maximum storage lease setting
Searching the API library, I found this and tried to do something:
var myVclOrgVAppTemplateLeaseSettings = new VclOrgVAppTemplateLeaseSettings();
myVclOrgVAppTemplateLeaseSettings.storageLeaseSeconds = 0;
myVclOrgVAppTemplateLeaseSettings.deleteOnStorageLeaseExpiration = deleteOnStorageLeaseExpiration;
Screenshot helps SOOO much I understand now...
Okay, working with the Org object alone won't get you where you need to go, you also need to get the Admin Organization object
var adminOrg = myOrgObject.toAdminObject();
now, with the adminOrg, you can call the "updateSetings" method with a "VclOrgSettings" object passed as the parameter...
var orgSettings = new VclOrgSettings();
// Look at the VclOrgSettings object in the api explorer to find the available properties - one of them is the one you need: "vAppTemplateLeaseSettings" - so the code you created will go in here....
Given the above...
Create the Org as you are... once you have the org created, get the admin object for that org and update the vAppTemplateLeaseSettings as desired :smileygrin:
Please move this post to the Orchestrator community.
hmmm I thought I posted this in Orchestrator community :smileyshocked:
How to move it?
It's in the right place now When it was first posted, it was in the vCenter Orchestrator Plug-in SDK community - that community is for people developing plug-ins for vCO
In looking at the library workflow "Add an organization", I see an input for storageLeaseHours ... are you saying that this disregards your input and defaults to 30 days? If you want it permanent, you just set the storage lease to 0 with deleteOnStorageLeaseExpiration to false... does this not work?
... I haven't looked too deeply into this myself, but it "looks" like things are in place for creating an org with all the appropriate settings.
Yes, I used exactly the settings like you said - deleteOnStorageLeaseExpiration is false (No in vco) and storageLeaseHours is 0.
The result is attached in screenshot.
Note that if deleteOnStorageLeaseExpiration is set to true, it only changes the Storage Cleanup: "Move to..." to "Permanently delete" - tahts all.
Screenshot helps SOOO much I understand now...
Okay, working with the Org object alone won't get you where you need to go, you also need to get the Admin Organization object
var adminOrg = myOrgObject.toAdminObject();
now, with the adminOrg, you can call the "updateSetings" method with a "VclOrgSettings" object passed as the parameter...
var orgSettings = new VclOrgSettings();
// Look at the VclOrgSettings object in the api explorer to find the available properties - one of them is the one you need: "vAppTemplateLeaseSettings" - so the code you created will go in here....
Given the above...
Create the Org as you are... once you have the org created, get the admin object for that org and update the vAppTemplateLeaseSettings as desired :smileygrin:
Thank you so much!
It works
Final block of code, for anyone else encountering the same issues:
I think this is a minor "bug" that tweaking this setting is not possible without custom code in Orchestrator.
The key was of course knowing the adminOrg has an updateSettings method, and that this method takes VclOrgSettings object, and that this object has an attribute, which takes exactly the object which controls what was lacking
Just for my understanding - how did you figure out how to build this object?