Esempio n. 1
0
def hypervisor(request):

    dynamips_path = '/usr/bin/dynamips'
    print("\nStarting Dynamips Hypervisor: {}".format(dynamips_path))
    manager = HypervisorManager(dynamips_path, "/tmp", "127.0.0.1")
    hypervisor = manager.start_new_hypervisor()

    def stop():
        print("\nStopping Dynamips Hypervisor")
        manager.stop_all_hypervisors()

    request.addfinalizer(stop)
    return hypervisor
Esempio n. 2
0
def hypervisor(request):

    cwd = os.path.dirname(os.path.abspath(__file__))
    dynamips_path = os.path.join(cwd, "dynamips.stable")
    print("\nStarting Dynamips Hypervisor: {}".format(dynamips_path))
    manager = HypervisorManager(dynamips_path, "/tmp", "127.0.0.1", 9000)
    hypervisor = manager.start_new_hypervisor()

    def stop():
        print("\nStopping Dynamips Hypervisor")
        manager.stop_all_hypervisors()

    request.addfinalizer(stop)
    return hypervisor