On Sat, Apr 22, 2017 at 11:26:17PM -0500, Leroy Tennison
wrote:> I have used
>
> virsh snapshot-create-as <VM name> <snapshot name>
"<snapshot
> description>" --diskspec
> "vda,snapshot=external,file=/path/to/external-snapshot"
--disk-only
> --atomic
To avoid creating libvirt metadata for external snapshots, here you can
provide the option '--no-metadata' to `virsh snapshot-create-as` so that
libvirt won't track the metadata anymore. This avoids having to delete
it manually (which you can do as I outlined further down below).
> to create an external snapshot of a running VM. I followed it with
>
> virsh blockpull <VM name> --path /path/to/external-snapshot
Slightly related: `blockcommit` is relatively faster than `blockpull` in
this case -- because your base image ("original-image-file.qcow")
should
have the bulk of the content, so `blockcommit` will copy only the
_delta_ from the original, which was stored in your
'external-snapshot.qcow2', so it'll be a shorter copy operation.
Here's some notes related to it:
http://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit
> and monitored it until done. I confirmed it with
>
> qemu-img info /path/to/external-snapshot
>
> which shows no backing store.
>
> However, when I do
>
> grep {/etc,/run}/libvirt/qemu/<VM name>.xml
>
> the xml for the VM still shows a backing store in the /run/... definition
> (but not in the /etc/... definition, my understanding is that the /etc/...
> definition won't be updated until the VM is shut down):
>
> <disk type='file' device='disk'>
> <driver name='qemu' type='qcow2'/>
> <source
file='/var/lib/libvirt/images/external-snapshot.qcow2'/>
> <backingStore type='file' index='1'>
> <format type='qcow2'/>
> <source
file='/var/lib/libvirt/images/original-image-file.qcow'/>
> <backingStore/>
> </backingStore>
> <target dev='hda' bus='ide'/>
> <alias name='ide0-0-0'/>
> <address type='drive' controller='0'
bus='0' target='0' unit='0'/>
> </disk>
>
> This is using libvirtd version 1.3.1 and qemu-img version 2.5.0.
>
> How do I resolve this situation? I don't want to have to rely on a
backing
> store permanently. Thanks for any help or pointers.
You can look at the existing snapshot metadata libvirt is tracking:
$ virsh snapshot-list --tree vm1
And then delete the metadata (the below command does that) for a named
snapshot:
$ virsh snapshot-delete vm1 --metadata snap1
--
/kashyap