mitchellh / virtualbox

[ABANDONED] Create and modify virtual machines in VirtualBox using pure ruby.
http://mitchellh.github.com/virtualbox/
MIT License
245 stars 45 forks source link

The world needs snapshots #7

Closed AlekSi closed 14 years ago

AlekSi commented 14 years ago

Taking, restoring, removing.

mitchellh commented 14 years ago

Snapshots are particularly a big feature since each snapshot requires access to all VM settings. So basically the relationships for snapshot will be a relationship of VM objects, which need to identify themselves as snapshots rather than actual VMs.

This needs to be investigated further.

But snapshots will come sometime!

mitchellh commented 14 years ago

2 months later I'm happy to say this feature is delivered.

Basic documentation can be found on the VM class and on the Snapshot class but some basic usage is shown below:

vm = VirtualBox::VM.find("MyVM")
vm.current_snapshot # The current snapshot
vm.current_snapshot.parent.restore # Restore the parent snapshot
vm.take_snapshot("my snapshot", "A short description, perhaps")
snapshot = vm.find_snapshot("my_snapshot")
snapshot.destroy