Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Iam managing kvm by libvirt and using qcow2 file format. I can create snapshots of running wm with snapshot-create command, but if I transfer my qcow2 image to another host and define transfered host by virsh define, I cant see snapshots created previously. Is there a way how to transfer snapshots too?

Thanks ;-)

share|improve this question

Assuming you have already transferred the images themselves and configured added their definitions to the destination libvirt instance all you need to do is to transfer the snapshot definitions as well. Here's a little script to aid you:




# Dump snapshot definitions
virsh -c $SRC_URL snapshot-list $SRC_DOMAIN_NAME | \
awk '$1 ~ /[[:digit:]]+/ { print $1 }' | \
xargs -I{} -n1 sh -c 'virsh -c "$1" snapshot-dumpxml "$2" "$3" | sed s#$4#$5# > "$2-$3.xml"' -- \

# Restore snapshot definitions
find . -type f -name "$SRC_DOMAIN_NAME-*.xml" | \
xargs -n1 echo virsh -c $DST_URL snapshot-create $DST_DOMAIN_NAME 

Just tune the variables to match your hosts and domains.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.