From dc26be43c223a52fa1aaa193a9b7d763761f0a1b Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Fri, 4 Nov 2016 11:07:43 +0100 Subject: [PATCH] Fix random VirtualBox creation error when using linked clone Fix #760 --- gns3server/compute/virtualbox/virtualbox_vm.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gns3server/compute/virtualbox/virtualbox_vm.py b/gns3server/compute/virtualbox/virtualbox_vm.py index 393234ca..2ba6c243 100644 --- a/gns3server/compute/virtualbox/virtualbox_vm.py +++ b/gns3server/compute/virtualbox/virtualbox_vm.py @@ -861,9 +861,16 @@ class VirtualBoxVM(BaseNode): self._vmname = self._name yield from self.manager.execute("setextradata", [self._vmname, "GNS3/Clone", "yes"]) - args = [self._vmname, "take", "reset"] - result = yield from self.manager.execute("snapshot", args) - log.debug("Snapshot 'reset' created: {}".format(result)) + # We create a reset snapshot in order to simplify life of user who want to rollback their VM + # Warning: Do not document this it's seem buggy we keep it because Raizo students use it. + try: + args = [self._vmname, "take", "reset"] + result = yield from self.manager.execute("snapshot", args) + log.debug("Snapshot 'reset' created: {}".format(result)) + # It seem sometimes this failed due to internal race condition of Vbox + # we have no real explanation of this. + except VirtualBoxError: + log.warn("Snapshot 'reset' not created") def _start_remote_console(self): """