Patent ID: 11886905
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 15:
16. An upgrade device comprising:
a memory configured to store program instructions; and
a processor coupled to the memory, wherein the program instructions cause the processor to be configured to:
select a first host from a plurality of hosts, wherein a plurality of first virtual machines on the hosts belongs to a plurality of first anti-affinity groups, wherein each of the first anti-affinity groups processes a first service, wherein different virtual machines in each of the first anti-affinity groups are deployed on different hosts, wherein second virtual machines deployed on the first host belong to one or more target anti-affinity groups in the first anti-affinity groups, wherein, for the second virtual machines, a total quantity of third virtual machines that belongs to each of the one or more target anti-affinity groups is not greater than a maximum shutdown quantity corresponding to a corresponding target anti-affinity group, wherein a maximum shutdown quantity corresponding to each of the first anti-affinity groups is a maximum quantity of fourth virtual machines that are allowed to be shut down in each of the first anti-affinity groups when the first service keeps running;
select a second host from the plurality of hosts, wherein fifth virtual machines deployed on the second host do not belong to the one or more target anti-affinity groups;
add the second host and the first host to an upgrade group;
stop a second service running sixth virtual machines that are in the one or more target anti-affinity groups and that are deployed on a third host in the upgrade group;
maintain a third service running on a seventh virtual machine that is in the one or more target anti-affinity groups and that is not deployed on the third host; and
upgrade the third host after the second service is stopped running on the sixth virtual machines and while the third service is maintained running on the seventh virtual machine.