主权项 |
1. A method for migrating a virtual machine between a source hypervisor and a target hypervisor that each support memory over commitment using one or more swap devices, the method comprising:
receiving, by the source hypervisor, a migration request that specifies a source instance of the virtual machine on the source hypervisor and the target hypervisor; identifying, by the source hypervisor, at least one swap device that is used by the source instance of the virtual machine and that is physically accessible by the target hypervisor; identifying, by the source hypervisor and for each identified swap device, one or more source swap slots that store at least one swapped out page of the source instance of the virtual machine; halting, by the source hypervisor, processing by the source instance of the virtual machine; granting, to the target hypervisor, access to the one or more source swap slots identified by the source hypervisor; associating, by the target hypervisor, a target instance of the virtual machine with a swap table that references the one or more swap slots granted to the target hypervisor; using, by the target hypervisor, the one or more swap slots to populate swapped out virtual memory for the target instance of virtual machine; and carrying out a cleanup of swap slots by:
copying, by a background process of the target hypervisor, a particular swapped slot from a shared swap device to another swap device owned by the target hypervisor;granting the particular swap slot to the source hypervisor;determining, by a particular hypervisor, that all swap slots stored on a particular shared swap device are assigned to the particular hypervisor; andrequesting, by the particular hypervisor, that a resource manager remove the particular shared swap device from a sharing table that contains information identifying shared swap devices and assignment of swap slots in said shared swap devices to hypervisors. |