VMware Cloud Community
craigso
Enthusiast
Enthusiast
Jump to solution

VirtualMachine.Network0.Name dropdown errors on custom forms

Hello!

I'm starting to feel kind of bad asking all these questions. I swear, I am spending hours researching and troubleshooting before I post. At some point I hope I can return the favor and assist others as they come along. Thank you as always for taking the time to read and respond.

Previously I've been doing most of my blueprint design using standard forms. I've started to switch some of these forms over to use custom forms just so they are presented a bit better. As I've mentioned a few times in the past I've been using VirtualMachine.Network0.Name custom property in conjunction with the getApplicableNetworks action fill out a dropdown menu and allow for network selection. While these are working great for the standard forms, when I try to use the same method on a custom form the request fails with:

The following component requests failed: vSphere__vCenter__Machine_1. Allocation request [Composition RequestId: [f3514233-5fe4-4fad-ab43-85fb76162078], CompTypeId: [Infrastructure.CatalogItem.Machine.Virtual.vSphere], BlueprintId: [SASDemo], CompId: [vSphere__vCenter__Machine_1], BlueprintRequestId: [c142ef51-7679-46af-8726-c925096bee80], RootCafeRequestId: [b5953dbe-ac82-460e-b833-932f6b6ac0e1], SubtenantId: [07eb843e-08e4-4ab2-938e-2b85160c8d74]] with binding id [351f5b5d-1fd1-44a1-ba42-6a9ec0aa0f21] failed with [Infrastructure service provider error: A server error was encountered. Error requesting machine. Machine is-craig-3: No reservation available that has all specified networks: "IS|2985_IS_VRA_TEST1_apg|2985_IS_VRA_TEST1_epg".].

I'm a bit puzzled, but maybe it's a quirk of a custom form. Here is the config in detail:

pastedImage_1.png

Blueprint network custom properties:

pastedImage_2.png

pastedImage_3.png

Now, if I disable the custom form the field is populated on the standard form, and that works just fine. What am I doing wrong here?

Thanks again.

1 Solution

Accepted Solutions
daphnissov
Immortal
Immortal
Jump to solution

The reason you're running into this is because the method call in that Action (and many like it) System.getContext() method does not work with custom forms. We don't really know why they decided to break it. The leading theory is that because custom forms has the native ability now to submit the same types of attributes that would normally be gathered by getContext(), they thought it superfluous. In any case, you'll have to copy and modify this action and move those requested custom properties as inputs to the Action. You then need to surface that in the custom form and bind them in that field. There's a little more info in this relevant KB, although not a walk-through. If you can't figure it out, respond and I'll provide you a little mini walkthrough sometime tomorrow if I have the chance.

View solution in original post

8 Replies
craigso
Enthusiast
Enthusiast
Jump to solution

I wanted to add one more screenshot of the custom form in the request view:

pastedImage_0.png

0 Kudos
craigso
Enthusiast
Enthusiast
Jump to solution

From my initial research, the most common reason for this issue is if the name does not match the Network Adapter name exactly. But since I'm pulling these from vRA and they work in the standard form, I'm at a loss.

0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

The reason you're running into this is because the method call in that Action (and many like it) System.getContext() method does not work with custom forms. We don't really know why they decided to break it. The leading theory is that because custom forms has the native ability now to submit the same types of attributes that would normally be gathered by getContext(), they thought it superfluous. In any case, you'll have to copy and modify this action and move those requested custom properties as inputs to the Action. You then need to surface that in the custom form and bind them in that field. There's a little more info in this relevant KB, although not a walk-through. If you can't figure it out, respond and I'll provide you a little mini walkthrough sometime tomorrow if I have the chance.

craigso
Enthusiast
Enthusiast
Jump to solution

Thank you! I was able to get this working.

0 Kudos
craigso
Enthusiast
Enthusiast
Jump to solution

Hello,

I don't know why I keep having so many issues with this drop down.. but another issue came up which pertains to this original post.

So I did get this working and it works great, but just for the original blueprint in this case called 'SASDemo'.

It still works, but as I try to replicate it to another blueprint, or even copy this blueprint, it fails with a 404 error. What am I doing wrong?

See details below:

I've configured the working blueprint (SASDemo) according to the article linked above and it looks like this:

pastedImage_0.png

The parameters passed to the action looks like this:

[script: com.vmware.vra.networks/getApplicableNetworks_Custom] (com.vmware.vra.networks/getApplicableNetworks_Custom) Blueprint: SASDemo

[script: com.vmware.vra.networks/getApplicableNetworks_Custom] (com.vmware.vra.networks/getApplicableNetworks_Custom) ComponentID: vSphere__vCenter__Machine_1

[script: com.vmware.vra.networks/getApplicableNetworks_Custom] (com.vmware.vra.networks/getApplicableNetworks_Custom) requestedFor: user@ad.company.com

[script: com.vmware.vra.networks/getApplicableNetworks_Custom] (com.vmware.vra.networks/getApplicableNetworks_Custom) tenantRef: vsphere.local

[script: com.vmware.vra.networks/getApplicableNetworks_Custom] (com.vmware.vra.networks/getApplicableNetworks_Custom) sybtenantRef: 07eb843e-08e4-4ab2-938e-2b85160c8d74

Again, this is all working as expected. Now when I try to recreate it on a second blueprint this is what happens:

Dropdown Config:

pastedImage_2.png

The parameters passed to the action looks like this:

[script: com.vmware.vra.networks/getApplicableNetworks_Custom] (com.vmware.vra.networks/getApplicableNetworks_Custom) Blueprint: Custom-WindowsServer2016

[script: com.vmware.vra.networks/getApplicableNetworks_Custom] (com.vmware.vra.networks/getApplicableNetworks_Custom) ComponentID: vSphere__vCenter__Machine_1

[script: com.vmware.vra.networks/getApplicableNetworks_Custom] (com.vmware.vra.networks/getApplicableNetworks_Custom) requestedFor: user@ad.company.com

[script: com.vmware.vra.networks/getApplicableNetworks_Custom] (com.vmware.vra.networks/getApplicableNetworks_Custom) tenantRef: vsphere.local

[script: com.vmware.vra.networks/getApplicableNetworks_Custom] (com.vmware.vra.networks/getApplicableNetworks_Custom) sybtenantRef: 07eb843e-08e4-4ab2-938e-2b85160c8d74

Error in logs:

item: 'getReservationTypeIdForComponent/item1', state: 'failed', business state: 'null', exception: '404  (Workflow:getReservationTypeIdForComponent / Scriptable task (item1)#12)'

Given it's working for one blueprint and not another, I must have something configured wrong. I'm going to do some more testing tomorrow morning and I'll follow up with my findings.

0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

I suspect it has not to do with your blueprint per se but with the custom form, which only recently enabled duplication. Export your custom form, clone your blueprint, then import/overwrite that custom form with your backed up version. Does it work now?

craigso
Enthusiast
Enthusiast
Jump to solution

That's great to know!

Although in my testing that didn't seem to the the problem. I think I found the issue, and it was user error.

When I was passing the parameters to the action, I was using the blueprint name rather than blueprint ID. It would work just fine if the blueprint was a single word or no spaces or special characters (because blueprint name == blueprintId) and that is what was throwing me off. I went back and reread the article you linked above and found my error.

Hope that helps someone else.

0 Kudos
unibn
Contributor
Contributor
Jump to solution

Hello craigso,

would you please provide your solution.

We have the same issue.

Thanks in advance.

Regards

Henning

0 Kudos