$ bridge vlan add vid VLAN_ID dev DEV
Cross-cluster live migration requires that the clusters be connected in the same network. Specifically, virt-handler pods must be able to communicate.
The Bridge CNI plugin JSON configuration object describes the configuration parameters for the Bridge CNI plugin.
The following table details the configuration parameters:
| Field | Type | Description |
|---|---|---|
|
|
The CNI specification version. A minimum version of |
|
|
The mandatory, unique identifier assigned to this CNI network attachment definition. It is used by the container runtime to select the correct network configuration and serves as the key for persistent resource state management, such as IP address allocations. |
|
|
The name of the CNI plugin to configure: |
|
|
The configuration object for the IPAM CNI plugin. The plugin manages IP address assignment for the attachment definition. |
|
|
Optional: Specify the name of the virtual bridge to use. If the bridge interface does not exist on the host, the bridge interface gets created. The default value is |
|
|
Optional: Set to |
|
|
Optional: Controls the container interface ( |
|
|
Optional: Set to |
|
|
Optional: Set to |
|
|
Optional: Set to |
|
|
Optional: Set to |
|
|
Optional: Set to |
|
|
Optional: Specify a virtual LAN (VLAN) tag as an integer value. By default, no VLAN tag is assigned. |
|
|
Optional: Indicates whether the default VLAN must be preserved on the |
|
|
Optional: If |
|
|
Optional: Assign a VLAN trunk tag. The default value is |
|
|
Optional: Set the maximum transmission unit (MTU) to the specified value. The default value is automatically set by the kernel. |
|
|
Optional: Enables duplicate address detection for the container side |
|
|
Optional: Enables mac spoof check, limiting the traffic originating from the container to the mac address of the interface. The default value is |
|
The VLAN parameter configures the VLAN tag on the host end of the |
|
To configure an uplink for an L2 network, you must allow the VLAN on the uplink interface by using the following command:
|
Configure a dedicated secondary network for live migration to minimize the effects of network saturation on tenant workloads during live migration.
You installed the OpenShift CLI (oc).
You logged in to the cluster as a user with the cluster-admin role.
Each node has at least two Network Interface Cards (NICs).
The NICs for live migration are connected to the same VLAN.
You have configured a Linux bridge network.
Create a NetworkAttachmentDefinition manifest according to the following example:
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: my-secondary-network
namespace: kubevirt-hyperconverged
spec:
config: '{
"cniVersion": "0.3.1",
"name": "migration-bridge",
"type": "macvlan",
"master": "eth1",
"mode": "bridge",
"ipam": {
"type": "whereabouts",
"range": "10.200.5.0/24"
}
}'
metadata.name: Defines the name of the NetworkAttachmentDefinition object.
config.master: Defines the name of the NIC to be used for live migration.
config.type: Defines the name of the CNI plugin that provides the network for the NetworkAttachmentDefinition.
config.range: Defines an IP address range for the secondary network. This range must not overlap the IP addresses of the main network.
Open the HyperConverged CR in your default editor by running the following command:
$ oc edit hyperconvergeds.v1beta1.hco.kubevirt.io kubevirt-hyperconverged -n kubevirt-hyperconverged
Add the name of the NetworkAttachmentDefinition object to the spec.virtualization.liveMigrationConfig stanza of the HyperConverged CR.
Example HyperConverged manifest:
apiVersion: hco.kubevirt.io/v1
kind: HyperConverged
metadata:
name: kubevirt-hyperconverged
namespace: kubevirt-hyperconverged
spec:
virtualization:
liveMigrationConfig:
completionTimeoutPerGiB: 800
network: <network>
parallelMigrationsPerCluster: 5
parallelOutboundMigrationsPerNode: 2
progressTimeout: 150
# ...
spec.virtualization.liveMigrationConfig.network: Defines the name of the Multus NetworkAttachmentDefinition object to be used for live migrations.
Save your changes and exit the editor. The virt-handler pods restart and connect to the secondary network.
When the node that the virtual machine runs on is placed into maintenance mode, the VM automatically migrates to another node in the cluster. You can verify that the migration occurred over the secondary network and not the default pod network by checking the target IP address in the virtual machine instance (VMI) metadata.
$ oc get vmi <vmi_name> -o jsonpath='{.status.migrationState.targetNodeAddress}'