Manually Adding an IP Address to URL/Hostname Mappings (KBA8150)
KBA
KBA# 8150Applicable Delphix Versions
- Click here to view the versions of the Delphix engine to which this article applies
-
Major Release All Sub Releases 6.0 6.0.5.0, 6.0.6.0, 6.0.6.1, 6.0.7.0, 6.0.8.0, 6.0.8.1, 6.0.9.0, 6.0.10.0, 6.0.10.1
How to Manually Add an IP Address to URL/Hostname Mappings
In some instances, it may be desirable to manually specify the IP address for a given hostname, in response to DNS server issues or to override an existing address received by the Engine. As the Delphix Engine is a closed appliance, direct access to the /etc/hosts file is not available, but a CLI/API method is available to create manual entries as desired.
Prerequisites
This feature is only available in Engines 6.0.5.0 and later (API version 1.11.5)
Adding a Host Mapping - CLI
Logging in as the sysadmin or equivalent System Setup user, navigate to the /service/host/address interface
delphixEngine> /service host address
Use the create command to begin transaction. The required fields are hostname and address; optionally, an arbitrary name for the mapping can be added, if desired.
delphixEngine service host address> create delphixEngine service host address create *> ls Properties type: StaticHostAddress name: (unset) addresses: (required) hostname: (required)
In the following example, the IP address for windowshost2.delphix.com will be altered to override DNS. Type commit
to submit the request, or type discard
to discard the transaction. If the operation is successful, no output is provided and the CLI will return to prompt.
delphixEngine service host address create *> set addresses=192.168.0.44 delphixEngine service host address create *> set hostname=windowshost2.delphix.com delphixEngine service host address create *> ls Properties type: StaticHostAddress name: (unset) addresses: 192.168.0.44 (*) hostname: windowshost2.delphix.com (*) delphixEngine service host address create *> commit delphixEngine service host address>
Adding a Host Mapping - API
The API POST and JSON formatted payload to create a host mapping is provided below; this assumes the prerequisite login and session token have been obtained.
POST /resources/json/delphix/service/host/address
{ "type": "StaticHostAddress", "hostname": "windowshost1.delphix.com", "addresses": [ "192.168.0.42" ] }
Removing a Host Mapping - CLI
Logging in as the sysadmin or equivalent System Setup user, navigate to the /service/host/address interface, and locate the entry desired for removal. In this example, the existing host entry for windowshost1.delphix.com will be located:
delphixEngine> /service host address delphixEngine service host address> ls Objects HOSTNAME ADDRESSES windowshost2.delphix.com 192.168.0.44 windowshost1.delphix.com 192.168.0.42
Select the existing host entry, and remove using the delete command:
delphixEngine service host address> select windowshost1.delphix.com delphixEngine service host address 'windowshost1.delphix.com'> delete delphixEngine service host address 'windowshost1.delphix.com' delete *> commit
Removing a Host Mapping - API
The API POST endpoint to remove an existing host mapping requires the reference name for the host entry. This example assumes the prerequisite login and session token have been obtained.
This reference value can be obtained via CLI by listing the entry details:
delphixEngine service host address 'windowshost1.delphix.com'> ls Properties type: StaticHostAddress name: windowshost1.delphix.com addresses: 192.168.0.42 hostname: windowshost1.delphix.com reference: STATIC_HOST_ADDRESS-windowshost1.delphix.com
Or via API GET:
GET /resources/json/delphix/service/host/address
=== RESPONSE === { "type": "StaticHostAddress", "reference": "STATIC_HOST_ADDRESS-windowshost1.delphix.com", "namespace": null, "name": "windowshost1.delphix.com", "hostname": "windowshost1.delphix.com", "addresses": [ "192.168.0.42" ] } ], "job": null, "action": null, "total": 1, "overflow": false }
To remove the example entry above, the corresponding POST would be as follows (no JSON payload required):
POST /resources/json/delphix/service/host/address/STATIC_HOST_ADDRESS-windowshost1.delphix.com/delete
Related Articles
- Further detail on the API endpoints discussed can be found in the onboard API help (after logging in)
http(s)://<your Engine address>/api/#address