简体   繁体   中英

How to access the instance of OpenStack VM instance from outside the subnent?

I have setup a cloud test bed using OpenStack. I used the 3 node architecture. The IP assigned to each node is as given below

Compute Node : 192.168.9.19/24 Network Node : 192.168.9.10/24 Controller Node : 192.168.9.2/24

The link of instance created is like this :

http://controller:6080/vnc_auto.html?token=2af0b9d8-0f83-42b9-ba64-e784227c119b&title=hadoop14%28f53c0d89-9f08-4900-8f95-abfbcfae8165%29

At first this instance was accessible only when I substitutes controller:8090 with 192.168.9.2:8090 . I solved this by setting a local DNS server and resolving 192.168.9.2 to controller.local . Now instead of substituting the IP it works when I substitute controller.local .

Is there any other way to do it?? Also how can I access this instance from another subnet other than 192.168.9.0/24, without specifying the IP.

If I understood your question correctly, yes there is another way, you don't need to set up a DNS server!

On the machine that you would like to access the link, perform the operations below:

  1. Open /etc/hosts file with a text editor.
  2. Add this entry: 192.168.9.2 controller
  3. Save the file, and that's it.

I suggest you to do these on all your nodes so that you can use these hostnames on your OpenStack configuration files instead of their IPs. This would also save you from tons of modifications if you have to make a change on the subnet IPs.

So for example your /etc/hosts files on your nodes should look like these:

#controller
192.168.9.2     controller

#network
192.168.9.10    network

#compute
192.168.9.19    compute

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM