-
Notifications
You must be signed in to change notification settings - Fork 5
Example 8
Carlos edited this page Aug 4, 2017
·
1 revision
You can create, remove, revert and find snapshots. Here is an example of a basic usage:
>>> from vcdriver.vm import VirtualMachine
>>> vm = VirtualMachine(name='vm_name_to_be_found')
>>> vm.find()
Vcenter session opened with ID 52d75977-360d-0923-39ff-b914fd323d61
>>> vm.create_snapshot(name='test-snapshot', description='Certain known state', dump_memory=True)
Waiting for [Creating snapshot "test-snapshot" on "vm_name_to_be_found"] ... 0:01:44.443093
>>> vm.find_snapshot('test-snapshot')
'vim.vm.Snapshot:snapshot-16612'
>>> vm.revert_snapshot('test-snapshot')
Waiting for [Restoring snapshot "test-snapshot" on "vm_name_to_be_found"] ... 0:00:09.470538
>>> vm.remove_snapshot('test-snapshot')
Waiting for [Delete snapshot "test-snapshot" from "vm_name_to_be_found"] ... 0:00:25.020698- Example 1: Setting up vcdriver
- Example 2: Managing the session
- Example 3: Creating and finding virtual machines
- Example 4: Destroying virtual machines and power methods
- Example 5: Virtual machine management: SSH
- Example 6: Virtual machine management: SFTP
- Example 7: Virtual machine management: WinRM
- Example 8: Snapshots
- Example 9: Using vcdriver for testing
- Example 10: Further management