A method for processing a virtual machine cluster, wherein the virtual machine cluster comprises N virtual machines, each virtual machine in the N virtual machines stores a virtual machine list and works as a first virtual machine in a peer-to-peer manner, the virtual machine list comprises information about the N virtual machines, and the method comprises: Sending, by the first virtual machine, a first heartbeat message to at least two neighboring virtual machines in the N virtual machines, so that the at least two neighboring virtual machines detect the first heartbeat message, wherein a result of detecting the first heartbeat message is used to determine a status of the first virtual machine, and the first virtual machine establishes a neighbor relationship with the at least two neighboring virtual machines according to the information about the N virtual machines; and Detecting, by the first virtual machine as a neighboring virtual machine of a second virtual machine in the at least two virtual machines, a second heartbeat message sent by the second virtual machine, wherein a result of detecting the second heartbeat message and a result of detecting, by another neighboring virtual machine of the second virtual machine, a heartbeat message sent by the second virtual machine are used to determine a status of the second virtual machine; wherein the at least two neighboring virtual machines of the first virtual machine are at least two virtual machines that are closest to a physical location of the first virtual machine and that do not belong to a same host and the at least two neighboring virtual machines of the second virtual machine are at least two virtual machines that are closest to a physical location of the second virtual machine and that do not belong to a same host. Sending, by the first virtual machine, a first heartbeat message to at least two neighboring virtual machines in the N virtual machines, so that the at least two neighboring virtual machines detect the first heartbeat message, wherein a result of detecting the first heartbeat message is used to determine a status of the first virtual machine, and the first virtual machine establishes a neighbor relationship with the at least two neighboring virtual machines according to the information about the N virtual machines; and Detecting, by the first virtual machine as a neighboring virtual machine of a second virtual machine in the at least two virtual machines, a second heartbeat message sent by the second virtual machine, wherein a result of detecting the second heartbeat message and a result of detecting, by another neighboring virtual machine of the second virtual machine, a heartbeat message sent by the second virtual machine are used to determine a status of the second virtual machine; wherein the at least two neighboring virtual machines of the first virtual machine are at least two virtual machines that are closest to a physical location of the first virtual machine and that do not belong to a same host and the at least two neighboring virtual machines of the second virtual machine are at least two virtual machines that are closest to a physical location of the second virtual machine and that do not belong to a same host.