VMware Cloud Community
sbeaver
Leadership
Leadership
Jump to solution

Who thinks they might be able to point me in the right direction?

Long story short, I am working on recreating and enhancing my blueprint as an Advanced Service utilizing the request a catalog item workflow.  I have been able to recreate and enhance most of the blueprint but I am struggling with finding a way to reproduce one specific area.  On the storage tab of a blueprint, you have the option to click a link to add more storage.  I am going to assume some kind of function.  In my first attempt I have a check box that when checked will present 3 other windows to get the answer to size, drive letter and label. So I am thinking I can might be able to use the link property but this is where i could use some input.  I guess I could copy and past and keep hidden but that just does not sound that efficient

Everybody understand what I am really looking to do and have anything to share with the class?

Cheers

Steve. 

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
34 Replies
SeanKohler
Expert
Expert
Jump to solution

Oh... and I will add that we just use the variable as an input.  (e.g. just put __asd_requestedBy as an input variable)

On run, it gets assigned auto-magically without the need for a custom action.  Then it can be used as a local variable handoff in scripts, called workflows, actions, etc.

asdRequestor.jpg

0 Kudos
Speed_Racer12
Contributor
Contributor
Jump to solution

I have 6.1.0 for both as well.  I tested some more requests last night.  I have never been able to get the catalog item request form for my windows catalog item, so maybe there is come incompatibility.  However, when I tried the Linux catalog item, I was able to retrieve the expected inputs.  However, I received the unhelpful error that is attached.  It would be nice if they just pointed out what the problem is. ;-)Thanks for your response.

Steve

0 Kudos
Speed_Racer12
Contributor
Contributor
Jump to solution

Good idea.  I wil give that a shot with my working API script.

Thanks,

Steve

0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

You are using decimal where you should be using interger.  Check line 13

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
Speed_Racer12
Contributor
Contributor
Jump to solution

um, yea.  The 13th input on the list is lease which I have set as integer as documented.  I even tried just assigning a number.

0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

Not sure it is 13th input but rather line 13 of the code.  I know I had to play with it to get it to work.  Here is a copy of mine that is working for me.

//Taking properties and resubmitting request

var mem = (mem * 1024)

properties = new Properties();

properties.put("provider-owner.id", owner);

properties.put("provider-manage.level", manage);

properties.put("provider-SLA", SLA);

properties.put("provider-cluster.size", offering);

properties.put("provider-blueprintId", blueprintId);

properties.put("provider-provisioningGroupId", provisioningGroupId);

properties.put("provider-VirtualMachine.CPU.Count", new vCACCAFEIntegerLiteral(cpus).getValue());

properties.put("provider-VirtualMachine.Memory.Size", new vCACCAFEIntegerLiteral(mem).getValue());

properties.put("provider-Cafe.Shim.VirtualMachine.TotalStorageSize", new vCACCAFEDecimalLiteral(TotalStorageSize).getValue());

properties.put("provider-VirtualMachine.LeaseDays", new vCACCAFEIntegerLiteral(leaseDays).getValue());

properties.put("provider-VirtualMachine.Disk0.IsClone", isClone ? "true" : "false");

properties.put("provider-DataCenter", location);

properties.put("provider-Business.Segment", segment);

properties.put("provider-business.unit",BusUnit);

properties.put("provider-operating.system.selection", osVersion);

properties.put("provider-Server.Function", func);

properties.put("provider-VirtualMachine.Network.Environment", NetEnv);

properties.put("provider-VirtualMachine.Network0.DnsSuffix", DNSDomain);

properties.put("provider-cost.center", CostCenter);

properties.put("provider-tech.contact", TechContact);

properties.put("provider-__reservationPolicyID", reservationId);

if (addStorage === true){

  properties.put("provider-VirtualMachine.Disk1.Name","Hard disk 2");

  properties.put("provider-VirtualMachine.Disk1.Size", new vCACCAFEIntegerLiteral(drive1Size).getValue());

  properties.put("provider-VirtualMachine.Disk1.Letter", drive1Letter);

  properties.put("provider-VirtualMachine.Disk1.IsFixed", "False");

  properties.put("provider-VirtualMachine.Disk1.Label", drive1Label);

  if (addStorage2 === true){

  properties.put("provider-VirtualMachine.Disk2.Name","Hard disk 3");

  properties.put("provider-VirtualMachine.Disk2.Size", new vCACCAFEIntegerLiteral(drive2Size).getValue());

  properties.put("provider-VirtualMachine.Disk2.Letter", drive2Letter);

  properties.put("provider-VirtualMachine.Disk2.IsFixed", "False");

  properties.put("provider-VirtualMachine.Disk1.Label", drive2Label);

  if (addStorage3 === true){

  properties.put("provider-VirtualMachine.Disk3.Name","Hard disk 4");

  properties.put("provider-VirtualMachine.Disk3.Size", new vCACCAFEIntegerLiteral(drive3Size).getValue());

  properties.put("provider-VirtualMachine.Disk3.Letter", drive3Letter);

  properties.put("provider-VirtualMachine.Disk3.IsFixed", "False");

  properties.put("provider-VirtualMachine.Disk1.Label", drive3Label);

  if (addStorage4 === true){

  properties.put("provider-VirtualMachine.Disk4.Name","Hard disk 5");

  properties.put("provider-VirtualMachine.Disk4.Size", new vCACCAFEIntegerLiteral(drive4Size).getValue());

  properties.put("provider-VirtualMachine.Disk4.Letter", drive4Letter);

  properties.put("provider-VirtualMachine.Disk4.IsFixed", "False");

  properties.put("provider-VirtualMachine.Disk1.Label", drive4Label);

  }

   }

  }

}

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
Speed_Racer12
Contributor
Contributor
Jump to solution

Thanks.  I will do some comparisons and see if I can work it out.

0 Kudos
Speed_Racer12
Contributor
Contributor
Jump to solution

I thought I would update this thread on what happened with 6.2.  After the upgrade, the "request a catalog item" did not work at all.  I had the issue fixed with a tech preview plug-in.

Technical Preview Version of VMware vCenter Orchestrator Plug-In for vCloud Automation Center 6.2.0

Once this was installed, I can now request catalog items.  However, I get this ugly error even though I check all the types thoroughly.

[Rest Composite Exception]:  ( [Rest Error]: {Status code: 400}, {Error code: 20117} , {Error Source: null}, {Error Msg: The data specified within the request is invalid.}, {System Msg: The data specified within the request is invalid.} )  ( [Rest Error]: {Status code: 400}, {Error code: 50505} , {Error Source: null}, {Error Msg: System exception.}, {System Msg: com.vmware.vcac.platform.content.literals.DecimalLiteral cannot be cast to com.vmware.vcac.platform.content.literals.IntegerLiteral} ) (Dynamic Script Module name : requestCatalogItem#14)

Also, this is a distributed deployment with an external vRO appliance obtained from support.

Anybody able to get this workflow to work with 6.2?

0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

I have it working and really well.  Looking at the error message you posted, one thing really jumps out at me.  "DecimalLiteral cannot be cast to com.vmware.vcac.platform.content.literals.IntegerLiteral"    That tells me you are Decimal is the code where you need Integer.  Not sure which one so to test change one at a time til you find it

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
Speed_Racer12
Contributor
Contributor
Jump to solution

The properties below are the only ones that could kick off this error.  They are all defined as numbers.  Maybe something is wrong here?  Otherwise, I don't know where to look.

properties.put("provider-Cafe.Shim.VirtualMachine.NumberOfInstances", new vCACCAFEIntegerLiteral(numberOfInstances).getValue());

properties.put("provider-Cafe.Shim.VirtualMachine.TotalStorageSize", new vCACCAFEDecimalLiteral(totalStorageSize).getValue());

properties.put("provider-VirtualMachine.CPU.Count", new vCACCAFEIntegerLiteral(cpuCount).getValue());

properties.put("provider-VirtualMachine.LeaseDays", new vCACCAFEIntegerLiteral(leaseDays).getValue());

properties.put("provider-VirtualMachine.Memory.Size",  new vCACCAFEIntegerLiteral(memorySize).getValue());

0 Kudos
Speed_Racer12
Contributor
Contributor
Jump to solution

Did you have this issue?  Technical Preview Version of VMware vCenter Orchestrator Plug-In for vCloud Automation Center 6.2.0

I had to deploy this to get it work at all.  This is now with 6.2, the 6.0 vro appliance and this new unreleased plug-in.

However at least I can retrieve the form and request an item which did not work for me at all with a windows catalog item on 6.1.

It seems to work until I get the type mismatch error.  This is testing a very basic workflow just trying to request the catalog item.

0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

Yes using the new plugin for the same reasons you discovered.  I checked your code and it matches mine so have you confirmed that the vCO property types match?

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
Speed_Racer12
Contributor
Contributor
Jump to solution

Yes, a few times.  These are all numbers.

Every other property is a string.

0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

ok in my vCO workflow

Number if instances = number

lease days = number

cpu = string

mem = string

disk size = number

total storage = number

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
pizzle85
Expert
Expert
Jump to solution

For anyone else who comes across this post the code to input an integer into an ASD service blueprint that worked for me was:

new vCACCAFEIntegerLiteral(variable);

The variable can be a string or number type.

This wasn't apparent to me reading the original posts.

0 Kudos