Closed tobiasrodehutskors closed 8 years ago
Virsh requires that a domain be running for consolidation. If you try consolidating a non-running domain, virsh will give the error:
error: Requested operation is not valid: domain is not running
Having a backup script start offline domains (which are probably off for a reason) in order to do work on them is not recommended.
The only "solution" then would be to specify that consolidation only works with running domains.
See Pull Request #25
Thanks @AJRepo, awesome work!
In a next release we could think about introducing an additional flag for offline images backup. Having the backup performed always, regardless of the mode specified by the user, could be a bit confusing. Alternatively we could just exit with an error if -c is used.
Let's wait for @tobiasrodehutskors to give your patch a go and then we can merge.
I was thinking along the same lines. Also since someone could have a domain named "all" , perhaps replace matching logic $DOMAIN=="all" with flags that indicate full backup and type. E.g. -a||--all --all-running --all-shutoff, --all-paused
I created some live backups of a virtual machine and afterwards wanted to consolidate them into a single image. I turned the VM off and used the following command:
I expected that consolidation for not running domains works the same way as for running domains. Nevertheless, that is currently not the case. Instead the script started to back up the image files to the root folder /. I had a quick tool into the script and it seems that it simply backups all domains which are currently not running. I think this should be fixed.
I am using version 2.1.0 which I pulled from the master branch on Oct. 29th.