Comments (14)
Any news?
from ovirtbackup.
Work with oVirt 4.0?
Thanks @wefixit-AT
from ovirtbackup.
from ovirtbackup.
Hi, yes it works with oVirt 4.0 but not with the latest ovirt sdk4. I started working on it but it's not so easy because there are zero documentation and all information's have to gather from the python ovirt library or trough the engine java source.
from ovirtbackup.
It works correctly, thanks for everything
from ovirtbackup.
@wefixit-AT - there are many examples @ https://github.com/oVirt/ovirt-engine-sdk/tree/master/sdk/examples (and we'll add more).
Also, the oVirt Ansible module uses it and can be used as a good reference.
from ovirtbackup.
Hi, examples are good but a documentation is much better. It's hard for software engineers to learn by try and error or copy/paste from examples :-(
On the other hand I work in my one-man company currently 14-16 hours from monday to sunday. When I find a reliable employee I will finish all the work for my open source and research projects.
from ovirtbackup.
Hi, I am opening discussion for this issue since I am willing to implement the support for the new api, though before starting to implement anything I would like some feedback.
There are two main approaches that I can see right now:
My first thought was that we should have both ovirt-engine-sdk-python packages installed on the system (although they have the same name it can be done by installing the packages with -I option in pip), and support both APIs in the same file. This should be done by importing the default module or if only one available, the existing module, and then having some common interface for the API calls that we need, which will map us to the right API function call.
The other approach that we could follow, is completely separate the support for the new API into different branch, however this is not preferable in my opinion, since it will results it double effort to maintain the project.
Please let me know your thoughts on these.
from ovirtbackup.
Here are my thoughts on moving from SDK to SDK4:
- There is an advantage of coexistence - it allows to migrate function by function, module by module, while keeping functionality working. This is what ovirt-system-tests has done successfully.
- If going with a clean sheet approach, I'd consider doing it using the oVirt Ansible modules, creating roles and then playbacks for backup and restore. It is based on the the Python SDK4, it is more integrated with anything else you'd like to automate (using Ansible) and I'd reckon roles can be re-used in other playbooks. I feel a lot of boilerplate code would be spared this way as well, which otherwise you'd have to implement (or copy-paste from the oVirt Ansible modules - also a reasonable idea).
We also have an implementation of ovirt-system-tests which is using only the Ansible modules.
from ovirtbackup.
Does anybody has ideas, or worked on moving to sdk4 or to ansible?
from ovirtbackup.
I managed to make Ansible role with tasks like this:
---
# tasks file for ovbackup
- name: Backup VMs via oVirt engine
block:
- name: Return current time
local_action:
module: command
cmd: 'date +%Y%m%dT%H%M%S'
register: current_time
changed_when: false
- name: Obtain SSO token
local_action:
module: ovirt_auth
url: "{{ovirt_url}}"
username: "{{ovirt_user}}"
ca_file: "{{ovirt_ca}}"
password: "{{ovirt_pass}}"
run_once: True
- name: "Create snapshots of virtual machines"
local_action:
module: ovirt_snapshot
auth: "{{ovirt_auth}}"
vm_name: "{{vm_name}}"
description: "{{snapshot_name}}"
use_memory: false
timeout: 600
register: snapshot
- name: "Gather info for snapshots of virtual machines"
local_action:
module: ovirt_snapshot_info
auth: "{{ovirt_auth}}"
vm: "{{vm_name}}"
description: "{{snapshot_name}}"
register: result
- name: "Snapshots statuses"
debug:
msg: "{{snapshot_name}}: {{ result.ovirt_snapshots[0].snapshot_status }}"
- name: "Pause for 1 minute to settle down"
pause:
minutes: 1
- name: "Create clones of virtual machines"
local_action:
module: ovirt_vm
auth: "{{ovirt_auth}}"
snapshot_vm: "{{vm_name}}"
snapshot_name: "{{snapshot_name}}"
name: "{{vm_clone_name}}"
state: present
timeout: 3600
- name: "Delete snapshots of virtual machines"
local_action:
module: ovirt_snapshot
auth: "{{ovirt_auth}}"
vm_name: "{{vm_name}}"
state: absent
snapshot_id: "{{ snapshot.id }}"
timeout: 600
- name: "Export images of virtual machines"
local_action:
module: ovirt_vm
auth: "{{ovirt_auth}}"
name: "{{vm_clone_name}}"
state: exported
cluster: "{{cluster}}"
export_domain: "{{export_domain}}"
timeout: 3600
- name: "Remove clones of virtual machines"
local_action:
module: ovirt_vm
auth: "{{ovirt_auth}}"
state: absent
name: "{{vm_clone_name}}"
timeout: 600
always:
- name: Revoke the SSO token
local_action:
module: ovirt_auth
state: absent
ovirt_auth: "{{ovirt_auth}}"
Unfortunately I couldn't find a way for housekeeping backups in export domain.
from ovirtbackup.
Thanks I try it on my environment.
I played the last weeks with snapshots and duplicity to find a backup solution which does not need the SDK. The disadvantage is that you have to mount the raw image files and identify the main files an snapshots of the VM's but in case of a disaster recovery it's okay for me.
from ovirtbackup.
Be aware, you need to reduce parallel tasks. I do this by setting serial = 2:
---
- hosts: backup_vms
gather_facts: no
serial: 2
roles:
- role: ovbackup
If you need, my defaults for role look like this:
---
# defaults file for ovbackup
ovirt_url: https://ovirt.engine.host/ovirt-engine/api
ovirt_ca: /path/to/ovirt/ca.crt
ovirt_user: ovirtuser@internal
ovirt_pass: ovirtpass
cluster: ovirt_cluster
snapshot_name: ovbackup_playbook
export_domain: export
vm_name: "{{ inventory_hostname | regex_replace('^([a-z0-9-]+)\\..*$', '\\1') }}"
vm_clone_name: "{{vm_name}}_BCK_{{current_time.stdout}}"
I think it would be quite neat solution if I manage somehow to delete old backups from export domain.
from ovirtbackup.
Done with the latest pull request
from ovirtbackup.
Related Issues (20)
- Backup fails completely if VM missing HOT 1
- Create VM from snapshot HOT 2
- oVirtBackup stop working after update to oVirt 4.2.7 HOT 1
- API version 4 required (v3 support dropped with oVirt engine 4.3) HOT 4
- !!! No snapshot found !!! HOT 5
- Cyrillic symbol in name of snapshot HOT 1
- Error in VM nameresolution on delete cloned-vm HOT 13
- Imported VM deleted in backup rotation HOT 2
- !!! Got unexpected exception: The 'search' parameter should be of type 'str', but it is of type 'unicode'.
- Branch 4.3 no cleanup before or after backup
- Please test branch 4.3 with oVirt 4.4 HOT 4
- The script does not delete the cloned VM HOT 3
- Selecting a disk for backup HOT 2
- TypeError: The 'search' parameter should be of type 'str', but it is of type 'unicode'. HOT 2
- [feature] Support for not incremental backup API
- [feature] Support incremental backup API
- [feature] Support User Interface interface plugin
- [deprication] Export storage domain is depricated HOT 1
- Add back the option to backup vms by vm_names
- Master branch failed with : 'Config' object has no attribute 'get_disks_id_exclude' HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ovirtbackup.