Notifications

42 views

Description

When creating a Cloud Service Account for VMware, an empty account is created on your instance.

Steps to Reproduce

  1. Log into the instance with Cloud Management Plugin installed
  2. In the Navigation Filter type "Service Accounts" or go to /cmdb_ci_cloud_service_account_list.do
  3. Create a new Service Account for VMware following this doc: Create a service account for cloud discovery
  4. Enter the wrong UUID for Account ID and fill all the mandatory fields.
  5. Run discovery for datacenter.
  6. Select any discovered DC and discover the resource.
  7. Go back to your list of Service Accounts and observe that there is one dummy (empty) service account got created.

Workaround

  • The following workaround is intended only for the Kingston release. 
     
    1. Search for Script include 'VCenterDatacentersSensor'. Or navigate here: 
    /sys_script_include.do?sys_id=8da918db93831200c2fe705bb47ffb8e 
     
    (This is the sensor script include which will react to the 'VMWare - vCenter Datacenters' probe.) 

    2. Go to line 170 which starts with if (DiscoveryCMPUtils.isCmpActive()) and replace the block with the below codebase. 

    // The CMP API requires an association between the datacenter and a 
    // service account. Create it if CMP has been activated. 
    if (DiscoveryCMPUtils.isCmpActive()) { 
    var accountName = ""; 
    var ip = '' + g_probe.getSource(); 
    if (ip) 
    accountName = 'vCenter ServiceAccount@' + ip; 
    accountName = accountName || vCenter.name || vCenter.fullName || vCenter.url || "vCenter Auto Generated Account (" + vCenterUuid + ")"; 

    serviceAccount = { 
    datacenter_type: "cmdb_ci_vcenter_datacenter", 
    datacenter_url: vCenter.url || "", 
    name: accountName, 
    account_id: vCenterUuid, 
    object_id: vCenterUuid 
    }; 
    args.results.cmdb_ci_cloud_service_account = [ serviceAccount ]; 
    args.results.cmdb_ci_vcenter_datacenter.forEach( 
    function(dc) { 
    dc.hostedBy = serviceAccount; 
    dc.region = dc.name; 
    }); 


     
  • A duplicate service account for VMWare should not be created with this change. 

Related Problem: PRB1314608

Seen In

There is no data to report.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-11-15 13:16:22
Published:2018-11-15