wefixit-AT / oVirtBackup

This is a tool, written in Python, to make online fullbackup's of a VM which runs in an oVirt environment.
MIT License
105 stars 54 forks source link

check if export domain is active prior to backup #51

Closed tareqalayan closed 5 years ago

tareqalayan commented 6 years ago

@wefixit-AT Hi, This PR adds check of the state of the export domain to be used for backup. I am using this and our lab and failed once because the export domain were in unattached state. Therefore i am introducing this PR. What do you think?

ghost commented 6 years ago

Will this also deal with the situation where another export domain is currently active? I handle this now with a simple script but it would be nice to see it built-in.

tareqalayan commented 6 years ago

@MrFuse each datacenter can have only one export domain. In this PR you can see i added in the conf file the name of datacenter and there was already the name of the export domain. And in the code i check the state of the export domain. so in case it is active i will proceed with creating snapshot then clone and export ... otherwise i will raise exception and won't create snapshot and clone a vm for nothing.

ghost commented 6 years ago

@tareqalayan, yes I am aware that there can only be one export domain at a time but in our environment we use 2. One is for regular import/export and the other is specifically for backups. I have a script the gets run before oVirtBackup that ensures the correct export domain is active. If it's not then the script detaches the incorrect export domain and attaches the one used for backups.