Skip to content

Commit 7c1b590

Browse files
committed
Add details about the batch-migrations
Signed-off-by: Jian Wang <[email protected]>
1 parent 1521aaa commit 7c1b590

File tree

4 files changed

+33
-5
lines changed

4 files changed

+33
-5
lines changed

docs/host/host.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ Because Harvester is built on top of Kubernetes and uses etcd as its database, t
2121

2222
## Node Maintenance
2323

24-
Admin users can enable Maintenance Mode (select **⋮ > Enable Maintenance Mode**) to automatically evict all virtual machines from a node. This mode leverages the **live migration** feature to migrate the virtual machines to other nodes, which is useful when you need to reboot, upgrade firmware, or replace hardware components. At least two active nodes are required to use this feature.
24+
Admin users can enable Maintenance Mode (select **⋮ > Enable Maintenance Mode**) to automatically evict all virtual machines from a node. This mode leverages the [batch-migrations](../vm/live-migration.md#automatically-triggered-batch-migrations) feature to migrate the [live-migratable virtual machines](../vm/live-migration.md#live-migratable-vms) to other nodes, which is useful when you need to reboot, upgrade firmware, or replace hardware components. At least two active nodes are required to use this feature.
2525

2626
Check if there are any [non-migratable VMs](../vm/live-migration.md#non-migratable-vms) and take essential actions.
2727

2828
:::warning
2929

3030
A [bug](https://github.com/harvester/harvester/issues/7128) may cause an I/O error to occur in virtual machines while Maintenance Mode is enabled on the underlying node. To mitigate the issue, you can set a taint on the node before enabling Maintenance Mode.
3131

32-
1. Set the taint on the target node.
32+
1. Set the taint on the target node. It triggers the [batch-migrations](../vm/live-migration.md#automatically-triggered-batch-migrations) automatically.
3333

3434
```sh
3535
kubectl taint node <NODE> --overwrite kubevirt.io/drain=draining:NoSchedule

docs/upgrade/automatic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ When a Rancher version reaches its End of Maintenance (EOM) date, Harvester only
8181

8282
### Live-migratable VMs
8383

84-
Those VMs are migrated to other nodes automatically when the hosting node is to be upgraded, they have zero down-time through the upgrade.
84+
Those [live-migratable VMs](../vm/live-migration.md#live-migratable-vms) are live migrated to other nodes automatically via [batch-migrations](../vm/live-migration.md#automatically-triggered-batch-migrations) when the hosting node is to be upgraded, they have zero down-time through the upgrade.
8585

8686
### Non-migratable VMs
8787

docs/vm/live-migration.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ description: Live migration means moving a virtual machine to a different host w
1515
<link rel="canonical" href="https://docs.harvesterhci.io/v1.5/vm/live-migration"/>
1616
</head>
1717

18-
Live migration means moving a virtual machine to a different host without downtime.
18+
Live migration means moving a virtual machine to a different host without downtime. A couple of comprehensive processes and tasks are done under the hood to fulfill the live migration.
19+
20+
The general requirements are:
21+
22+
- The cluster has at least one additional scheduable node which can meet all the scheduling rules of the VM besides the current host node.
23+
24+
- The destination node has enough spare resources to host the VM.
25+
26+
- The requested CPU, memory, [volumes](./create-vm.md#volumes), devices and other resources of the VM can be copied or rebuilt on the destination host while the source VM is still running.
1927

2028
## Non-migratable VMs
2129

@@ -49,6 +57,10 @@ Following conditions are checked on the runtime (e.g. before an upgrade) to mark
4957

5058
- Other [node scheduling](./create-vm.md#node-scheduling) rules.
5159

60+
## Live-migratable VMs
61+
62+
Besides `non-migratable VMs`, the rest of the running VMs are considered `live-migratable`.
63+
5264
## How Migration Works
5365

5466
Each node has multiple CPU models that are labeled with different keys.
@@ -100,10 +112,26 @@ When you have [node scheduling rules](./create-windows-vm.md#node-scheduling-tab
100112

101113
- The `Abort Migration` menu is available when the VM already has a running or pending migration process.
102114

103-
- Don't click `Abort Migration` if it is triggered by the [Harvester upgrade](../upgrade/automatic.md#live-migratable-vms) or [node maintenance](../host/host.md#node-maintenance).
115+
- Don't click `Abort Migration` if it is created by the [batch-migrations](#automatically-triggered-batch-migrations)
104116

105117
:::
106118

119+
## Automatically triggered batch-migrations
120+
121+
Both [Harvester upgrade](../upgrade/automatic.md#live-migratable-vms) and [node maintenance](../host/host.md#node-maintenance) benefit from the **Live Migration**, and the process is slightly different with above [Starting a Migration](#starting-a-migration). It is called `batch-migrations`.
122+
123+
The general process is:
124+
125+
1. The controller watchs a dedicated taint on the node object.
126+
127+
1. The controller creates a `virtualmachineinstancemigration` object for each [live-migratable VM](#live-migratable-vms) on the current node.
128+
129+
1. The migrations are queued, scheduled internally, and are process in batch mode. UI shows `Pending migration` or `Migrating` according to their status.
130+
131+
1. The controller monitors the processing and waits until all of them are done or time-out.
132+
133+
![batch-migrations](/img/v1.6/vm/batch-migrations.png)
134+
107135
## Migration Timeouts
108136

109137
### Completion Timeout

static/img/v1.6/batch-migrations.png

54.9 KB
Loading

0 commit comments

Comments
 (0)