How to offboard AWS VPC Logical Hosting Environment

Version 1
    Share This:

    CLM will fail the decom of VPC LHE as the VPC in AWS is usually tied to a route table and/or other resources, and therefore will fail dependency checks if you do not want to fully destroy your VPC.  This will leave your VPC partially decommissioned, and CLM in a limbo state.

     

    For those running into this issue, hopefully the below will help (I use SoapUI for these calls, but you could use Postman or any other REST utility):

     

    Error Cause:

     

    Transaction Id : 81415a17-aa54-499e-8e12-41c54e28efa5

    Root Cause : Failed to decommission an AWS VPC: Failed to delete vpc in AWS vpc-d6cd35b2 Error :  Failed to decomission vpc. Error : The vpc 'vpc-d6cd35b2' has dependencies and cannot be deleted. (Service: AmazonEC2; Status Code: 400; Error Code: DependencyViolation; Request ID: 08beb922-1c22-4958-bc15-a0527834ba84).,

     

    Proposed Action : A dependency check for the vpc failed. Ensure that no active workloads are running in the vpc.

    --------------------------------------------------------------------------------------------------

    There are 1 error(s) while executing the task

    ERROR 1:

    Severity: CRITICAL

    Error:  Failed to decommission an AWS VPC: Failed to delete vpc in AWS vpc-d6cd35b2 Error :  Failed to decomission vpc. Error : The vpc 'vpc-d6cd35b2' has dependencies and cannot be deleted. (Service: AmazonEC2; Status Code: 400; Error Code: DependencyViolation; Request ID: 08beb922-1c22-4958-bc15-a0527834ba84).

    Error Resolution: A dependency check for the vpc failed. Ensure that no active workloads are running in the vpc.

    Error ID: BMC-CLMT-40000052

    Transaction ID: 81415a17-aa54-499e-8e12-41c54e28efa5

    First step:

     

     

    How to Offboard an AWS LHE:

     

    1) Authenticate to PM to get an Authentication Token:

     

    request:

     

    POST https://<PLATFORM MANAGER URL>:<PORT>/csm/login HTTP/1.1

    Accept-Encoding: gzip,deflate

    Content-Type: application/json

    Content-Length: 68

    Host: <PLATFORM MANAGER URL>:<PORT>

    Connection: Keep-Alive

    User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

    {

      "username" : "<CLM ADMIN USER>",

      "password" : "<PASSWORD>"

    }

     

    response:

     

    HTTP/1.1 200 OK

    Date: Tue, 09 Apr 2019 14:21:38 GMT

    Authentication-Token: <AUTHENTICATION TOKEN>

    Session-ID: <SESSION ID>

    Content-Type: application/json; charset=UTF-8

    Content-Length: 2

    Server: Jetty(8.1.10.v20130312)

     

    2) Search for the GUID of the LHE you wish to offboard:

     

    request:

     

    POST https://<PLATFORM MANAGER URL>:<PORT>/csm/LogicalHostingEnvironment/search HTTP/1.1

    Accept-Encoding: gzip,deflate

    Content-Type: application/json

    Authentication-Token: <AUTHENTICATION TOKEN FROM STEP 1>

    Content-Length: 147

    Host: <PLATFORM MANAGER URL>:<PORT>

    Connection: Keep-Alive

    User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

     

    {

      "operationParams":[

        {

          "name":"pageSize",

          "type":"java.lang.Integer",

          "multiplicity":"0..1",

          "value":100

        }

      ]

    }

     

    response (SNIP OF SUBSET OF FULL LIST):

     

    {

        "cloudClass" : "com.bmc.cloud.model.beans.LogicalHostingEnvironment",

        "externalID" : "6f33817b-e99e-4d03-a651-a13810a33b77:us-gov-west-1:vpc-d6cd35b2:default:false",

        "guid" : "aab4adfa-cecd-45c9-b9c0-73eebc05e976",

        "isNATSupported" : false,

        "isTemplate" : false,

    <....>   

    }

     

    3) Perform Offboard Request - FIND YOUR VPC IN THE LIST ABOVE:

     

    request:

     

    POST https://<PLATFORM MANAGER URL>:<PORT>/csm/LogicalHostingEnvironment/<GUID FROM STEP 2> HTTP/1.1

    Accept-Encoding: gzip,deflate

    Content-Type: application/json

    Authentication-Token: <AUTHENTICATION TOKEN FROM STEP 1>

    Content-Length: 97

    Host: <PLATFORM MANAGER URL>:<PORT>

    Connection: Keep-Alive

    User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

     

    {

        "timeout" : -1,

        "preCallout" : "",

        "postCallout" : "",

        "callbackURL" : ""

    }

     

    response:

     

    HTTP/1.1 200 OK

    Date: Tue, 09 Apr 2019 14:22:04 GMT

    Session-ID: c0e20d4e-90d8-4727-947a-4b510c3f1137

    Content-Type: application/json; charset=UTF-8

    Content-Length: 2

    Server: Jetty(8.1.10.v20130312)