[libvirt-users] virsh blockcopy without undefine

Nathan Shearer mail at nathanshearer.ca
Wed Oct 14 03:46:09 UTC 2015

I have a script that performs a backup with the following steps:

    virsh dumpxml --inactive "$DOMAIN" > "$TMP/${DOMAIN}.xml" && \
            virsh dumpxml --inactive "$DOMAIN" > "$DESTINATION_XML" && \
            virsh undefine "$DOMAIN" && \
            virsh blockcopy "$DOMAIN" "$SOURCE_DISK" "$DESTINATION_DISK"
    --wait --verbose --finish && \
            virsh define "$TMP/${DOMAIN}.xml"

It's basic and did work for creating basic backups. Is there a way to do
this without undefining the domain? I recently had to redefine the VM
from a backup XML because this script failed during the block copy step.
Why can't I blockcopy a domain that is defined? Why does it need to be
undefined first?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20151013/e11e2b87/attachment.htm>

More information about the libvirt-users mailing list