GNS3 / gns3-server

GNS3 server
GNU General Public License v3.0
811 stars 263 forks source link

Two VirtualBox VMs can't start at once #190

Closed ghost closed 9 years ago

ghost commented 9 years ago

GNS3 V1.3.3, OS Mac OS X V10.9.5, VirtualBox 4.3.28

See https://community.gns3.com/message/27540#27540

Topology: eos

If I start all devices at once, one of the VirtualBox VMs doesn't start. It's reproducible, it happens all the time. They are not linked clones, just 2 "normal" VMs. When I start one VM, wait a few seconds and then start the rest, everything works fine.

The log shows:

May 17 12:40:52 imac.lan GNS3[2574] <Notice>: 2015-05-17 12:40:52 INFO virtualbox_vm.pyc:188 VirtualBox VM 'vEOS2' [a6f7e4b6-d77d-4287-983a-5ba74be52c7d] started
May 17 12:40:52 imac.lan GNS3[2574] <Notice>: 2015-05-17 12:40:52 ERROR route.pyc:150 VM error detected: <class 'gns3server.modules.virtualbox.virtualbox_error.VirtualBoxError'>
May 17 12:40:52 imac.lan GNS3[2574] <Notice>: Traceback (most recent call last):
May 17 12:40:52 imac.lan GNS3[2574] <Notice>:   File "gns3server/web/route.pyc", line 140, in control_schema
May 17 12:40:52 imac.lan GNS3[2574] <Notice>:   File "gns3server/handlers/api/virtualbox_handler.pyc", line 193, in start
May 17 12:40:52 imac.lan GNS3[2574] <Notice>:   File "gns3server/modules/virtualbox/virtualbox_vm.pyc", line 187, in start
May 17 12:40:52 imac.lan GNS3[2574] <Notice>:   File "gns3server/modules/virtualbox/__init__.pyc", line 114, in execute
May 17 12:40:52 imac.lan GNS3[2574] <Notice>: gns3server.modules.virtualbox.virtualbox_error.VirtualBoxError: VirtualBox has returned an error: 
May 17 12:40:52 imac.lan GNS3[2574] <Notice>: 2015-05-17 12:40:52 INFO server.pyc:169 127.0.0.1 - - Sun, 17 May 2015 10:40:52 GMT "POST /v1/projects/effde697-b8c6-49e7-abde-93fbd0234d1f/virtualbox/vms/c5a9a8db-41f9-4074-904f-058f047365b5/start HTTP/1.1" 409 308 "-" "GNS3 QT Client v1.3.3"
May 17 12:40:52 imac.lan GNS3[2574] <Notice>: 2015-05-17 12:40:52 INFO http_client.pyo:362 Response error: Error downloading http://192.168.1.10:8000/v1/projects/effde697-b8c6-49e7-abde-93fbd0234d1f/virtualbox/vms/c5a9a8db-41f9-4074-904f-058f047365b5/start - server replied: Conflict
May 17 12:40:52 imac.lan GNS3[2574] <Notice>: 2015-05-17 12:40:52 ERROR vm.pyo:96 error while starting vEOS1: VirtualBox has returned an error: 
May 17 12:40:52 imac.lan GNS3[2574] <Notice>: 2015-05-17 12:40:52 INFO server.pyc:169 127.0.0.1 - - Sun, 17 May 2015 10:40:52 GMT "POST /v1/projects/effde697-b8c6-49e7-abde-93fbd0234d1f/virtualbox/vms/a6f7e4b6-d77d-4287-983a-5ba74be52c7d/start HTTP/1.1" 204 203 "-" "GNS3 QT Client v1.3.3"
May 17 12:40:52 imac.lan GNS3[2574] <Notice>: 2015-05-17 12:40:52 INFO vm.pyo:99 vEOS2 has started
ghost commented 9 years ago

The VirtualBox logs tells something about failed to start the UDP tunnel server:

00:00:00.132793 UDPTunnel#0: sport=10004;dest=192.168.1.10;dport=10005
00:00:00.132933 UDPTunnel#1: sport=10006;dest=192.168.1.10;dport=10007
00:00:00.133053 UDPTunnel#2: sport=10008;dest=192.168.1.10;dport=10009
00:00:00.133170 UDPTunnel#3: sport=10010;dest=192.168.1.10;dport=10011
00:00:00.133197 VMSetError: /Users/vbox/tinderbox/4.3-mac-rel/src/VBox/Devices/Network/DrvUDPTunnel.cpp(556) int drvUDPTunnelConstruct(PDMDRVINS*, CFGMNODE*, uint32_t); rc=VERR_PDM_HIF_OPEN_FAILED
00:00:00.133211 VMSetError: UDPTunnel: Failed to start the UDP tunnel server
00:00:00.133236 VMSetError: /Users/vbox/tinderbox/4.3-mac-rel/src/VBox/Devices/Network/DevE1000.cpp(7709) int e1kR3Construct(PDMDEVINS*, int, CFGMNODE*); rc=VERR_PDM_HIF_OPEN_FAILED
00:00:00.133236 VMSetError: Failed to attach the network LUN
00:00:00.133236 PDM: Failed to construct 'e1000'/4! VERR_PDM_HIF_OPEN_FAILED (-2852) - Unable to open the host interface.
00:00:00.137635 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={8ab7c520-2442-4b66-8d74-4ff1e195d2b6} aComponent={Console} aText={UDPTunnel: Failed to start the UDP tunnel server (VERR_PDM_HIF_OPEN_FAILED).
00:00:00.137646 Failed to attach the network LUN (VERR_PDM_HIF_OPEN_FAILED)}, preserve=false
00:00:00.139414 Power up failed (vrc=VERR_PDM_HIF_OPEN_FAILED, rc=NS_ERROR_FAILURE (0X80004005))

In https://community.gns3.com/thread/8516 the same VirtualBox error was shown, when he starts using more than 4 connections. I don't know if both issues are connected.

Update 1: They seem to be connected !!! If I remove PC4 I have no problems starting both VirtualBox VMs at once.

Update 2: User ngs3 confirmed, that he has the same problem on Windows 7 (64 bit)

julien-duponchelle commented 9 years ago

I don't have the same issue with MacOS 10.10 and VirtualBox 4.3.26 I try to upgrade VirtualBox

julien-duponchelle commented 9 years ago

Idem with 4.3.28 and the following topology capture d ecran 2015-05-29 a 17 02 16

julien-duponchelle commented 9 years ago

Work also for this: capture d ecran 2015-05-29 a 17 05 16

ghost commented 9 years ago

You have to configure more links. My topology works, if I remove PC4. My current assumption is, that you need at least 2 virtual box VMs with 4 active interfaces each.

ghost commented 9 years ago

And I had no problems with this topology: vbox-8udp

So you need something similar to my topology

julien-duponchelle commented 9 years ago

Your vEOS are VirtualBoxes ? And the PC4 is a VPCS?

ghost commented 9 years ago

Yes, the vEOS are VirtualBox VMs. Currently I use the linked clone feature, but for the test I created two full clones and used them. veos-vbox

The PC1 - PC4 are VPCS.

In https://community.gns3.com/message/27540#27540 the topology is attached (untitled.gns3)

julien-duponchelle commented 9 years ago

This work for me: capture d ecran 2015-05-29 a 17 44 00

I will look deeply in your topology

julien-duponchelle commented 9 years ago

This crash for me: capture d ecran 2015-05-29 a 17 55 36

julien-duponchelle commented 9 years ago

Could you test with: http://sourceforge.net/projects/gns-3/files/Nightly%20Builds/2015-06-01/GNS3-stable.2015-06-01.dmg/download

It should start vm one by one

ghost commented 9 years ago

No, that doesn't work, it looks like before. Well, not really exactly. Neither with 1.3.3 nor with the test version I could reproduce the error with 4 VPCS, I increased them to 6 VPCS. But then the error was exactly the same with both versions.

But I'm not sure, I have your changed version.

GNS3.app is actual:

/Users/behlers# ls -l /Volumes/GNS3/
total 8
lrwxr-xr-x  1 behlers  staff   13  1 Jun 14:17 Applications@ -> /Applications
drwxr-xr-x  3 behlers  staff  102  1 Jun 14:16 GNS3.app/

But the contents of GNS3.app/Contents/Resources/lib/python34.zip is from today 05:16, but that may be because the time zone is not in the zip file.

/Users/behlers# unzip -l /Volumes/GNS3/GNS3.app/Contents/Resources/lib/python34.zip 
Archive:  /Volumes/GNS3/GNS3.app/Contents/Resources/lib/python34.zip
  Length     Date   Time    Name
 --------    ----   ----    ----
        0  06-01-15 05:16   ./
     4138  06-01-15 05:16   __future__.pyo
      983  06-01-15 05:16   _bootlocale.pyo
    23916  06-01-15 05:16   _collections_abc.pyo
     4310  06-01-15 05:16   _compat_pickle.pyo
     4792  06-01-15 05:16   _dummy_thread.pyo
    10619  06-01-15 05:16   _osx_support.pyo
    15585  06-01-15 05:16   _strptime.pyo
...

Of course I didn't start the GNS3 from the dmg, I copied it to /Applications.

julien-duponchelle commented 9 years ago

You can check the version in the about dialog or in the console at the bottom.

I have the feeling Vbox OSX is not very reliable with large number of adapter...

julien-duponchelle commented 9 years ago

Jeremy do you have the same issue on Linux?

ghost commented 9 years ago

Sure, i'm not jeremy :-), is he following this issue ?

Anyway I created this whole issue, because someone had problems with virtualbox on windows 7, see https://community.gns3.com/thread/8516. So don't think it's OS X specific.

julien-duponchelle commented 9 years ago

Yeah jeremy watch everything :)

ghost commented 9 years ago

I just tried on my debian 8 (Jessie) with gns3 v1.3.3.

I copied the vdi file from OS X and created 2 vEOS vbox VMs, the same as in OS X. I then created a topology with 2 vEOS VMs and 12 VPCS ( 6 per vEOS). No problems.

But there are some differences:

julien-duponchelle commented 9 years ago

I understand the issue :) It's related to VPCS.

VPCS allocate an UDP port at source + 9 sometimes it's collide with VirtualBox

grossmj commented 9 years ago

In GNS3 VPCS is started using -i1 which should prevent that to happen or maybe there is a problem there?

julien-duponchelle commented 9 years ago

The options is here, perhaps vpcs ignore it

julien-duponchelle commented 9 years ago

I confirm same issue with vpcs trunk version

julien-duponchelle commented 9 years ago

The issue is here: https://sourceforge.net/p/vpcs/code/HEAD/tree/trunk/src/relay.c#l318

julien-duponchelle commented 9 years ago

I found a way to dirty patch it by turning off the relay mode.

julien-duponchelle commented 9 years ago

Fixed by a VPCS patch