<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Greetings,<br><br></div>I have the following typical scenario: given one or more qcow2 base images I clone them with COW and start the VMs.<br><br></div>At a certain point I'd like to inspect them in order to see their evolution compared to the known base images. To do so I was thinking about taking a disk snapshot of each VM and inspect its content through libguestfs (using it's Python bindings).<br><br></div>Obviously I need the base image in order for libguestfs to correctly guess the OS, the FS structure etc.. Problem is that that point when I inspect the disk I get the whole disk state including the base image content (30K+ files and directories).<br><br></div>This is not an issue but it's a very heavy operation considering that some of the snapshots are few megabytes while the base images are several gigabytes.<br><br></div>Is there a way to programmatically instruct libguestfs to limit the inspection to the sole snapshot?<br></div>Would it work as well with other disk format (vmdk linked clones for example)?<br><br></div>For better comprehension I'll show the sequence I'm doing (I might do it wrong of course):<br><br>virsh -c "qemu:///system" snapshot-create --disk-only <domain-ID><br><br></div>I get the snapshot location from its XML description and then:<br><br>qemu-img convert -f qcow2 -O qcow2 base_image.qcow2 snapshot.qcow2<br><br></div>At that point I mount it through libguestfs and inspect its content.<br><br></div>Thank you.<br></div>