-
Notifications
You must be signed in to change notification settings - Fork 8
Description
I wish to have a parameter set by SlipStream which tells the local IP address the CSP has assigned to the VM interface.
In cloud environments, it is common that VM interfaces have a private IP address, that is translated by the cloud network to the public one it has assigned (if any).
The public ip address is now offered by slipstream via the hostname parameter.
Additionally, I'd like to have an extra parameter offering the local ip address.
In VMs with multiple logical interfaces, it is difficult to identify which is the interface that can reach the public network, and to gather the correct IP address locally.
However, as the local IP address is set by the CSP, there is commonly a way to retrieve it from there.
e.g. In EC2, one can use following CLI command:
aws ec2 describe-instances --instance-ids <instance_ID>
and parse the output to identify the value of filed:
PrivateIpAddress -> (string): The private IP address assigned to the instance.
To get the local IP address, according to documentation here: https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html#output