cloudfoundry-attic / bosh-lite

A lite development env for BOSH
Apache License 2.0
319 stars 244 forks source link

README and vagrantfile says IP should be on private network, but box came up on a public network IP #70

Closed shalako closed 10 years ago

shalako commented 10 years ago

I wasn't able to bosh target the vm until @mmb pointed me at this command:

± |master ✗| → vagrant ssh-config Host default HostName 172.16.95.129 User vagrant Port 22 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile /Users/scoen/.vagrant.d/insecure_private_key IdentitiesOnly yes LogLevel FATAL

± |master ✗| → cat Vagrantfile VM_MEMORY = 6*1024 VM_CORES = 4 BOX_VERSION = 110

Vagrant.configure('2') do |config|

config.vm.hostname='bosh-lite' config.vm.box = "boshlite-ubuntu1204-build#{BOX_VERSION}" config.vm.network :private_network, ip: '192.168.50.4'

config.vm.provider :virtualbox do |v, override| override.vm.box_url = "http://bosh-lite-build-artifacts.s3.amazonaws.com/bosh-lite/#{BOX_VERSION}/boshlite-virtualbox-ubuntu1204.box" v.customize ["modifyvm", :id, "--memory", VM_MEMORY] v.customize ["modifyvm", :id, "--cpus", VM_CORES] end

config.vm.provider :vmware_fusion do |v, override| override.vm.box_url = "http://bosh-lite-build-artifacts.s3.amazonaws.com/bosh-lite/#{BOX_VERSION}/boshlite-vmware-ubuntu1204.box" v.vmx["numvcpus"] = VM_CORES v.vmx["memsize"] = VM_MEMORY end

end

mkocher commented 10 years ago

I don't understand the problem/solution. What were you seeing and what did you have to do?

shalako commented 10 years ago

Sorry, I realize there's some obvious info missing.

Using the VMWare Fusion Provider (preferred) step 3

I got the vagrant box up but bosh target timed out.

± |master ✗| → bosh target 192.168.50.4 Perform request get, https://192.168.50.4:25555/info, {"Content-Type"=>"application/json"}, nil REST API call exception: execution expired

syslxg commented 10 years ago

which version of vagrant-vmware-fusion plugin are you using? And would you like to try the latest one, 2.2.7? I found 2.2.5 and 2.2.6 had problems setting up the private network, not exactly matches this problem, but kind of related.

shalako commented 10 years ago

I'm probably using 2.2.0, because that's what the instructions say to use: https://github.com/cloudfoundry/bosh-lite. I will try installing 2.2.7

shalako commented 10 years ago

Now the vagrant vm has both 172 and 192 interfaces configured

vagrant@bosh-lite:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0c:29:1d:43:68
          inet addr:172.16.95.129  Bcast:172.16.95.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe1d:4368/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:548 errors:0 dropped:0 overruns:0 frame:0
          TX packets:443 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:59780 (59.7 KB)  TX bytes:53938 (53.9 KB)

eth1      Link encap:Ethernet  HWaddr 00:0c:29:1d:43:72
          inet addr:192.168.50.4  Bcast:192.168.50.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:436 errors:0 dropped:0 overruns:0 frame:0
          TX packets:267 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:56991 (56.9 KB)  TX bytes:78700 (78.7 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:3324 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3324 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1897602 (1.8 MB)  TX bytes:1897602 (1.8 MB)

I installed 2.2.7 plugin and restarted vm. No change. Bosh works now at 192.168.50.4 but still have the external IP configured. I'll open separate issue for not being able to target cc.

mkocher commented 10 years ago

It's expected that you have both interfaces. If you're having trouble cf targeting you likely are encountering the networking bug and need to upgrade or downgrade your box, and vagrant destroy and recreate.

shalako commented 10 years ago

Initially I brought the vagrant box up and it did not respond on the 192 address. In troubleshooting, we found the public interface worked and have been trying to use that. I'm less concerned about the public interface if the private one actually works. The reason for this issue was that the private one did not work.

± |master ✗| → vagrant ssh-config Host default HostName 172.16.95.129 User vagrant Port 22 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile /Users/scoen/.vagrant.d/insecure_private_key IdentitiesOnly yes LogLevel FATAL

shalako commented 10 years ago

The reason for this issue was that the private interface did not work. Could not bosh target 192.168.50.4 until the director was restarted.

mkocher commented 10 years ago

As far as I can tell this is a vagrant bug. We rely entirely on the vagrantfile to start the box and assign the IP. If you've got steps to reproduce we can do more troubleshooting.