Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
CMPv2. Discovery does not create expected "Virtualized by::Virtualizes" relationship between the Linux server CI and the AWS vm instance - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • CMPv2. Discovery does not create expected "Virtualized by::Virtualizes" relationship between the Linux server CI and the AWS vm instance
KB0687862

CMPv2. Discovery does not create expected "Virtualized by::Virtualizes" relationship between the Linux server CI and the AWS vm instance


1480 Views Last updated : Apr 7, 2024 public Copy Permalink
KB Summary by Now Assist

Issue

Pre-requisites


Plugins activated: Cloud API, Cloud Management Core

Unix Classification contains "Linux" classifier

Linux classifier triggers "Linux - Amazon EC2" Probe which is processed by sensor of the same name. Make sure the conditions script is met: gs.getProperty('glide.discovery.discover_aws_ec2_host_metadata') == 'true'

This Script Include is present: DiscoveryAWSRelationshipSensor 

Discovery log message: 

Warning Host hosted on cloud environment has been detected, but no matched cloud object found DiscoveryAWSRelationshipSensor 

The AWS accountid was being parsed by the "Linux - AWS relationship" sensor and passed as "000123456789" to the "DiscoveryAWSRelationshipSensor" script include function getServiceAccountSysId. 
 
When this function tries to query for "000123456789" in the service accounts AWS Account ID it failed as it was "0001-2345-6789" format. After I changed to "000123456789" it created the " Virtualized by::Virtualizes" relationship between the Linux server CI and the AWS vm instance. 
 
Lines 43 - 49: 
========================================================================= 
function getServiceAccoutSysId(glideUtil, accountId){ 
var serviceAccountSysId = null; 
var serviceAccountGlideRecord = glideUtil.getGlideRecordByAttribute('cmdb_ci_cloud_service_account','account_id',accountId); 
if(serviceAccountGlideRecord.next()) 
serviceAccountSysId = serviceAccountGlideRecord.getUniqueValue() + ''; 
return serviceAccountSysId; 
} 
========================================================================= 

 


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.