Displaying 2 results from an estimated 2 matches for "snap_filepath".
2015 Sep 11
2
Backup a VM (using live external snapshot and blockcommit)
...ssuming yes, here is the plan.
I wrote a script that does
# Create snapshot
virsh snapshot-create-as --domain $VM_NAME snap --diskspec
vda,file=$VM_DIR/"$VM_NAME"-snap.qcow2 --disk-only --atomic
--no-metadata --quiesce
# Copy frozen backing file
cp $VM_DIR/"$VM_NAME".qcow2 $SNAP_FILEPATH
# Blockcommit snapshot back into backing file
virsh blockcommit $VM_NAME vda --active --pivot
# Remove snapshot file
rm $VM_DIR/"$VM_NAME"-snap.qcow2
Variables should be self-explanatory:
- VM_DIR is the directory where the VM are stored
- VM_NAME is the name of the VM, and its qcow2...
2015 Sep 11
0
Re: Backup a VM (using live external snapshot and blockcommit)
...a script that does
>
> # Create snapshot
> virsh snapshot-create-as --domain $VM_NAME snap --diskspec
> vda,file=$VM_DIR/"$VM_NAME"-snap.qcow2 --disk-only --atomic
> --no-metadata --quiesce
>
> # Copy frozen backing file
> cp $VM_DIR/"$VM_NAME".qcow2 $SNAP_FILEPATH
>
> # Blockcommit snapshot back into backing file
> virsh blockcommit $VM_NAME vda --active --pivot
>
> # Remove snapshot file
> rm $VM_DIR/"$VM_NAME"-snap.qcow2
Yep, that about covers it. Note that the --quiesce step in snapshot
creation requires qemu-guest-agent ru...