Thank you so much for your informative response. The man page of virsh did not include "snapshot=no" sub-option under the --diskspec option, but it is very intuitive. Thanks developers for their excellent work!

Hakan

Peter Krempa <pkrempa@redhat.com>, 6 Oca 2020 Pzt, 02:57 tarihinde şunu yazdı:
On Sun, Jan 05, 2020 at 17:21:52 -0600, Eyüp Hakan Duran wrote:
> Dear all,
> Please let me start by indicating that I am not from a technical
> background, so please be gentle and patient with me.
>
> I am trying to get a snapshot from my virtual machines (vm) and the
> following
> command works for all of them bar one:
>
> # virsh snapshot-create-as --quiesce --no-metadata --domain myvm myvm-state
> --diskspec vda,file=overlay.qcow2 --disk-only --atomic

You can drop --atomic if you use a qemu released in at least last 5
years as the snapshot is always atomic if the qemu supports the
'transaction' command.

>
> The only exception is this one vm, which has two disks as two separete
> qcow2 files: vda and vdb. Vdb contains my nexcloud data, resides on a
> btrfs subvolume, and a daily snapshot of this subvolume is taken by a
> cronjob
> by the host machine. Therefore, I do not want to include it in the
> snapshot taken by virsh, and therefore I did not include vdb as a
> separate --diskspec item, and used the same command indicated above.
> However, this fails with the following behavior: a state (or rather
> overlay file with a qcow2 extension is created on the host machine's
> directory where the image of vdb exists. My question is the following:
> Is there a way to direct virsh for only taking a snapshot ignoring one
> of the disks? Yes, I can always create that second snapshot/overlay

Sure. Just use a second --diskspec vdb,snapshot=no

> image of vdb and delete it later, but it doesn't feel very intuitive,
> and efficient. However, it is quite possible that I may be completely
> overseeing an important aspect of the process, and this may not be possible
> due to that :).

One disadvantage of the above operation is that the snapshot of vdb is
not from the same time as vda, but if that doesn't pose a problem in
your scenario it's okay to do it that way.

>
> Thanks for your inputs in advance.
>
> Hakan Duran

> _______________________________________________
> libvirt-users mailing list
> libvirt-users@redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users