I am sure something on my end got missed, but the documentation isn't entirely helpful on how to troubleshoot.
I have two things and I am sure they are related. In my workflow when I validate it does so properly and when I run it from the workflow I get an error performing external validation.
When I provision a server through the form, the workflow does not give an error but I also get null for the inputs. When viewing the deployment the name is there with the name from the form. The inputProperties is set as input and is in the schema as an input.
The log after provisioning:
Blueprint:
# Created by Quickstart/Setup Cloud wizard.
formatVersion: 1
inputs:
cpuCount:
type: integer
description: Number of virtual processors
title: CPU Count
default: 1
minimum: 1
maximum: 4
totalMemoryMB:
type: integer
description: Machine virtual memory size in Megabytes
title: Memory in MB
default: 1024
inputs: null
minimum: 1024
maximum: 16385
Hostname:
type: string
title: Hostname
minLength: 6
maxLength: 15
pattern: ^[a-zA-Z0-9]*$
DiskCapacityinGB:
type: integer
description: Enter your disk requirements
default: 200
inputs: null
minimum: 200
maximum: 400
Network:
title: Network
type: string
description: Production or Dev environment
default: Development
enum:
- Development
- Production
Backup:
title: Backup
type: boolean
description: Will this server need backups
resources:
Server2022wIIS:
type: Cloud.vSphere.Machine
properties:
name: ${input.Hostname}
imageRef: TMP_W2022IIS_STD_GUI
cpuCount: ${input.cpuCount}
totalMemoryMB: ${input.totalMemoryMB}
constraints:
- tag: redacted: []
networks:
- network: ${resource.Cloud_vSphere_Network_1.id}
storage:
constraints: []
maxDiskCapacityInGB: 400
bootDiskCapacityInGB: ${input.DiskCapacityinGB}
backup:
backup: ${input.Backup}
Cloud_vSphere_Network_1:
type: Cloud.vSphere.Network
properties:
networkType: existing
constraints:
- tag: ${input.Network}
whatever it is, it probably is something dumb. And it's kind of hard to troubleshoot at a distance, maybe some other things i would try.
1) Don't set it to a new properties first, just set it to the requestInputs: var requestInputs = inputProperties.get("requestInputs")
2) Maybe try to see if there are any keys in there at all? System.log(Object.keys(requestInputs).join(","));
3) Try accessing the field directly instead of using get? requestInputs["Hostname"] or requestInputs.Hostname
4) Maybe also just trying to convert inputProperties to json and logging it to see if everything looks the way you think it does? System.log(JSON.stringify(inputProperties))
5) Take a break 🙂
Hope you can track it down!
OK, it seems to be jus these variables I am unable to pull. They are in the requestInputs section of inputProperties.
Log results:
Might be a copy and paste thing, but it looks like you have a space between "requests" and ".get" for the hostname.
But maybe more importantly, I think the keys on an object are case sensitive in js. So "hostname" is the not the same as "Hostname". Based on the requestInputs you shared, that may be the problem?
Yeah, it is hard to paste into the forums. I thought they were case sensitive and I tried both. I think it is a pathing issue in the variable/array.
whatever it is, it probably is something dumb. And it's kind of hard to troubleshoot at a distance, maybe some other things i would try.
1) Don't set it to a new properties first, just set it to the requestInputs: var requestInputs = inputProperties.get("requestInputs")
2) Maybe try to see if there are any keys in there at all? System.log(Object.keys(requestInputs).join(","));
3) Try accessing the field directly instead of using get? requestInputs["Hostname"] or requestInputs.Hostname
4) Maybe also just trying to convert inputProperties to json and logging it to see if everything looks the way you think it does? System.log(JSON.stringify(inputProperties))
5) Take a break 🙂
Hope you can track it down!
Thanks, #1 was the answer. requestInputs.
I'd recommend mapping your Inputs that you need to one of your canvas components, e.g. for backup map to custom properties on the Cloud vSphere Machine.
That way they are all in one place and more immutable as they associated with your machine object. You can read them from the customProperties section of any Subscription that has a Topic with customProperties Parameters. Also better to use the Event Topic 'Compute Post Provision' for post build activities.
Regards,
Greg Davis, VMware
It is post provision as I don't want an email to go out if the deployment gets canceled or something.
For the mapping, I am not sure what you are saying, I have only been working with this a few weeks.