If the MID Server selector is called with an FQDN, which is not in the IP Address to DNS Name [cmdb_ip_address_dns_name] table, rather than an IP address, the operation fails. When this failure occurs, there is no attempt to resolve the FQDN in the customer environment (e.g. by querying a DNS server), and the system typically throws a BadArgumentException.
One known use case is the discovery of a vCenter server using the Cloud Discovery application.
Note: The cmdb_ip_address_dns_name table defines many-to-many relationships between records in the IP Address [cmdb_ci_ip_address] and DNS Name [cmdb_ci_dns_name] tables.
Steps to Reproduce
Known use case:
Using the Cloud Discovery application, discover a vCenter server where:
- The only known address is an FQDN, rather than an IP address.
- The FQDN does not have an entry in the cmdb_ip_address_dns_name table.
Result: The MID Selector operation fails
Alternatively, there are simple steps to reproduce outside of any application:
- Login with a user that has the admin role.
- Navigate to System Definition > Scripts - Background.
- Enter the following code:
var ms = new SNC.MidSelector();
var targets = ['blahblahblah.example.com']; //An FQDN that is not in cmdb_ip_address_dns_name
gs.print(ms.selectAnyMidServer('Discovery', targets, null));
- Click Run script.
Result: The BadArgumentException error appears in the script result page.
If possible, provide an IP address to the MID Selector. Otherwise, manually populate records to ensure the MID Selector can resolve the FQDN:
- Add records in the cmdb_ci_ip_address and cmdb_ci_dns_name tables
- Add a record in the cmdb_ip_address_dns_name table pointing to the other two records.
Related Problem: PRB1241798