Page MenuHomeFreeBSD
Feed Advanced Search

Jun 20 2023

darius.mihaim_gmail.com added a comment to D34718: Warm Migration feature for bhyve [Part 2].

We consider that the migration part is a must-have feature for a mature hypervisor and we really want to have it for bhyve. The end goal is to have a live migration feature for bhyve. It means inspecting the guest memory pages to check for changes between rounds. It also modifies a dirty bit. The inspection (and changes) should be done from within the bhyve process. I'm not sure how this part should be tackled in your suggestion. However, please keep in mind that this approach was discussed with the bhyve's maintainers 4 years ago. We asked for advice and came up with this idea of having a custom dirty bit for migration.

I don't see any problem with that. I will open review with possibility to get diff pages.

So instead of having a lot code in bhyve, I would suggest to have portion of primitives that can help to implement warm, live migration outside of bhyve process.

Jun 20 2023, 8:38 PM · bhyve
darius.mihaim_gmail.com added a comment to D34718: Warm Migration feature for bhyve [Part 2].

The *live* migration must be part of bhyve, as the migration process must transfer the virtual machine's memory from one host to the other while the virtual machine runs on the original host.

Of course, some changes to the migration code are unavoidable in case the snapshot process changes in some particular ways, but they should remain minimal in my expectations.

I believe that migration code can be outside of bhyve process even with warm or live migration. Really, suppose to have bmigrate process written in C, shell, python (high level language):

a. bhyve dumps diff-pages to a file1.
b. bmigrate sends data to host2 or just places on shared storage
c. bmigrate calls bhyve to suspend without memory.
d. bmigrate sends suspended data to host2. and restore memory 1-st iteration on host2.
e. bmigrate calls vmm to dump diff-pages to file2.
f. bmigrate sends diff-pages to host2 and restore 2-st iteration.
g. bmigrate restore process on host2.

This is rough idea, but it should work w/o adding a lot of code to bhyve.

The same is for warm migration. Why this code should be in bhyve? All states, cpus, etc. could be tracked outside of bhyve.

Jun 20 2023, 6:17 PM · bhyve
darius.mihaim_gmail.com added a comment to D34718: Warm Migration feature for bhyve [Part 2].

I think we should bring support for snapshots first. And enable BHYVE_SNAPSHOT by default.

To do this, it remains to agree on the snapshot format: https://lists.freebsd.org/archives/freebsd-virtualization/2023-May/001295.html

I'm not sure whether to tie the transfer of the memory dump to the TCP.

Or add an opportunity similar to 'zfs send' to be independent of transport. For example, share a memory image using SSH or NFS.

Not sure how the transfer would be *tied* to the TCP protocol just by having the implementation use TCP by default. Many tools like curl, socat and browsers have figured out that you can use URIs to specify protocols and even authentication when connecting to a service. The migration parameters can be extended to use ssh://, file:/// or even the basic - for piping the binary data to standard output.

I think asking this question more than one year after this review has been open, and more than two after the original review (https://reviews.freebsd.org/D28270) was created is simply meant to delay accepting the changes. I understand that having a good and secure code base is a must, but this change simply asks for "why don't we over engineer this part which has very little to do with the actual virtual machine migration process?", without actually providing a good case for "this is not up to the BSD standards".

I had review (D35590) that was opened about a year. This is fix for current snapshot implementation. We are talking about two things:

  1. Why this feature cannot be done outside of bhyve?
  2. Who will do fixing if this migration review(s) becomes committed?

I suppose, both questions should answered before committing those changes. Because even without this migration additions, current snapshot implementation still has a lot of bugs and, I believe, they should be fixed first before add new functionality for snapshot/resume.

Jun 20 2023, 5:33 PM · bhyve
darius.mihaim_gmail.com added a comment to D34718: Warm Migration feature for bhyve [Part 2].

I think we should bring support for snapshots first. And enable BHYVE_SNAPSHOT by default.

To do this, it remains to agree on the snapshot format: https://lists.freebsd.org/archives/freebsd-virtualization/2023-May/001295.html

I'm not sure whether to tie the transfer of the memory dump to the TCP.

Or add an opportunity similar to 'zfs send' to be independent of transport. For example, share a memory image using SSH or NFS.

Jun 20 2023, 5:04 PM · bhyve

Oct 14 2020

darius.mihaim_gmail.com added a comment to D26264: bhyve: 'xhci,tablet' snapshot fixes.

@darius.mihaim_gmail.com Is this review good for you ?

Oct 14 2020, 10:02 AM · bhyve

Sep 22 2020

darius.mihaim_gmail.com added inline comments to D26387: bhyve - Snapshot Save and Restore multiple devices.
Sep 22 2020, 10:58 AM · bhyve

Sep 3 2020

darius.mihaim_gmail.com added a comment to D26268: bhyve: snapshot virtio queues can fail.

Is the issue specific to virtio-rnd, or why does it appear? I'm wondering why it was not caught earlier.

Sep 3 2020, 6:58 PM · bhyve
darius.mihaim_gmail.com added a comment to D26263: bhyve: Fix build with option BHYVE_SNAPSHOT.

This one seems pretty straight-forward.

Sep 3 2020, 6:53 PM · bhyve
darius.mihaim_gmail.com added inline comments to D26267: bhyve: snapshot impovements for 'blockif' backend.
Sep 3 2020, 6:45 PM · bhyve

Mar 20 2020

darius.mihaim_gmail.com updated the diff for D19495: bhyve - Snapshot Save and Restore.

Rebase the code with SVN R359133 / git 217fa09bf639260f4fe7c9415d8f42b141637d51.

Mar 20 2020, 6:55 PM · bhyve

Oct 18 2019

darius.mihaim_gmail.com updated the diff for D19495: bhyve - Snapshot Save and Restore.

Add license and copyrights to snapshot specific files (snapshot.[ch], vmm_snapshot[ch]).

Oct 18 2019, 6:49 AM · bhyve

Oct 7 2019

darius.mihaim_gmail.com updated the summary of D19495: bhyve - Snapshot Save and Restore.
Oct 7 2019, 1:24 PM · bhyve
darius.mihaim_gmail.com updated the diff for D19495: bhyve - Snapshot Save and Restore.
  • Added compilation flag(s) to use as experimental functionality (BHYVE_SNAPSHOT) thanks to @jhb
  • Rebase with freebsd/freebsd updated master branch, on 4th of October 2019. Refs: git: e96b4170d024f41e9f178394a77006f39aaf6610 SVN: r353039
Oct 7 2019, 1:16 PM · bhyve

Aug 1 2019

darius.mihaim_gmail.com added inline comments to D19495: bhyve - Snapshot Save and Restore.
Aug 1 2019, 3:11 PM · bhyve
darius.mihaim_gmail.com added a comment to D19495: bhyve - Snapshot Save and Restore.
  • integrate updated vCPU pause mechanism from @jhb that uses the VM debug components.
  • separate BSP vCPU initialization from other vCPUs (do not initialize all vCPUs before starting the VM when not restoring; do not automatically grant UNRESTRICTED_GUEST capabilities to BSP)
  • fix various coding errors, such as removing unused macros, using proper buffer size for snprintf and coding style
Aug 1 2019, 2:46 PM · bhyve

Jul 10 2019

darius.mihaim_gmail.com added a comment to D19495: bhyve - Snapshot Save and Restore.
  • kick the guest threads out of vmrun when starting the pausing vCPUs.
  • remove host registers from intel/vmx.c snapshot process (AMD registers have not been removed yet).
Jul 10 2019, 1:47 PM · bhyve

Jun 27 2019

darius.mihaim_gmail.com added inline comments to D19495: bhyve - Snapshot Save and Restore.
Jun 27 2019, 12:34 PM · bhyve
darius.mihaim_gmail.com added a comment to D19495: bhyve - Snapshot Save and Restore.

Remove some irrelevant comments and unused functions

Jun 27 2019, 12:32 PM · bhyve

Jun 26 2019

darius.mihaim_gmail.com added a comment to D19495: bhyve - Snapshot Save and Restore.

I have applied the feedback @jhb gave, except for the #ifdef guards. Will work on it after rebasing with a newer master.

Jun 26 2019, 10:21 AM · bhyve
darius.mihaim_gmail.com added a comment to D19495: bhyve - Snapshot Save and Restore.
  • rework vCPU pausing and resuming mechanism
  • rewrite VM suspend procedure - do not resume VM and devices before exit
  • add missing break clause in vmm_dev switch-case
  • various minor coding style fixes pointed by @jhb
  • remove unnecessary critical section nesting level check
Jun 26 2019, 9:59 AM · bhyve

Jun 10 2019

darius.mihaim_gmail.com updated the summary of D19495: bhyve - Snapshot Save and Restore.
Jun 10 2019, 6:58 PM · bhyve

Jun 5 2019

darius.mihaim_gmail.com updated the diff for D19495: bhyve - Snapshot Save and Restore.

Remove debug printfs from pci_ahci.c

Jun 5 2019, 3:28 PM · bhyve
darius.mihaim_gmail.com updated the diff for D19495: bhyve - Snapshot Save and Restore.

Remove vLAPIC fields from snapshot procedure, if they are not required after a restore / can be computed from other fields.
Save vLAPIC's LAPIC page as part of vLAPIC snapshot procedure, instead of a separate data structure.
Rename variables / functions / macros used to snapshot guest to host memory mappings to make them more intuitive.

Jun 5 2019, 12:02 PM · bhyve

May 20 2019

darius.mihaim_gmail.com updated the diff for D19495: bhyve - Snapshot Save and Restore.

Add minor fixes to snapshot logic:

  • correct variable used as parameter for 'sizeof' in vatpic.c (the size was correct before, by coincidence)
  • remove a comment that became irrelevant in the past in vhpet.c
  • fix vLAPIC timer reset logic in the off-chance the timer would be periodic and a value of 0 is saved for the counter
May 20 2019, 7:59 AM · bhyve

Apr 9 2019

darius.mihaim_gmail.com added a comment to D19495: bhyve - Snapshot Save and Restore.

This is a very useful feature, thanks for working on that!

Apr 9 2019, 7:50 AM · bhyve

Mar 29 2019

darius.mihaim_gmail.com updated the diff for D19495: bhyve - Snapshot Save and Restore.

Remove some unused code and fix style of comments

Mar 29 2019, 9:03 AM · bhyve

Mar 15 2019

darius.mihaim_gmail.com updated the diff for D19495: bhyve - Snapshot Save and Restore.
  • remove guest memory mapping device that is currently unused. The device was used to make snapshots faster by creating a separate Copy-on-Write mapping of the guest memory. This approach is not useful for guest suspends, and we may be able to avoid exporting it through a device even for snapshots (will be investigating that approach).
  • remove some unused code
Mar 15 2019, 9:16 AM · bhyve

Mar 10 2019

darius.mihaim_gmail.com added inline comments to D19495: bhyve - Snapshot Save and Restore.
Mar 10 2019, 10:52 AM · bhyve
darius.mihaim_gmail.com updated the diff for D19495: bhyve - Snapshot Save and Restore.

Fix issues pointed by inline comments

Mar 10 2019, 10:47 AM · bhyve

Mar 8 2019

darius.mihaim_gmail.com updated the test plan for D19495: bhyve - Snapshot Save and Restore.
Mar 8 2019, 10:20 AM · bhyve
darius.mihaim_gmail.com added inline comments to D19495: bhyve - Snapshot Save and Restore.
Mar 8 2019, 9:57 AM · bhyve

Mar 7 2019

darius.mihaim_gmail.com created D19495: bhyve - Snapshot Save and Restore.
Mar 7 2019, 4:56 PM · bhyve