VMware Cloud Community
draymond10
Enthusiast
Enthusiast
Jump to solution

AWS VM provisioning Request FAILS

Same request in vRA and ServiceNow plugin AWS Blueprint FAILS on plugin request.

The following component requests failed: Amazon_Machine_1. Request failed: Machine HOSTNAME11: Failed Provisioning. Ensure that the AMI, Instance Type, and Availability Zone are correct. Exception: Object reference not set to an instance of an object

Appears to be some issue with the subnet being passed.  We check off Subnet in a VPC and the actual subnet on the Catalog Request (same as the vRA portal).

pastedImage_0.png

You can see we set the amazon_provisioninto and amazon_subnet_id on the requestData:

          "key": "amazon_provisionInto",

                                "value": {

                                    "type": "string",

                                    "value": "subnet"

                                }

                            },

                            {

                                "key": "amazon_subnet_id",

                                "value": {

                                    "type": "integer",

                                    "value": 23

Below is the requestData passed:

"requestData": {

        "entries": [

            {

                "key": "provider-Amazon_Machine_1",

                "value": {

                    "type": "complex",

                    "componentTypeId": "com.vmware.csp.component.cafe.composition",

                    "componentId": null,

                    "classId": "Blueprint.Component.Declaration",

                    "typeFilter": "AWSRHEL7useast1*Amazon_Machine_1",

                    "values": {

                        "entries": [

                            {

                                "key": "Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.DeactivateMachine",

                                "value": {

                                    "type": "string",

                                    "value": "__*,*"

                                }

                            },

                            {

                                "key": "memory",

                                "value": {

                                    "type": "integer",

                                    "value": 3840

                                }

                            },

                            {

                                "key": "description",

                                "value": null

                            },

                            {

                                "key": "amazon_advancedCapabilitiesMode",

                                "value": {

                                    "type": "boolean",

                                    "value": false

                                }

                            },

                            {

                                "key": "amazon_securityGroups",

                                "value": null

                            },

                            {

                                "key": "_hasChildren",

                                "value": {

                                    "type": "boolean",

                                    "value": false

                                }

                            },

                            {

                                "key": "enable_amazon_network_options",

                                "value": {

                                    "type": "boolean",

                                    "value": true

                                }

                            },

                            {

                                "key": "reservation_policy",

                                "value": {

                                    "type": "entityRef",

                                    "classId": "Infrastructure.Reservation.Policy.ComputeResource",

                                    "id": "AWS EAST1 Policy",

                                    "componentId": null,

                                    "label": "AWS EAST1 Policy"

                                }

                            },

                            {

                                "key": "Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.Expired",

                                "value": {

                                    "type": "string",

                                    "value": "__*,*"

                                }

                            },

                            {

                                "key": "machine_prefix",

                                "value": null

                            },

                            {

                                "key": "max_per_user",

                                "value": {

                                    "type": "integer",

                                    "value": 0

                                }

                            },

                            {

                                "key": "Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.WaitingToBuild",

                                "value": {

                                    "type": "string",

                                    "value": "__*,*"

                                }

                            },

                            {

                                "key": "amazon_location",

                                "value": null

                            },

                            {

                                "key": "Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.Requested",

                                "value": {

                                    "type": "string",

                                    "value": "__*,*"

                                }

                            },

                            {

                                "key": "key_pair",

                                "value": {

                                    "type": "string",

                                    "value": "0"

                                }

                            },

                            {

                                "key": "ebs_storage",

                                "value": {

                                    "type": "integer",

                                    "value": 0

                                }

                            },

                            {

                                "key": "Hostname",

                                "value": {

                                    "type": "string",

                                    "value": "HOSTNAME"

                                }

                            },

                            {

                                "key": "cpu",

                                "value": {

                                    "type": "integer",

                                    "value": 2

                                }

                            },

                            {

                                "key": "property_groups",

                                "value": null

                            },

                            {

                                "key": "Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.InstallTools",

                                "value": {

                                    "type": "string",

                                    "value": "__*,*"

                                }

                            },

                            {

                                "key": "Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.BuildingMachine",

                                "value": {

                                    "type": "string",

                                    "value": "__*,*"

                                }

                            },

                            {

                                "key": "_cluster",

                                "value": {

                                    "type": "integer",

                                    "value": 1

                                }

                            },

                            {

                                "key": "Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.MachineProvisioned",

                                "value": {

                                    "type": "string",

                                    "value": "__*,*"

                                }

                            },

                            {

                                "key": "Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.Disposing",

                                "value": {

                                    "type": "string",

                                    "value": "__*,*"

                                }

                            },

                            {

                                "key": "amazon_provisionInto",

                                "value": {

                                    "type": "string",

                                    "value": "subnet"

                                }

                            },

                            {

                                "key": "instance_type",

                                "value": {

                                    "type": "string",

                                    "value": "m4.large"

                                }

                            },

                            {

                                "key": "amazon_subnet_id",

                                "value": {

                                    "type": "integer",

                                    "value": 23

                                }

                            },

                            {

                                "key": "ebs_storage_volumes",

                                "value": {

                                    "type": "multiple",

                                    "elementTypeId": "COMPLEX",

                                    "items": []

                                }

                            },

                            {

                                "key": "Extensibility.Lifecycle.Properties.CloneWorkflow.CustomizeOS",

                                "value": {

                                    "type": "string",

                                    "value": "__*,*"

                                }

                            }

                        ]

                    }

                }

            },

            {

                "key": "provider-_number_of_instances",

                "value": {

                    "type": "integer",

                    "value": 1

                }

            },

            {

                "key": "provider-_archiveDays",

                "value": {

                    "type": "integer",

                    "value": 14

                }

            },

            {

                "key": "provider-_leaseDays",

                "value": null

            },

            {

                "key": "provider-providerId",

                "value": {

                    "type": "string",

                    "value": "e15eee81-2a33-46d5-9021-872c862c29ef"

                }

            },

            {

                "key": "provider-providerBindingId",

                "value": {

                    "type": "string",

                    "value": "AWSRHEL7useast1"

                }

            },

            {

                "key": "provider-subtenantId",

                "value": {

                    "type": "string",

                    "value": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx"

                 }

            }

        ]

    },

Tags (1)
1 Solution

Accepted Solutions
draymond10
Enthusiast
Enthusiast
Jump to solution

After speaking with VMware, it appears this key plays a significant role in networking settings for AWS....however VMware is still investigating what this field "actually" is used for.  Through testing when we set 'amazon_advancedCapabilitiesMode' to 'true', the build succeeds.  By default, this is set to 'false' and is excluded from the catalog import scheduled jobs in the vrasn.exclusionList Property.  We also question how did builds previously succeed if the default = false, and is excluded from the catalog import.  This was something that previously worked, and at some point just stopped working.

   {

                                "key": "amazon_advancedCapabilitiesMode",

                                "value": {

                                    "type": "boolean",

                                    "value": false

                                }

                            },

View solution in original post

5 Replies
kbhushan05
Enthusiast
Enthusiast
Jump to solution

Hi Draymond,

Sorry for the late reply, we are trying to replicate your query at our end. We will update you once we figure out this issue in our environment.

Thanks.

0 Kudos
kbhushan05
Enthusiast
Enthusiast
Jump to solution

Have you done any customization on original build, If customized then please share the details.

0 Kudos
draymond10
Enthusiast
Enthusiast
Jump to solution

The plugin code has remained intact as much as we could.  Wherever possible we copied Business Rules and Script includes so not to step on the original code.  Our developer has added a few lines of DEBUG code to output various stuff to logs. 

We added code to VRASNRequestUtil to the ValidateToken function to add 'tenant' to the EP

var tenant = gs.getProperty('vrasn.tenant.name');

var ep = this.endPoint+"/SAAS/t/"+tenant+"/API/1.0/REST/auth/token?attribute=isValid";

var request = new sn_ws.RESTMessageV2();

VRASNImportCatalog script include: to remove the lastUpdatedTime and updated the parseMap function

//var _endPoint = this.endPoint+"/catalog-service/api/catalogItems?$filter=((lastUpdatedDate%20ge%20'"+lastUpdatedTime+"')%20and%20(requestable%20eq%20true))&page=1&limit=20";

var _endPoint = this.endPoint+"/catalog-service/api/catalogItems?filter=(requestable%20eq%20true))&page=1&limit=20";

//SWL FIX - Check if entry.value is null before using entry.value.value

parseMap : function(field, component, catalog) {

try{

VRASNLogger.debug('Inside  VRASNImportCatalog.parseMap: Parse schema for variables');

var childComponent =  new Component();

var isDiskComponent = false;

childComponent.id = field.id;

childComponent.label = field.label;

childComponent.path = component.path +'___'+field.id;

var displayAdvice = field.displayAdvice;

var _arrDataType = field.dataType; //get("dataType",map);

childComponent.type = _arrDataType.type; //get("type",dataType);

if(JSUtil.notNil(_arrDataType.typeId)){

childComponent.typeId = _arrDataType.typeId;

}

var _arrState = field.state; //get("state",map);

var isMultiValued = field.isMultiValued;

if(childComponent.type == "ref"){

return;

}

var result = this.__arrayUtil.contains(this._exclusionList,field.id);

if(result){

childComponent.isVisible = false;

}

if(JSUtil.nil(childComponent.label)){

childComponent.label = childComponent.id;

}

var facet = "";

var facetType = "";

var i =0;

if (JSUtil.notNil(_arrState) && childComponent.isVisible) {

var list = _arrState.facets;

// work here for facets and visibility

for (i = 0; i < list.length; i++) {

facet = list[i];

facetType = facet.type + "";

if ((facetType == "visible")) {

var values = facet.value; //get("value",facet);

var value = values.value; //get("value",values);

var visibleType = values.type;

var visibleValue = value.value;

if (visibleValue == "false"){

childComponent.isVisible = false;

}

}

}

if(childComponent.isVisible){

if(JSUtil.nil(displayAdvice)){

childComponent.widget = "TEXTBOX";

}else{

childComponent.widget = displayAdvice;

}

if(childComponent.id =="amazon_provisionInto"){

childComponent.widget = "DROPDOWN";

}

if(childComponent.widget == "DROPDOWN" && !JSUtil.nil(field.permissibleValues)){

if(field.permissibleValues.type == "static"){

for(var v=0; v < field.permissibleValues.values.length; v++){

var val = field.permissibleValues.values[v];

var obj = new Object();

obj.dropKey = val.label;

obj.dropValue = val.underlyingValue.value;

childComponent.dropdownValues.push(obj);

}

}

}

for (i = 0; i < list.length; i++) {

facet = list[i];

facetType = facet.type + "";

if(facetType == "minValue"){

childComponent.minValue = facet.value.value.value;

}

if(facetType == "maxValue"){

childComponent.maxValue = facet.value.value.value;

}

if(facetType == "editable"){

childComponent.isEditable = facet.value.value.value;

}

if(facetType == "readOnly"){

childComponent.readOnly = facet.value.value.value;

}

if(facetType == "defaultValue" && JSUtil.nil(childComponent.defaultValue) ){

childComponent.defaultValue = facet.value.value.value;

if(childComponent.id == "disks"){

childComponent.defaultValue = facet.value.value;

for (i = 0; i < childComponent.defaultValue.items.length; i++) {

var item = childComponent.defaultValue.items[i];

var map = {};

for (var j = 0; j < item.values.entries.length; j++) {

var entry = item.values.entries[j];

//SWL FIX - Check if entry.value is null before using entry.value.value

if(!JSUtil.nil(entry.value)) {

map[entry.key] = entry.value.value;

} else {

map[entry.key] = null;

}

0 Kudos
kbhushan05
Enthusiast
Enthusiast
Jump to solution

Can I ask for a tenant name in your case?

0 Kudos
draymond10
Enthusiast
Enthusiast
Jump to solution

After speaking with VMware, it appears this key plays a significant role in networking settings for AWS....however VMware is still investigating what this field "actually" is used for.  Through testing when we set 'amazon_advancedCapabilitiesMode' to 'true', the build succeeds.  By default, this is set to 'false' and is excluded from the catalog import scheduled jobs in the vrasn.exclusionList Property.  We also question how did builds previously succeed if the default = false, and is excluded from the catalog import.  This was something that previously worked, and at some point just stopped working.

   {

                                "key": "amazon_advancedCapabilitiesMode",

                                "value": {

                                    "type": "boolean",

                                    "value": false

                                }

                            },