0

So, I have two guests which I can easily snapshot but suppose a guest sends a packet to another guest and the packet is in transit while we take the snapshot of both guests.

How can I also snapshot this packet in transit from guest 1 to guest 2 in QEMU/KVM.

Any help would be greatly appreciated.

1 Answers1

0

No such thing exists. If you take snapshots properly, you need to quiesce the guest first, that should ensure there is no in-flight IO, neither to the disks nor to the NICs

dyasny
  • 18,802
  • 6
  • 49
  • 64
  • But what if a packet is already in transit. Will that be lost? – Douglas Turner Aug 18 '16 at 15:03
  • it should get to the destination, the ACK might get lost. If it's fragmented, then the frames in progress will be lost, and a restored VM might attempt a retransmission. In any case, I've never seen this as a concern, in almost 10 years specializing in virtualization – dyasny Aug 18 '16 at 17:32
  • Thanks a lot for the reply. So, if we just quiesce the guest, take the snapshot and later restore it, We won't have any problem with any networking state. Right? – Douglas Turner Aug 18 '16 at 17:34
  • No. If you take a memory state snapshot though, you might run into problems with software that gets confused by the sudden changes in time. I always recommend sticking to normal disk backups, and flat images with no snapshots. Makes things more stable and performs much much better – dyasny Aug 18 '16 at 17:43
  • But taking the disc snapshot won't save any running computation being done in memory. How will I be able to solve that problem then. Taking memory snapshots preserve the computation state as well e.g a program printing numbers from 1 to 100 can be at 50 but if memory snapshot is not created, we can't resume it back from 50. – Douglas Turner Aug 18 '16 at 17:45
  • Yes, but this isn't really what backups are for. Quiescing is done primarily to avoid losing in-flight IOs, but actual data being processes by the CPU isn't supposed to be saved anyway. Normally, when a process is done with some data, it will write it to disk, database or send it to another process, for additional work, there's rarely any point in saving such half-baked data. You quiesce in order to make sure data that has been sent to the disk actually gets stored and backed up, but this is it. Do you have a realistic use case for this at all? – dyasny Aug 18 '16 at 18:04
  • Yes, its a research project and we have to snapshot multiple VM's but their computation and network state should also be captured and restored in some way. Do you know of any other way since you've spent so much time with this field. – Douglas Turner Aug 18 '16 at 18:22
  • A research project? Well, for networking you could use promiscous mode for the networking interface and store the sent and received packets. In any case, this has nothing to do with real world virtualization, and is very far from being a realistic use case – dyasny Aug 18 '16 at 18:29
  • One more question Sir. It would be nice if you can answer. If we take disc snapshots, we can never resume any running program. We cannot even start it from the beginning. The restored system will be a static system with no program running. Right? – Douglas Turner Aug 19 '16 at 11:39
  • Yes, it will be as if a server crashed and you are restarting it, with all the data on disk intact – dyasny Aug 19 '16 at 14:44