On 03/23/2017 02:40 PM, Marcin Kruk wrote:
Hello is it possible to execute below actions from the ovirth-shell:
1. Make snapshot
( ovirt-shell -E 'add snapshot --parent-vm-name <vmname> --description
<desc> )
2. Make clone from snaphot above
( ? )
3. Export clone
( ? )
The ovirt-shell tools is deprecated since version 4.0 of oVirt, and will
be removed in version 4.2. I suggest that you avoid using it, and
consider using the Ansible modules:
http://docs.ansible.com/ansible/list_of_cloud_modules.html#ovirt
Or one of the SDKs:
Python:
https://github.com/oVirt/ovirt-engine-sdk
Ruby:
https://github.com/oVirt/ovirt-engine-sdk-ruby
Java:
https://github.com/oVirt/ovirt-engine-sdk-java
In particular these SDK examples may be of interest:
https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/add_vm...
https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/clone_...
If you still want to use ovirt-shell, then it should be something like this:
add snapshot --parent-vm-name myvm --description mysnap
That will return the snapshot data, including the id, take note of it,
and then:
add vm --name mynewvm --snapshots-snapshot
"snapshot.id=the_id_of_the_snapshot" --cluster-name mycluster