On 04/30/2015 12:28 AM, NoxDaFox wrote:
Sorry for the lack of information, my bad.
Also, we tend to avoid top-posting on technical lists.
The snapshot is an internal one and the machine is running.
The whole thing was set-up by another person and left to me to cope with.
The typo is mine, as the machine is isolated I cannot actually copy-paste
it so have to do it in the traditional way.
I know the feeling :)
I am aware of the issue which come when changing HW but I couldn't do
otherwise.
I am only interested in reverting the disk's state. I guess qemu-img can
deal with it that but can libvirt as well?
qemu-img can be used to extract the internal snapshot disk state into a
standalone file. The problem is that reverting to an internal snapshot
is only possible if you provide a qemu command line compatible with when
the snapshot was taken, but qemu doesn't store that information itself.
So it is up to libvirt to store the information, but libvirt refuses to
allow changes to a snapshot where the guest ABI would be different, at
least if the snapshot was tied to a running guest state.
What puzzled me was the error output which is kinda misleading.
Yeah, I'm not sure why you got that particular error, but I'm worried
that what you are trying to do won't work through libvirt API, so you'll
end up having to do a backdoor approach anyways in order to revert to
the state but with a different guest hardware description.
Is it so that libvirt prevents editing snapshot configuration when running?
No, libvirt should allow snapshot edits regardless of current state and
regardless of the state captured in the snapshot, but only as long as
the edits don't change the guest ABI.
Is it due to the fact that the snapshots are internal?
You'd get the same restrictions on editing machine ABI on external
snapshots. It's just that external snapshots are a bit easier to
forcefully revert to by editing <domain> xml, rather than trying to
change the snapshot in place.
It may also be possible to capture the snapshot xml (virsh
snapshot-dumpxml $dom $name > $file'), then have libvirt forget about it
('virsh snapshot-delete --metadata $dom $name'), then edit the xml and
redefine the snapshot ('virsh snapshot-create --redefine $dom $file'),
where the redefined domain is not strictly ABI compatible, but where
libvirt no longer has the information on hand to reject the redefinition
as invalid.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org