From 05aafb9538a5b2338a8c9b0236a7edb9fd1cd13c Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 1 Jun 2015 16:16:34 +0200 Subject: [PATCH] Revert "Start virtualbox VM one by one" because it doesn't fix the issue This reverts commit da72a9501a7074130d5d7bf2e1da763f01fd308a. --- gns3server/modules/virtualbox/__init__.py | 3 -- .../modules/virtualbox/virtualbox_vm.py | 29 +++++++++---------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/gns3server/modules/virtualbox/__init__.py b/gns3server/modules/virtualbox/__init__.py index 23443274..509b7182 100644 --- a/gns3server/modules/virtualbox/__init__.py +++ b/gns3server/modules/virtualbox/__init__.py @@ -41,9 +41,6 @@ class VirtualBox(BaseManager): super().__init__() self._vboxmanage_path = None - # It seem starting two VM in paralell can be an issue: - # https://github.com/GNS3/gns3-server/issues/190 - self.start_lock = asyncio.Lock() self._execute_lock = asyncio.Lock() @property diff --git a/gns3server/modules/virtualbox/virtualbox_vm.py b/gns3server/modules/virtualbox/virtualbox_vm.py index 21c7d655..ddeb6089 100644 --- a/gns3server/modules/virtualbox/virtualbox_vm.py +++ b/gns3server/modules/virtualbox/virtualbox_vm.py @@ -178,24 +178,23 @@ class VirtualBoxVM(BaseVM): if vm_state != "poweroff" and vm_state != "saved": raise VirtualBoxError("VirtualBox VM not powered off or saved") - with (yield from self.manager.start_lock): - yield from self._set_network_options() - yield from self._set_serial_console() + yield from self._set_network_options() + yield from self._set_serial_console() - args = [self._vmname] - if self._headless: - args.extend(["--type", "headless"]) - result = yield from self.manager.execute("startvm", args) - log.info("VirtualBox VM '{name}' [{id}] started".format(name=self.name, id=self.id)) - log.debug("Start result: {}".format(result)) + args = [self._vmname] + if self._headless: + args.extend(["--type", "headless"]) + result = yield from self.manager.execute("startvm", args) + log.info("VirtualBox VM '{name}' [{id}] started".format(name=self.name, id=self.id)) + log.debug("Start result: {}".format(result)) - # add a guest property to let the VM know about the GNS3 name - yield from self.manager.execute("guestproperty", ["set", self._vmname, "NameInGNS3", self.name]) - # add a guest property to let the VM know about the GNS3 project directory - yield from self.manager.execute("guestproperty", ["set", self._vmname, "ProjectDirInGNS3", self.working_dir]) + # add a guest property to let the VM know about the GNS3 name + yield from self.manager.execute("guestproperty", ["set", self._vmname, "NameInGNS3", self.name]) + # add a guest property to let the VM know about the GNS3 project directory + yield from self.manager.execute("guestproperty", ["set", self._vmname, "ProjectDirInGNS3", self.working_dir]) - if self._enable_remote_console and self._console is not None: - self._start_remote_console() + if self._enable_remote_console and self._console is not None: + self._start_remote_console() @asyncio.coroutine def stop(self):