Highlighted
Expert
Expert

How to answer mandatory values for each AWS EC2 VM when destroying a deployment via REST API

We have a Blueprint made up of 5 AWS EC2 VM's.  When destroying a deployment via UI you have to modify the "Delete Volume" option for each VM because it's set to NULL.  I can't find a way to change the default value within the Blueprint but it's not a terrible hassle when using the UI for one or two destroys.

When trying to destroy a deployment via API, though, the destroy action request template for the deployment doesn't have the "provider-DeleteVolumes" option listed so the destroy fails.  I have to destroy all 5 VM's individually, which adds a lot of load to the system as is it processes 5 times the workflows.

Deployment destroy action request template:

{
    "type": "com.vmware.vcac.catalog.domain.request.CatalogResourceRequest",
    "resourceId": "7b888b98-e4d8-4e23-a382-71c24692b9ea",
    "actionId": "91d8ab6e-46ff-4573-b730-e7948b7af616",
    "description": null,
    "data": {
        "ForceDestroy": false
    }
}

Machine destroy action request template:

{
    "type": "com.vmware.vcac.catalog.domain.request.CatalogResourceRequest",
    "resourceId": "5b802189-4498-469e-939d-530043b8514c",
    "actionId": "5f51c11d-395f-4e08-82b5-d7e09f33f246",
    "description": null,
    "data": {
        "provider-DeleteVolumes": null
    }
}

Anyone know how to either change default provider-DeleteVolumes option on the Blueprint OR somehow set this option when destroying the deployment?

VCP5-DV twitter - @ericblee6 blog - http://vEric.me
0 Kudos
2 Replies
Highlighted
Expert
Expert

Talked to VMware. They are looking at options to correct this. Won't come out until 7.5 release, though.

For now we are destroying via VM and will also run a Lambda function daily to delete any unattached AWS Volumes.

VCP5-DV twitter - @ericblee6 blog - http://vEric.me
0 Kudos
Highlighted
Contributor
Contributor

This will work with an update to the deployments Destroy action template.

Just add ""provider-DeleteVolumes": null" to the data section when destroying the entire blueprint.

{
    "type": "com.vmware.vcac.catalog.domain.request.CatalogResourceRequest",
    "resourceId": "7b888b98-e4d8-4e23-a382-71c24692b9ea",
    "actionId": "91d8ab6e-46ff-4573-b730-e7948b7af616",
    "description": null,
    "data": {
        "ForceDestroy": false,

        "provider-DeleteVolumes": null

    }
}