Hello!
I have following code in Vagrantfile:
config.vm.define :master do |master|
master.vm.box = "centos64"
master.vm.provider :virtualbox do |v|
v.name = "virtual-tests-vm-node1"
v.customize ["modifyvm", :id, "--memory", vm_mem]
end
master.vm.hostname = "virtual-tests-vm-node1.localdomain"
*master.vm.network :private_network, type: "dhcp"*
end
If I run "vagrant ssh master" and then execute command ifconfig, I have
following output:
eth0 Link encap:Ethernet HWaddr 08:00:27:F7:3D:84
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fef7:3d84/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1267 errors:0 dropped:0 overruns:0 frame:0
TX packets:977 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:112413 (109.7 KiB) TX bytes:143334 (139.9 KiB)
*eth1 Link encap:Ethernet HWaddr 08:00:27:8F:48:D3 inet
addr:172.28.128.3 Bcast:172.28.128.255 Mask:255.255.255.0 inet6
addr: fe80::a00:27ff:fe8f:48d3/64 Scope:Link UP BROADCAST RUNNING
MULTICAST MTU:1500 Metric:1 RX packets:4 errors:0 dropped:0
overruns:0 frame:0 TX packets:10 errors:0 dropped:0 overruns:0
carrier:0 collisions:0 txqueuelen:1000 RX bytes:1743
(1.7 KiB) TX bytes:1236 (1.2 KiB)*
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:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
After that I write a plugin that does following
module Vagrant
module IpInfo
class Command < Vagrant.plugin("2", :command)
def execute
with_target_vms() do |machine|
*ifConfig = `ifconfig` puts "#{ifConfig}"*
end
end
end
end
end
But when I run this plugin I get following output:
eth0 Link encap:Ethernet HWaddr 68:b5:99:f6:4b:58
inet addr:10.100.141.178 Bcast:10.100.143.255 Mask:255.255.252.0
inet6 addr: fe80::6ab5:99ff:fef6:4b58/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:152929 errors:0 dropped:0 overruns:0 frame:0
TX packets:65455 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:72752581 (72.7 MB) TX bytes:57214699 (57.2 MB)
Interrupt:20 Memory:d7400000-d7420000
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:16436 Metric:1
RX packets:9627 errors:0 dropped:0 overruns:0 frame:0
TX packets:9627 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1324498 (1.3 MB) TX bytes:1324498 (1.3 MB)
lxcbr0 Link encap:Ethernet HWaddr ee:86:9f:70:e1:a9
inet addr:10.0.3.1 Bcast:10.0.3.255 Mask:255.255.255.0
inet6 addr: fe80::ec86:9fff:fe70:e1a9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:148 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:25882 (25.8 KB)
tun0 Link encap:UNSPEC HWaddr
00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.10.10.6 P-t-P:10.10.10.5 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:1473 errors:0 dropped:0 overruns:0 frame:0
TX packets:955 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1450212 (1.4 MB) TX bytes:246128 (246.1 KB)
vboxnet1 Link encap:Ethernet HWaddr 0a:00:27:00:00:01
inet addr:172.28.128.1 Bcast:172.28.128.255 Mask:255.255.255.0
inet6 addr: fe80::800:27ff:fe00:1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:131 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:27288 (27.2 KB)
It looks pretty strange.. Why do outputs are different? I tried to connect
to my virtual machine using any ip from plugin output and I failed. For
now, I can see correct ip only when vagrant ssh. How can I see ips using
vagrant plugins?
--
You received this message because you are subscribed to the Google Groups
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.