snapshotter: vboxmanage poweroff and start (headless)
This commit is contained in:
parent
f1e8b63d7a
commit
bd90cbe8f7
@ -63,12 +63,12 @@ def restore(n):
|
||||
was_running = False
|
||||
if vminfo['VMState'] == 'running':
|
||||
click.echo('[{vm}] Running, stopping'.format(vm=vm))
|
||||
vagrant('suspend', vm)
|
||||
vboxmanage(['controlvm', vm, 'poweroff'])
|
||||
was_running = True
|
||||
click.echo("Restoring %s" % vm)
|
||||
snap = vboxmanage(['snapshot', vm, 'restore', n])
|
||||
if was_running:
|
||||
vagrant('up', vm)
|
||||
vboxmanage(['startvm', vm, '--type', 'headless'])
|
||||
click.echo(snap)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user