Finding one vm from another in a single deployment


Craig Rubendall
 

Hi,

Newbie question....

I'm trying to create a deployment with 2 vms, let's call them client and server. From my client vm, I need the server's allocated ip address (or something that will resolve to an ip address) so I can make a tcp connection.

Is there a facility in Bosh for the client to retrieve this information?

Craig


Dmitriy Kalinin
 

Currently you have to specify static_ip for the job (some more info here:
https://bosh.io/docs/networks.html), and place that IP into a property of a
different job. However, we are in the middle of implementing a feature
called links which eliminates this manual configuration. Director will
automatically provide requested information (IPs, etc.) to each job. You
can find more implementation details here:
https://github.com/cloudfoundry/bosh-notes/blob/master/links.md. I have not
created user facing documentation as we are still implementing this feature.

On Fri, Sep 11, 2015 at 2:15 PM, Craig Rubendall <Craig.Rubendall(a)sas.com>
wrote:

Hi,



Newbie question….



I’m trying to create a deployment with 2 vms, let’s call them client and
server. From my client vm, I need the server’s allocated ip address (or
something that will resolve to an ip address) so I can make a tcp
connection.



Is there a facility in Bosh for the client to retrieve this information?



Craig


Craig Rubendall
 

Thanks for the information.

I'm assuming that I can use a "VIP" bosh network definition to solve this, then put the ip address in as the property. It was relatively easy to define this, but I can't seem to get the security groups correct on AWS to have my client VM see the server VM via the elastic ip address. Has anyone done this? It seems so straightforward, so I have no idea what I'm doing wrong.

My deployment manifest looks like this:

networks:
- name: default
type: dynamic
cloud_properties:
subnet: subnet-xxxxxxx
- name: elasticip
type: vip
cloud_properties: {}

I've also tried adding explicit security groups to the cloud_properties for the vip network, and i've tried adding the subnet.

Then my job area has in it:

networks:
- name: elasticip
static_ips: [52.xx.xx.xx]
- name: default
default: [dns, gateway]

Any ideas on what I'm doing incorrectly? Or am I trying to do something that won't work? I've used the Terraform "tiny" script to set up my deployment of CF (if that in any way gives a clue of what I need to do).


Craig Rubendall
 

I got this working. I had to do several things:

1. I had to change the default security groups assigned to the server vm so that it could be accessed by the client vm. Seems a bit odd to me that I couldn't figure out a way to just "add to" the list of security groups that are automatically applied, I had to explicitly specify all of them plus my additions.

2. When setting the property to use on the client, I had to use the hostname that was allocated via Elastic IP, not the ip address. This leveraged the fact that the public hostname created via AWS Elastic IP actually resolves to the internal ip address inside AWS. This way I didn't have to open my subnet to the outside world.