From 2a1be8528013467e6d3fdbf5f2933c45eda8f9b1 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sun, 23 Jun 2024 06:58:28 +0000 Subject: [PATCH 01/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index b9c39a089..bb8ab7fb6 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -246,7 +246,11 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. 4. Assign an IP address to OVS bridge br0. - If a DHCP server is available, set a dynamic IP address through the dhclient. - + + > ![](./public_sys-resources/icon-note.gif) **说明:** + > + > 若使用DHCP给br0设置动态IP,需先清除原有可能存在的动态IP。输入dhclient -r 命令,清除原有可能存在的动态IP。 + ```shell dhclient br0 ``` -- Gitee From 104f3d40a1e46abf8cd9964fe4545527170db033 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sun, 23 Jun 2024 07:09:57 +0000 Subject: [PATCH 02/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- .../Virtualization/environment-preparation.md | 303 +++++++++--------- 1 file changed, 160 insertions(+), 143 deletions(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index bb8ab7fb6..0bf6bb98f 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -1,59 +1,68 @@ -# Environment Preparation +# Preparing the environment for use -- [Environment Preparation](#environment-preparation) - - [Preparing a VM Image](#preparing-a-vm-image) - - [Preparing the VM Network](#preparing-the-vm-network) - - [Preparing Boot Firmware](#preparing-boot-firmware) - -## Preparing a VM Image +## Prepare VM image ### Overview -A VM image is a file that contains a virtual disk that has been installed and can be used to start the OS. VM images are in different formats, such as raw and qcow2. Compared with the raw format, the qcow2 format occupies less space and supports features such as snapshot, copy-on-write, AES encryption, and zlib compression. However, the performance of the qcow2 format is slightly lower than that of the raw format. The qemu-img tool is used to create image files. This section uses the qcow2 image file as an example to describe how to create a VM image. +The virtual machine image is a file that contains the virtual disks that +have been installed and can start the operating system. Virtual machine +images have different formats. The common formats are raw format and qcow2 +format. Compared with raw format image, The qcow2 format image occupies +less space and supports snapshots Copy On Write, AES encryption Zlib +compression and other features, but its performance is slightly inferior +to the raw format image. The creation of the image file uses the qemu img +tool. This section takes the qcow2 format image file as an example to +introduce the creation process of the virtual machine image. -### Creating an Image +### Make a mirror image -To create a qcow2 image file, perform the following steps: +The operation steps for creating a qcow2 format image file are as follows: -1. Install the **qemu-img** software package. +1. Use the root user to install the qemu img software package. - ```shell - yum install -y qemu-img + ```sh + # yum install -y qemu-img ``` -2. Run the **create** command of the qemu-img tool to create an image file. The command format is as follows: +2. Use the create command of the qemu img tool to create an image file. +The command format is: - ```shell + ```sh qemu-img create -f -o ``` - The parameters are described as follows: + where the meaning of each parameter is as follows. + + - _imgFormat_:image format, the value is raw, Qcow2, etc. + - _fileOption_: File option, used to set the characteristics of the image file, such as specifying the back-end image file,compression,encryption and other characteristics. + - _fileName_:File name. + - _diskSize_:disk size, used to specify the size of a disk device.The supported units are K M、G、T, KiB MiB、GiB、TiB。 - - _imgFormat_: Image format. The value can be **raw** or **qcow2**. - - _fileOption_: File option, which is used to set features of an image file, such as specifying a backend image file, compression, and encryption. - - _fileName_: File name. - - _diskSize_: Disk size, which specifies the size of a block disk. The unit can be K, M, G, or T, indicating KiB, MiB, GiB, or TiB. + For example, create an image file openEuler-image. qcow2 with a disk device size of 4GB and a format of qcow2. The command and echo are as +follows: - For example, to create an image file openEuler-image.qcow2 whose disk size is 4 GB and format is qcow2, the command and output are as follows: - ```shell + ```sh $ qemu-img create -f qcow2 openEuler-image.qcow2 4G Formatting 'openEuler-image.qcow2', fmt=qcow2 size=4294967296 cluster_size=65536 lazy_refcounts=off refcount_bits=16 ``` -### Changing the Image Disk Space +### Modify the size of the mirrored disk space -If a VM requires larger disk space, you can use the qemu-img tool to change the disk space of the VM image. The method is as follows: +When the virtual machine needs more disk space, you can use the qemu img +tool to modify the size of the virtual machine image disk space. The +modification method is as follows. -1. Run the following command to query the disk space of the VM image: - ```shell - qemu-img info +1. Query the current virtual machine image disk space size, the command +is as follows. + ```sh + qemu-img info ``` - For example, if the command and output for querying the disk space of the openEuler-image.qcow2 image are as follows, the disk space of the image is 4 GiB. + For example, the command to query the space size of the openEuler-image. qcow2 image disk is echoed as follows, indicating that the space size of the image disk is 4GiB. - ```shell + ```sh $ qemu-img info openEuler-image.qcow2 image: openEuler-image.qcow2 file format: qcow2 @@ -67,28 +76,30 @@ If a VM requires larger disk space, you can use the qemu-img tool to change the corrupt: false ``` -2. Run the following command to change the image disk space. In the command, _imgFileName_ indicates the image name, and **+** and **-** indicate the image disk space to be increased and decreased, respectively. The unit is KB, MB, GB, and T, indicating KiB, MiB, GiB, and TiB, respectively. +2. Modify the size of the image disk space. The command is as follows, where _imgFiLeName_ is the image name, and "+" and "-" respectively indicate the size of the image disk space that needs to be increased or decreased. The units are K M、G、T, On behalf of KiB MiB、GiB、TiB。 + - ```shell - qemu-img resize [+|-] + ```sh + qemu-img resize [+|-] ``` - For example, to expand the disk space of the openEuler-image.qcow2 image to 24 GiB, that is, to add 20 GiB to the original 4 GiB, the command and output are as follows: + For example, expand the size of the above openEuler-image. qcow2 image disk space to 24GiB, that is, add 20GiB to the original 4GiB. The command and echo are as follows: - ```shell + ```sh $ qemu-img resize openEuler-image.qcow2 +20G Image resized. ``` -3. Run the following command to check whether the image disk space is changed successfully: +3. Query the size of the mirrored disk space after modification to confirm whether the modification is successful, the command is as follows. - ```shell - qemu-img info + ```sh + qemu-img info ``` - For example, if the openEuler-image.qcow2 image disk space has been expanded to 24 GiB, the command and output are as follows: + For example, the above openEuler-image. qcow2 image disk space has been expanded to 24GiB. The command and echo are as follows: - ```shell + + ```sh $ qemu-img info openEuler-image.qcow2 image: openEuler-image.qcow2 file format: qcow2 @@ -102,85 +113,94 @@ If a VM requires larger disk space, you can use the qemu-img tool to change the corrupt: false ``` -## Preparing the VM Network +## Prepare the VM network ### Overview +In order to enable the virtual machine to communicate with the external network, the network environment needs to be configured for the virtual machine.KVM virtualization supports Linux bridge、Open vSwitch bridge and other types of bridges.As shown in [Figure 1](#fig1785384714917).the +data transmission path is "virtual machine ->virtual network interface device ->Linux bridge or Open vSwitch bridge->physical network interface". To create a bridge, in addition to configuring virtual network card devices for virtual machines, creating a bridge for hosts is the key to connecting virtual machine networks. -To enable the VM to communicate with external networks, you need to configure the network environment for the VM. KVM virtualization supports multiple types of bridges, such as Linux bridge and Open vSwitch bridge. As shown in [Figure 1](#fig1785384714917), the data transmission path is **VM \> virtual NIC device \> Linux bridge or Open vSwitch bridge \> physical NIC**. In addition to configuring virtual NICs \(vNICs\) for VMs, creating a bridge for a host is the key to connecting to a virtualized network. +This section gives the method of building Linux bridge and Open vSwitch bridge, so that the virtual machine can be connected to the network. The user can choose the type of bridge to build according to the situation. -This section describes how to set up a Linux bridge and an Open vSwitch bridge to connect a VM to the network. You can select a bridge type based on the site requirements. -**Figure 1** Virtual network structure -![](./figures/virtual-network-structure.png "virtual-network-structure") +**Figure 1 ** Virtual Network Structure Diagram +![](./figures/virtual-network-structure.png) -### Setting Up a Linux Bridge +### Build Linux bridge -The following describes how to bind the physical NIC eth0 to the Linux bridge br0. +Taking the operation of physical network card eth0 binding to Linux bridge br0 as an example, use the root user to execute the following command to +build a Linux bridge: -1. Install the **bridge-utils** software package. +1. Install the bridge utils software package. - The Linux bridge is managed by the brctl tool. The corresponding installation package is bridge-utils. The installation command is as follows: + The Linux bridge is usually managed through the brctl tool. The corresponding installation package is bridge utils. The installation command is as follows: - ```shell - yum install -y bridge-utils + ```sh + # yum install -y bridge-utils ``` -2. Create bridge br0. +2. Create the bridge br0. - ```shell - brctl addbr br0 + ```sh + # brctl addbr br0 ``` -3. Bind the physical NIC eth0 to the Linux bridge. +3. Bind the physical network card eth0 to the Linux bridge. - ```shell - brctl addif br0 eth0 + ```sh + # brctl addif br0 eth0 ``` -4. After eth0 is connected to the bridge, the IP address of eth0 is set to 0.0.0.0. +4. After eth0 is connected to the bridge, the IP address is no longer needed. Install the net tools software package and set the IP address of eth0 to +0.0.0.0. - ```shell - ifconfig eth0 0.0.0.0 + ```sh + # yum install -y net-tools + # ifconfig eth0 0.0.0.0 ``` 5. Set the IP address of br0. - - If a DHCP server is available, set a dynamic IP address through the dhclient. + -If you have a DHCP server, you can set a dynamic IP address through dhclient. + - ```shell - dhclient br0 + ```sh + # dhclient br0 ``` - - If no DHCP server is available, configure a static IP address for br0. For example, set the static IP address to 192.168.1.2 and subnet mask to 255.255.255.0. + -If there is no DHCP server, configure a static IP for br0. For example, set the static IP to 192.168. 1.2 and the subnet mask to 255.255.255.0. + - ```shell - ifconfig br0 192.168.1.2 netmask 255.255.255.0 + ```sh + # ifconfig br0 192.168.1.2 netmask 255.255.255.0 ``` -### Setting Up an Open vSwitch Bridge +### Build an Open vSwitch bridge -The Open vSwitch bridge provides more convenient automatic orchestration capabilities. This section describes how to install network virtualization components to set up an Open vSwitch bridge. +Open vSwitch bridge, with more convenient automatic editing capability. To build an Open vSwitch bridge, you need to install network virtualization components. Here is the overall operation. -**1. Install the Open vSwitch component.** +#### I.Install the Open vSwitch component. -If the Open vSwitch is used to provide virtual network, you need to install the Open vSwitch network virtualization component. +If you use Open vSwitch to provide virtual network, you need to install the Open vSwitch network virtualization component, and use the root user to execute the following command: -1. Install the Open vSwitch component. +1. Install the Open vSwitch component. - ```shell - yum install -y openvswitch + ```sh + # yum install -y openvswitch ``` -2. Start the Open vSwitch service. +2. Load the Open vSwitch module into the kernel. - ```shell - systemctl start openvswitch + ```sh + # systemctl start openvswitch ``` -**2. Check whether the installation is successful.** +#### II.Confirmation of successful installation -1. Check whether the openvswitch component is successfully installed. If the installation is successful, the software package information is displayed. The command and output are as follows: +Confirm whether the Open vSwitch component is successfully installed. - ```shell +1. Confirm whether the openvswitch component is successfully installed. If the installation is successful, you can see the information about the software package. The commands and echoes are as follows: + + + ```sh $ rpm -qi openvswitch Name : openvswitch Version : 2.11.1 @@ -204,9 +224,10 @@ If the Open vSwitch is used to provide virtual network, you need to install the traffic. ``` -2. Check whether the Open vSwitch service is started successfully. If the service is in the **Active** state, the service is started successfully. You can use the command line tool provided by the Open vSwitch. The command and output are as follows: +2. Check whether the Open vSwitch service is started successfully. If the service is in "Active" status, it indicates that the service is successfully started. You can normally use the command line tool provided by Open vSwitch. The command and echo are as follows: + - ```shell + ```sh $ systemctl status openvswitch ● openvswitch.service - LSB: Open vSwitch switch Loaded: loaded (/etc/rc.d/init.d/openvswitch; generated) @@ -222,80 +243,76 @@ If the Open vSwitch is used to provide virtual network, you need to install the └─54603 ovs-vswitchd unix:/var/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --mlockall --no-chdir --log-file=/var/log/openvswitch/ovs-vswitchd.log --pidfile=/var/run/open> ``` -**3. Set up an Open vSwitch bridge** +#### III.Build an Open vSwitch bridge -The following describes how to set up an Open vSwitch layer-1 bridge br0. +Taking the creation of the Open vSwitch Layer 1 bridge br0 as an example, this paper introduces the building method, and uses the root user to execute the following commands: -1. Create the Open vSwitch bridge br0. +1. Create an Open vSwitch bridgebr0. - ```shell - ovs-vsctl add-br br0 + ```sh + # ovs-vsctl add-br br0 ``` -2. Add the physical NIC eth0 to br0. +2. Create an Open vSwitch bridgebr0. - ```shell - ovs-vsctl add-port br0 eth0 + ```sh + # ovs-vsctl add-port br0 eth0 ``` -3. After eth0 is connected to the bridge, the IP address of eth0 is set to 0.0.0.0. +3. After eth0 is connected to the bridge, the IP address is no longer needed.Set the IP address of eth0 to 0.0.0.0. - ```shell - ifconfig eth0 0.0.0.0 + ```sh + # ifconfig eth0 0.0.0.0 ``` -4. Assign an IP address to OVS bridge br0. - - If a DHCP server is available, set a dynamic IP address through the dhclient. - - > ![](./public_sys-resources/icon-note.gif) **说明:** - > - > 若使用DHCP给br0设置动态IP,需先清除原有可能存在的动态IP。输入dhclient -r 命令,清除原有可能存在的动态IP。 - - ```shell - dhclient br0 +4. Assign an IP address to the OVS bridge br0. + -If you have a DHCP server, you can set a dynamic IP address through dhclient. + + ```sh + # dhclient br0 ``` - - If no DHCP server is available, configure a static IP address for br0, for example, 192.168.1.2. + -If there is no DHCP server, configure a static IP address for br0, such as 192.168.1.2. - ```shell - ifconfig br0 192.168.1.2 + ```sh + # ifconfig br0 192.168.1.2 ``` -## Preparing Boot Firmware +## Preparing to boot the firmware -### Overview +### Preparing to boot the firmware -The boot mode varies depending on the architecture. x86 servers support the Unified Extensible Firmware Interface \(UEFI\) and BIOS boot modes, and AArch64 servers support only the UEFI boot mode. By default, boot files corresponding to the BIOS mode have been installed on openEuler. No additional operations are required. This section describes how to install boot files corresponding to the UEFI mode. +The guidance methods are different for different architectures. X86 supports UEFI (Unified Extensible Firmware Interface) and BIOS mode startup, AArch64 only supports UEFI mode startup. By default, openEuler has installed the boot file corresponding to BIOS startup, and no additional user operation is required. Therefore, only the installation method of UEFI startup mode is introduced here. -The Unified Extensible Firmware Interface \(UEFI\) is a new interface standard used for power-on auto check and OS boot. It is an alternative to the traditional BIOS. EDK II is a set of open source code that implements the UEFI standard. In virtualization scenarios, the EDK II tool set is used to start a VM in UEFI mode. Before using the EDK II tool, you need to install the corresponding software package before starting a VM. This section describes how to install the EDK II tool. +The unified extensible firmware interface (UEFI) is a new type of interface standard, which is used for POST and booting the operating system. It is an alternative to the traditional BIOS. EDK II is a set of open source code that implements the UEFI standard. In virtualization scenarios, the virtual machine is usually started through UEFI using the EDK II toolset. To use the EDK II tool, you need to install the corresponding software package before starting the virtual machine. This section describes the installation method of EDK II. -### Installation Methods +### Installation method -If the UEFI mode is used, the tool set EDK II needs to be installed. The installation package for the AArch64 architecture is **edk2-aarch64**, and that for the x86 architecture is **edk2-ovmf**. This section uses the AArch64 architecture as an example to describe the installation method. For the x86 architecture, you only need to replace **edk2-aarch64** with **edk2-ovmf**. +If you use UEFI mode to boot, you need to install the tool set EDK II, The installation package corresponding to AArch64 architecture is edk2-aarch64, The installation package corresponding to x86 architecture is edk2-ovmf. Taking the AArch64 architecture as an example, the specific installation method is given here, The x86 architecture only needs to replace edk2-aarch64 with edk2-ovmf. -1. Run the following command to install the **edk** software package: +1. Install the edk software package, and use the root user to execute the following commands: - In the AArch64 architecture, the **edk2** package name is **edk2-aarch64**. + The package name of edk2 under AArch64 architecture is edk2-aarch64 - ```shell - yum install -y edk2-aarch64 + ```sh + # yum install -y edk2-aarch64 ``` - In the x86\_64 architecture, the **edk2** package name is **edk2-ovmf**. + The package name of edk2 under x86\_64 architecture is edk2-ovmf - ```shell - yum install -y edk2-ovmf + ```sh + # yum install -y edk2-ovmf ``` -2. Run the following command to check whether the **edk** software package is successfully installed: +2. Query whether the edk software is successfully installed. The command is as follows: - In the AArch64 architecture, the command is as follows: + Query under AArch64 architecture as follows - ```shell + ```sh rpm -qi edk2-aarch64 ``` - If information similar to the following is displayed, the **edk** software package is successfully installed: + If the edk software is successfully installed, the echo is similar to the following: ```text Name : edk2-aarch64 @@ -306,13 +323,13 @@ If the UEFI mode is used, the tool set EDK II needs to be installed. The install Group : Applications/Emulators ``` - In the x86\_64 architecture, the command is as follows: + uery under x86\_64 architecture as follows - ```shell - rpm -qi edk2-ovmf + ```sh + # rpm -qi edk2-ovmf ``` - If information similar to the following is displayed, the **edk** software package is successfully installed: + If the edk software is successfully installed, the echo is similar to the following: ```text Name : edk2-ovmf @@ -322,50 +339,50 @@ If the UEFI mode is used, the tool set EDK II needs to be installed. The install Install Date: Thu 19 Mar 2020 09:09:06 AM CST ``` -## Configuring a Non-root User +## Non root user configuration ### Overview -openEuler virtualization uses virsh to manage VMs. If you want to use the virsh commands to manage VMs as a non-root user, you need to perform related configurations before using the commands. This section provides the configuration guide. +OpenEuler virtualization uses virsh to manage virtual machines. If you want to use the virsh command to manage the virtual machine for non root users, you need to configure it before using it. Here are the configuration instructions. -### Operation Guide +### Operating instructions -To allow a non-root user to run the virsh commands to manage VMs, perform the following operations (replace **userName** in the following commands with the actual non-root user name): +The configuration operations for allowing non root users to use the virsh command to manage virtual machines are as follows. Please change the userName in the following commands to the actual non root user name: -1. Log in to the host as the **root** user. +1. Log in to the host as root. -2. Add the non-root user to the libvirt user group. +2. Add the non root user to the libvirt user group. - ```shell - usermod -a -G libvirt userName + ```sh + # usermod -a -G libvirt userName ``` -3. Switch to the non-root user. +3. Switch to a non root user. - ```shell - su userName + ```sh + # su userName ``` -4. Configure environment variables for the non-root user. Run the **vim** command to open the ~/.bashrc file: +4. Configure environment variables for non root users. Use vim to open the~/.bashrc file: - ```shell + ```sh vim ~/.bashrc ``` - Add the following content to the end of the file and save the file: + and save it after adding the following at the end. - ```shell + ```sh export LIBVIRT_DEFAULT_URI="qemu:///system" ``` - Run the following command for the configuration to take effect: + Execute the following command to make the configuration effective. - ```shell + ```sh source ~/.bashrc ``` -5. Add the following content to the domain root element in the XML configuration file of the VM so that the qemu-kvm process can access the disk image files. +5. Add the following content to the domain root element in the XML configuration file of the virtual machine, so that the qemu_kvm process can access the disk image file. ```xml - ``` + ``` \ No newline at end of file -- Gitee From 42b3be9f30e0099c5e18c8c31aa3b4e2ed34ccd5 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sun, 23 Jun 2024 07:16:42 +0000 Subject: [PATCH 03/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index 0bf6bb98f..f9752b1d4 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -267,6 +267,10 @@ Taking the creation of the Open vSwitch Layer 1 bridge br0 as an example, this p 4. Assign an IP address to the OVS bridge br0. -If you have a DHCP server, you can set a dynamic IP address through dhclient. + + > ![](./public_sys-resources/icon-note.gif) **illustrate:** + > + > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. ```sh # dhclient br0 -- Gitee From fb272df946ae01e524fc3a823d33f061b1a6c05d Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sun, 23 Jun 2024 07:20:12 +0000 Subject: [PATCH 04/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index f9752b1d4..0accfbdac 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -268,10 +268,6 @@ Taking the creation of the Open vSwitch Layer 1 bridge br0 as an example, this p 4. Assign an IP address to the OVS bridge br0. -If you have a DHCP server, you can set a dynamic IP address through dhclient. - > ![](./public_sys-resources/icon-note.gif) **illustrate:** - > - > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. - ```sh # dhclient br0 ``` -- Gitee From 2be97e1ce767b7123e5f0296f18c50c8821abd14 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sun, 23 Jun 2024 07:25:57 +0000 Subject: [PATCH 05/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index 0accfbdac..0bf6bb98f 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -267,7 +267,7 @@ Taking the creation of the Open vSwitch Layer 1 bridge br0 as an example, this p 4. Assign an IP address to the OVS bridge br0. -If you have a DHCP server, you can set a dynamic IP address through dhclient. - + ```sh # dhclient br0 ``` -- Gitee From 165d2428662be27f44942d60c7c83f0cba1b6320 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Wed, 10 Jul 2024 04:23:53 +0000 Subject: [PATCH 06/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index 0bf6bb98f..7a6de1ffd 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -268,6 +268,10 @@ Taking the creation of the Open vSwitch Layer 1 bridge br0 as an example, this p 4. Assign an IP address to the OVS bridge br0. -If you have a DHCP server, you can set a dynamic IP address through dhclient. + > ![](./public_sys-resources/icon-note.gif) **illustrate:** + > + > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. + ```sh # dhclient br0 ``` -- Gitee From 934920be815c1d93abffb1a68d7150fac61b4dfe Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Wed, 10 Jul 2024 04:28:30 +0000 Subject: [PATCH 07/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index 7a6de1ffd..dce675830 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -266,12 +266,13 @@ Taking the creation of the Open vSwitch Layer 1 bridge br0 as an example, this p ``` 4. Assign an IP address to the OVS bridge br0. - -If you have a DHCP server, you can set a dynamic IP address through dhclient. > ![](./public_sys-resources/icon-note.gif) **illustrate:** > > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. - + + -If you have a DHCP server, you can set a dynamic IP address through dhclient. + ```sh # dhclient br0 ``` -- Gitee From f0e207a0003034921a6a245e51c5b656caab5d9e Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Fri, 21 Mar 2025 09:17:31 +0000 Subject: [PATCH 08/26] update docs/en/docs/Virtualization/environment-preparation.md. translation Signed-off-by: Rover Wang <1308533838@qq.com> --- .../Virtualization/environment-preparation.md | 297 ++++++++---------- 1 file changed, 137 insertions(+), 160 deletions(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index dce675830..4df18bbfe 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -1,68 +1,59 @@ -# Preparing the environment for use +# Environment Preparation -## Prepare VM image +- [Environment Preparation](#environment-preparation) + - [Preparing a VM Image](#preparing-a-vm-image) + - [Preparing the VM Network](#preparing-the-vm-network) + - [Preparing Boot Firmware](#preparing-boot-firmware) + +## Preparing a VM Image ### Overview -The virtual machine image is a file that contains the virtual disks that -have been installed and can start the operating system. Virtual machine -images have different formats. The common formats are raw format and qcow2 -format. Compared with raw format image, The qcow2 format image occupies -less space and supports snapshots Copy On Write, AES encryption Zlib -compression and other features, but its performance is slightly inferior -to the raw format image. The creation of the image file uses the qemu img -tool. This section takes the qcow2 format image file as an example to -introduce the creation process of the virtual machine image. +A VM image is a file that contains a virtual disk that has been installed and can be used to start the OS. VM images are in different formats, such as raw and qcow2. Compared with the raw format, the qcow2 format occupies less space and supports features such as snapshot, copy-on-write, AES encryption, and zlib compression. However, the performance of the qcow2 format is slightly lower than that of the raw format. The qemu-img tool is used to create image files. This section uses the qcow2 image file as an example to describe how to create a VM image. -### Make a mirror image +### Creating an Image -The operation steps for creating a qcow2 format image file are as follows: +To create a qcow2 image file, perform the following steps: -1. Use the root user to install the qemu img software package. +1. Install the **qemu-img** software package. - ```sh - # yum install -y qemu-img + ```shell + yum install -y qemu-img ``` -2. Use the create command of the qemu img tool to create an image file. -The command format is: +2. Run the **create** command of the qemu-img tool to create an image file. The command format is as follows: - ```sh + ```shell qemu-img create -f -o ``` - where the meaning of each parameter is as follows. - - - _imgFormat_:image format, the value is raw, Qcow2, etc. - - _fileOption_: File option, used to set the characteristics of the image file, such as specifying the back-end image file,compression,encryption and other characteristics. - - _fileName_:File name. - - _diskSize_:disk size, used to specify the size of a disk device.The supported units are K M、G、T, KiB MiB、GiB、TiB。 + The parameters are described as follows: - For example, create an image file openEuler-image. qcow2 with a disk device size of 4GB and a format of qcow2. The command and echo are as -follows: + - _imgFormat_: Image format. The value can be **raw** or **qcow2**. + - _fileOption_: File option, which is used to set features of an image file, such as specifying a backend image file, compression, and encryption. + - _fileName_: File name. + - _diskSize_: Disk size, which specifies the size of a block disk. The unit can be K, M, G, or T, indicating KiB, MiB, GiB, or TiB. + For example, to create an image file openEuler-image.qcow2 whose disk size is 4 GB and format is qcow2, the command and output are as follows: - ```sh + ```shell $ qemu-img create -f qcow2 openEuler-image.qcow2 4G Formatting 'openEuler-image.qcow2', fmt=qcow2 size=4294967296 cluster_size=65536 lazy_refcounts=off refcount_bits=16 ``` -### Modify the size of the mirrored disk space +### Changing the Image Disk Space -When the virtual machine needs more disk space, you can use the qemu img -tool to modify the size of the virtual machine image disk space. The -modification method is as follows. +If a VM requires larger disk space, you can use the qemu-img tool to change the disk space of the VM image. The method is as follows: +1. Run the following command to query the disk space of the VM image: -1. Query the current virtual machine image disk space size, the command -is as follows. - ```sh - qemu-img info + ```shell + qemu-img info ``` - For example, the command to query the space size of the openEuler-image. qcow2 image disk is echoed as follows, indicating that the space size of the image disk is 4GiB. + For example, if the command and output for querying the disk space of the openEuler-image.qcow2 image are as follows, the disk space of the image is 4 GiB. - ```sh + ```shell $ qemu-img info openEuler-image.qcow2 image: openEuler-image.qcow2 file format: qcow2 @@ -76,30 +67,28 @@ is as follows. corrupt: false ``` -2. Modify the size of the image disk space. The command is as follows, where _imgFiLeName_ is the image name, and "+" and "-" respectively indicate the size of the image disk space that needs to be increased or decreased. The units are K M、G、T, On behalf of KiB MiB、GiB、TiB。 - +2. Run the following command to change the image disk space. In the command, _imgFileName_ indicates the image name, and **+** and **-** indicate the image disk space to be increased and decreased, respectively. The unit is KB, MB, GB, and T, indicating KiB, MiB, GiB, and TiB, respectively. - ```sh - qemu-img resize [+|-] + ```shell + qemu-img resize [+|-] ``` - For example, expand the size of the above openEuler-image. qcow2 image disk space to 24GiB, that is, add 20GiB to the original 4GiB. The command and echo are as follows: + For example, to expand the disk space of the openEuler-image.qcow2 image to 24 GiB, that is, to add 20 GiB to the original 4 GiB, the command and output are as follows: - ```sh + ```shell $ qemu-img resize openEuler-image.qcow2 +20G Image resized. ``` -3. Query the size of the mirrored disk space after modification to confirm whether the modification is successful, the command is as follows. +3. Run the following command to check whether the image disk space is changed successfully: - ```sh - qemu-img info + ```shell + qemu-img info ``` - For example, the above openEuler-image. qcow2 image disk space has been expanded to 24GiB. The command and echo are as follows: + For example, if the openEuler-image.qcow2 image disk space has been expanded to 24 GiB, the command and output are as follows: - - ```sh + ```shell $ qemu-img info openEuler-image.qcow2 image: openEuler-image.qcow2 file format: qcow2 @@ -113,94 +102,85 @@ is as follows. corrupt: false ``` -## Prepare the VM network +## Preparing the VM Network ### Overview -In order to enable the virtual machine to communicate with the external network, the network environment needs to be configured for the virtual machine.KVM virtualization supports Linux bridge、Open vSwitch bridge and other types of bridges.As shown in [Figure 1](#fig1785384714917).the -data transmission path is "virtual machine ->virtual network interface device ->Linux bridge or Open vSwitch bridge->physical network interface". To create a bridge, in addition to configuring virtual network card devices for virtual machines, creating a bridge for hosts is the key to connecting virtual machine networks. -This section gives the method of building Linux bridge and Open vSwitch bridge, so that the virtual machine can be connected to the network. The user can choose the type of bridge to build according to the situation. +To enable the VM to communicate with external networks, you need to configure the network environment for the VM. KVM virtualization supports multiple types of bridges, such as Linux bridge and Open vSwitch bridge. As shown in [Figure 1](#fig1785384714917), the data transmission path is **VM \> virtual NIC device \> Linux bridge or Open vSwitch bridge \> physical NIC**. In addition to configuring virtual NICs \(vNICs\) for VMs, creating a bridge for a host is the key to connecting to a virtualized network. +This section describes how to set up a Linux bridge and an Open vSwitch bridge to connect a VM to the network. You can select a bridge type based on the site requirements. -**Figure 1 ** Virtual Network Structure Diagram -![](./figures/virtual-network-structure.png) +**Figure 1** Virtual network structure +![](./figures/virtual-network-structure.png "virtual-network-structure") -### Build Linux bridge +### Setting Up a Linux Bridge -Taking the operation of physical network card eth0 binding to Linux bridge br0 as an example, use the root user to execute the following command to -build a Linux bridge: +The following describes how to bind the physical NIC eth0 to the Linux bridge br0. -1. Install the bridge utils software package. +1. Install the **bridge-utils** software package. - The Linux bridge is usually managed through the brctl tool. The corresponding installation package is bridge utils. The installation command is as follows: + The Linux bridge is managed by the brctl tool. The corresponding installation package is bridge-utils. The installation command is as follows: - ```sh - # yum install -y bridge-utils + ```shell + yum install -y bridge-utils ``` -2. Create the bridge br0. +2. Create bridge br0. - ```sh - # brctl addbr br0 + ```shell + brctl addbr br0 ``` -3. Bind the physical network card eth0 to the Linux bridge. +3. Bind the physical NIC eth0 to the Linux bridge. - ```sh - # brctl addif br0 eth0 + ```shell + brctl addif br0 eth0 ``` -4. After eth0 is connected to the bridge, the IP address is no longer needed. Install the net tools software package and set the IP address of eth0 to -0.0.0.0. +4. After eth0 is connected to the bridge, the IP address of eth0 is set to 0.0.0.0. - ```sh - # yum install -y net-tools - # ifconfig eth0 0.0.0.0 + ```shell + ifconfig eth0 0.0.0.0 ``` 5. Set the IP address of br0. - -If you have a DHCP server, you can set a dynamic IP address through dhclient. - + - If a DHCP server is available, set a dynamic IP address through the dhclient. - ```sh - # dhclient br0 + ```shell + dhclient br0 ``` - -If there is no DHCP server, configure a static IP for br0. For example, set the static IP to 192.168. 1.2 and the subnet mask to 255.255.255.0. - + - If no DHCP server is available, configure a static IP address for br0. For example, set the static IP address to 192.168.1.2 and subnet mask to 255.255.255.0. - ```sh - # ifconfig br0 192.168.1.2 netmask 255.255.255.0 + ```shell + ifconfig br0 192.168.1.2 netmask 255.255.255.0 ``` -### Build an Open vSwitch bridge +### Setting Up an Open vSwitch Bridge -Open vSwitch bridge, with more convenient automatic editing capability. To build an Open vSwitch bridge, you need to install network virtualization components. Here is the overall operation. +The Open vSwitch bridge provides more convenient automatic orchestration capabilities. This section describes how to install network virtualization components to set up an Open vSwitch bridge. -#### I.Install the Open vSwitch component. +**1. Install the Open vSwitch component.** -If you use Open vSwitch to provide virtual network, you need to install the Open vSwitch network virtualization component, and use the root user to execute the following command: +If the Open vSwitch is used to provide virtual network, you need to install the Open vSwitch network virtualization component. -1. Install the Open vSwitch component. +1. Install the Open vSwitch component. - ```sh - # yum install -y openvswitch + ```shell + yum install -y openvswitch ``` -2. Load the Open vSwitch module into the kernel. +2. Start the Open vSwitch service. - ```sh - # systemctl start openvswitch + ```shell + systemctl start openvswitch ``` -#### II.Confirmation of successful installation +**2. Check whether the installation is successful.** -Confirm whether the Open vSwitch component is successfully installed. +1. Check whether the openvswitch component is successfully installed. If the installation is successful, the software package information is displayed. The command and output are as follows: -1. Confirm whether the openvswitch component is successfully installed. If the installation is successful, you can see the information about the software package. The commands and echoes are as follows: - - - ```sh + ```shell $ rpm -qi openvswitch Name : openvswitch Version : 2.11.1 @@ -224,10 +204,9 @@ Confirm whether the Open vSwitch component is successfully installed. traffic. ``` -2. Check whether the Open vSwitch service is started successfully. If the service is in "Active" status, it indicates that the service is successfully started. You can normally use the command line tool provided by Open vSwitch. The command and echo are as follows: - +2. Check whether the Open vSwitch service is started successfully. If the service is in the **Active** state, the service is started successfully. You can use the command line tool provided by the Open vSwitch. The command and output are as follows: - ```sh + ```shell $ systemctl status openvswitch ● openvswitch.service - LSB: Open vSwitch switch Loaded: loaded (/etc/rc.d/init.d/openvswitch; generated) @@ -243,81 +222,79 @@ Confirm whether the Open vSwitch component is successfully installed. └─54603 ovs-vswitchd unix:/var/run/openvswitch/db.sock -vconsole:emer -vsyslog:err -vfile:info --mlockall --no-chdir --log-file=/var/log/openvswitch/ovs-vswitchd.log --pidfile=/var/run/open> ``` -#### III.Build an Open vSwitch bridge +**3. Set up an Open vSwitch bridge** -Taking the creation of the Open vSwitch Layer 1 bridge br0 as an example, this paper introduces the building method, and uses the root user to execute the following commands: +The following describes how to set up an Open vSwitch layer-1 bridge br0. -1. Create an Open vSwitch bridgebr0. +1. Create the Open vSwitch bridge br0. - ```sh - # ovs-vsctl add-br br0 + ```shell + ovs-vsctl add-br br0 ``` -2. Create an Open vSwitch bridgebr0. +2. Add the physical NIC eth0 to br0. - ```sh - # ovs-vsctl add-port br0 eth0 + ```shell + ovs-vsctl add-port br0 eth0 ``` -3. After eth0 is connected to the bridge, the IP address is no longer needed.Set the IP address of eth0 to 0.0.0.0. +3. After eth0 is connected to the bridge, the IP address of eth0 is set to 0.0.0.0. - ```sh - # ifconfig eth0 0.0.0.0 + ```shell + ifconfig eth0 0.0.0.0 ``` -4. Assign an IP address to the OVS bridge br0. - +4. Assign an IP address to OVS bridge br0. + - If a DHCP server is available, set a dynamic IP address through the dhclient. > ![](./public_sys-resources/icon-note.gif) **illustrate:** > > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. - -If you have a DHCP server, you can set a dynamic IP address through dhclient. - - ```sh - # dhclient br0 + ```shell + dhclient br0 ``` - -If there is no DHCP server, configure a static IP address for br0, such as 192.168.1.2. + - If no DHCP server is available, configure a static IP address for br0, for example, 192.168.1.2. - ```sh - # ifconfig br0 192.168.1.2 + ```shell + ifconfig br0 192.168.1.2 ``` -## Preparing to boot the firmware +## Preparing Boot Firmware -### Preparing to boot the firmware +### Overview -The guidance methods are different for different architectures. X86 supports UEFI (Unified Extensible Firmware Interface) and BIOS mode startup, AArch64 only supports UEFI mode startup. By default, openEuler has installed the boot file corresponding to BIOS startup, and no additional user operation is required. Therefore, only the installation method of UEFI startup mode is introduced here. +The boot mode varies depending on the architecture. x86 servers support the Unified Extensible Firmware Interface \(UEFI\) and BIOS boot modes, and AArch64 servers support only the UEFI boot mode. By default, boot files corresponding to the BIOS mode have been installed on openEuler. No additional operations are required. This section describes how to install boot files corresponding to the UEFI mode. -The unified extensible firmware interface (UEFI) is a new type of interface standard, which is used for POST and booting the operating system. It is an alternative to the traditional BIOS. EDK II is a set of open source code that implements the UEFI standard. In virtualization scenarios, the virtual machine is usually started through UEFI using the EDK II toolset. To use the EDK II tool, you need to install the corresponding software package before starting the virtual machine. This section describes the installation method of EDK II. +The Unified Extensible Firmware Interface \(UEFI\) is a new interface standard used for power-on auto check and OS boot. It is an alternative to the traditional BIOS. EDK II is a set of open source code that implements the UEFI standard. In virtualization scenarios, the EDK II tool set is used to start a VM in UEFI mode. Before using the EDK II tool, you need to install the corresponding software package before starting a VM. This section describes how to install the EDK II tool. -### Installation method +### Installation Methods -If you use UEFI mode to boot, you need to install the tool set EDK II, The installation package corresponding to AArch64 architecture is edk2-aarch64, The installation package corresponding to x86 architecture is edk2-ovmf. Taking the AArch64 architecture as an example, the specific installation method is given here, The x86 architecture only needs to replace edk2-aarch64 with edk2-ovmf. +If the UEFI mode is used, the tool set EDK II needs to be installed. The installation package for the AArch64 architecture is **edk2-aarch64**, and that for the x86 architecture is **edk2-ovmf**. This section uses the AArch64 architecture as an example to describe the installation method. For the x86 architecture, you only need to replace **edk2-aarch64** with **edk2-ovmf**. -1. Install the edk software package, and use the root user to execute the following commands: +1. Run the following command to install the **edk** software package: - The package name of edk2 under AArch64 architecture is edk2-aarch64 + In the AArch64 architecture, the **edk2** package name is **edk2-aarch64**. - ```sh - # yum install -y edk2-aarch64 + ```shell + yum install -y edk2-aarch64 ``` - The package name of edk2 under x86\_64 architecture is edk2-ovmf + In the x86\_64 architecture, the **edk2** package name is **edk2-ovmf**. - ```sh - # yum install -y edk2-ovmf + ```shell + yum install -y edk2-ovmf ``` -2. Query whether the edk software is successfully installed. The command is as follows: +2. Run the following command to check whether the **edk** software package is successfully installed: - Query under AArch64 architecture as follows + In the AArch64 architecture, the command is as follows: - ```sh + ```shell rpm -qi edk2-aarch64 ``` - If the edk software is successfully installed, the echo is similar to the following: + If information similar to the following is displayed, the **edk** software package is successfully installed: ```text Name : edk2-aarch64 @@ -328,13 +305,13 @@ If you use UEFI mode to boot, you need to install the tool set EDK II, The insta Group : Applications/Emulators ``` - uery under x86\_64 architecture as follows + In the x86\_64 architecture, the command is as follows: - ```sh - # rpm -qi edk2-ovmf + ```shell + rpm -qi edk2-ovmf ``` - If the edk software is successfully installed, the echo is similar to the following: + If information similar to the following is displayed, the **edk** software package is successfully installed: ```text Name : edk2-ovmf @@ -344,49 +321,49 @@ If you use UEFI mode to boot, you need to install the tool set EDK II, The insta Install Date: Thu 19 Mar 2020 09:09:06 AM CST ``` -## Non root user configuration +## Configuring a Non-root User ### Overview -OpenEuler virtualization uses virsh to manage virtual machines. If you want to use the virsh command to manage the virtual machine for non root users, you need to configure it before using it. Here are the configuration instructions. +openEuler virtualization uses virsh to manage VMs. If you want to use the virsh commands to manage VMs as a non-root user, you need to perform related configurations before using the commands. This section provides the configuration guide. -### Operating instructions +### Operation Guide -The configuration operations for allowing non root users to use the virsh command to manage virtual machines are as follows. Please change the userName in the following commands to the actual non root user name: +To allow a non-root user to run the virsh commands to manage VMs, perform the following operations (replace **userName** in the following commands with the actual non-root user name): -1. Log in to the host as root. +1. Log in to the host as the **root** user. -2. Add the non root user to the libvirt user group. +2. Add the non-root user to the libvirt user group. - ```sh - # usermod -a -G libvirt userName + ```shell + usermod -a -G libvirt userName ``` -3. Switch to a non root user. +3. Switch to the non-root user. - ```sh - # su userName + ```shell + su userName ``` -4. Configure environment variables for non root users. Use vim to open the~/.bashrc file: +4. Configure environment variables for the non-root user. Run the **vim** command to open the ~/.bashrc file: - ```sh + ```shell vim ~/.bashrc ``` - and save it after adding the following at the end. + Add the following content to the end of the file and save the file: - ```sh + ```shell export LIBVIRT_DEFAULT_URI="qemu:///system" ``` - Execute the following command to make the configuration effective. + Run the following command for the configuration to take effect: - ```sh + ```shell source ~/.bashrc ``` -5. Add the following content to the domain root element in the XML configuration file of the virtual machine, so that the qemu_kvm process can access the disk image file. +5. Add the following content to the domain root element in the XML configuration file of the VM so that the qemu-kvm process can access the disk image files. ```xml -- Gitee From ac417058648064cfb1df6d2d7de01f7abb6efcd6 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Fri, 21 Mar 2025 09:18:56 +0000 Subject: [PATCH 09/26] update docs/en/docs/Virtualization/environment-preparation.md. translation Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index 4df18bbfe..ff57a7952 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -245,11 +245,10 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. ``` 4. Assign an IP address to OVS bridge br0. - - If a DHCP server is available, set a dynamic IP address through the dhclient. > ![](./public_sys-resources/icon-note.gif) **illustrate:** > > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. - + - If a DHCP server is available, set a dynamic IP address through the dhclient. ```shell dhclient br0 ``` -- Gitee From ee368d3087ac45a4206308af19ecaf5bde769a7f Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Fri, 21 Mar 2025 09:28:32 +0000 Subject: [PATCH 10/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index ff57a7952..7112f15b4 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -248,7 +248,9 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. > ![](./public_sys-resources/icon-note.gif) **illustrate:** > > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. + - If a DHCP server is available, set a dynamic IP address through the dhclient. + ```shell dhclient br0 ``` -- Gitee From c4fc5e8cf95b5f59da77ce4d27de7451a0e68769 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Fri, 21 Mar 2025 09:39:37 +0000 Subject: [PATCH 11/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index 7112f15b4..00be4b8d8 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -248,9 +248,9 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. > ![](./public_sys-resources/icon-note.gif) **illustrate:** > > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. - + - If a DHCP server is available, set a dynamic IP address through the dhclient. - + ```shell dhclient br0 ``` -- Gitee From a3ab95dd9512960bdffaf4a1a2e0011b18a68476 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Fri, 21 Mar 2025 09:44:34 +0000 Subject: [PATCH 12/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index 00be4b8d8..709189530 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -245,12 +245,11 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. ``` 4. Assign an IP address to OVS bridge br0. + - If a DHCP server is available, set a dynamic IP address through the dhclient. > ![](./public_sys-resources/icon-note.gif) **illustrate:** > > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. - - - If a DHCP server is available, set a dynamic IP address through the dhclient. - + ```shell dhclient br0 ``` -- Gitee From 648cf382a19a1f71bc77f9f32f5ecfb9e1898a51 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Fri, 21 Mar 2025 10:47:23 +0000 Subject: [PATCH 13/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index 709189530..cc79edae3 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -245,11 +245,13 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. ``` 4. Assign an IP address to OVS bridge br0. - - If a DHCP server is available, set a dynamic IP address through the dhclient. + > ![](./public_sys-resources/icon-note.gif) **illustrate:** > > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. - + + - If a DHCP server is available, set a dynamic IP address through the dhclient. + ```shell dhclient br0 ``` @@ -367,4 +369,4 @@ To allow a non-root user to run the virsh commands to manage VMs, perform the fo ```xml - ``` \ No newline at end of file + ``` -- Gitee From f0aef64431d16fc6e6f33d9e598e017fb981a4d1 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sat, 22 Mar 2025 04:56:32 +0000 Subject: [PATCH 14/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index cc79edae3..9dda94ff1 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -246,7 +246,7 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. 4. Assign an IP address to OVS bridge br0. - > ![](./public_sys-resources/icon-note.gif) **illustrate:** + > ![](docs/en/docs/Virtualization/public_sys-resources/icon-note.gif) **illustrate:** > > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. -- Gitee From a58ce4d98010c119ba18be5abb4d6545ceab8359 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sat, 22 Mar 2025 05:04:55 +0000 Subject: [PATCH 15/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index 9dda94ff1..cc79edae3 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -246,7 +246,7 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. 4. Assign an IP address to OVS bridge br0. - > ![](docs/en/docs/Virtualization/public_sys-resources/icon-note.gif) **illustrate:** + > ![](./public_sys-resources/icon-note.gif) **illustrate:** > > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. -- Gitee From 1c1d9167bda4c9920687a50deea23925286b04c8 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sat, 22 Mar 2025 05:13:10 +0000 Subject: [PATCH 16/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index cc79edae3..dab053d60 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -111,7 +111,7 @@ To enable the VM to communicate with external networks, you need to configure th This section describes how to set up a Linux bridge and an Open vSwitch bridge to connect a VM to the network. You can select a bridge type based on the site requirements. **Figure 1** Virtual network structure -![](./figures/virtual-network-structure.png "virtual-network-structure") +![](./figures/virtual-network-structure.png ) ### Setting Up a Linux Bridge -- Gitee From f1610c8ed8b3086f52a0a3c84aca6c93837bbcc6 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sat, 22 Mar 2025 05:22:21 +0000 Subject: [PATCH 17/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index dab053d60..35678a93c 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -110,8 +110,7 @@ To enable the VM to communicate with external networks, you need to configure th This section describes how to set up a Linux bridge and an Open vSwitch bridge to connect a VM to the network. You can select a bridge type based on the site requirements. -**Figure 1** Virtual network structure -![](./figures/virtual-network-structure.png ) +![](./figures/virtual-network-structure.png "virtual-network-structure") ### Setting Up a Linux Bridge -- Gitee From 3952c91c151413a2d58c3f956571372055cea7b4 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sat, 22 Mar 2025 05:28:24 +0000 Subject: [PATCH 18/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index 35678a93c..b9c39a089 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -110,7 +110,8 @@ To enable the VM to communicate with external networks, you need to configure th This section describes how to set up a Linux bridge and an Open vSwitch bridge to connect a VM to the network. You can select a bridge type based on the site requirements. -![](./figures/virtual-network-structure.png "virtual-network-structure") +**Figure 1** Virtual network structure +![](./figures/virtual-network-structure.png "virtual-network-structure") ### Setting Up a Linux Bridge @@ -244,11 +245,6 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. ``` 4. Assign an IP address to OVS bridge br0. - - > ![](./public_sys-resources/icon-note.gif) **illustrate:** - > - > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. - - If a DHCP server is available, set a dynamic IP address through the dhclient. ```shell -- Gitee From 9e5879adeef37de703c30579b9d171de2e7a40b8 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sat, 22 Mar 2025 05:34:55 +0000 Subject: [PATCH 19/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index b9c39a089..cc79edae3 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -245,6 +245,11 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. ``` 4. Assign an IP address to OVS bridge br0. + + > ![](./public_sys-resources/icon-note.gif) **illustrate:** + > + > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. + - If a DHCP server is available, set a dynamic IP address through the dhclient. ```shell -- Gitee From 7835fd34579d9c02f866851fb44e4fb3096a1cce Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sat, 22 Mar 2025 05:44:17 +0000 Subject: [PATCH 20/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index cc79edae3..b9c39a089 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -245,11 +245,6 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. ``` 4. Assign an IP address to OVS bridge br0. - - > ![](./public_sys-resources/icon-note.gif) **illustrate:** - > - > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. - - If a DHCP server is available, set a dynamic IP address through the dhclient. ```shell -- Gitee From 04a167ee705500dd3f6dd7b6629dcde1b3172c57 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sat, 22 Mar 2025 05:48:42 +0000 Subject: [PATCH 21/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index b9c39a089..e2675fb11 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -251,6 +251,10 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. dhclient br0 ``` + > ![](./public_sys-resources/icon-note.gif) **illustrate:** + > + > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. + - If no DHCP server is available, configure a static IP address for br0, for example, 192.168.1.2. ```shell -- Gitee From dc1f7da876f30504c04bfb3395a75b794ef1480c Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sat, 22 Mar 2025 05:52:17 +0000 Subject: [PATCH 22/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index e2675fb11..fa6df50c8 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -251,7 +251,7 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. dhclient br0 ``` - > ![](./public_sys-resources/icon-note.gif) **illustrate:** + > **illustrate:** > > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. -- Gitee From d36720a1cc714bf47f2c8cfa0f1e1af42913905e Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sat, 22 Mar 2025 05:59:06 +0000 Subject: [PATCH 23/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index fa6df50c8..2d643d0c7 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -251,8 +251,6 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. dhclient br0 ``` - > **illustrate:** - > > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. - If no DHCP server is available, configure a static IP address for br0, for example, 192.168.1.2. -- Gitee From 9808ddc7fd6b9eb82c8c1981ba4b26e2fab794f8 Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sat, 22 Mar 2025 06:09:15 +0000 Subject: [PATCH 24/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index 2d643d0c7..885868e6a 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -251,7 +251,7 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. dhclient br0 ``` - > If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. + If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. - If no DHCP server is available, configure a static IP address for br0, for example, 192.168.1.2. -- Gitee From 49a13cb2ad0905fcffc578a20854358f322e334b Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sat, 22 Mar 2025 06:15:04 +0000 Subject: [PATCH 25/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index 885868e6a..b96669540 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -251,7 +251,7 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. dhclient br0 ``` - If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. + - If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. - If no DHCP server is available, configure a static IP address for br0, for example, 192.168.1.2. -- Gitee From 48a9be693f4d4a6bb57bda04be4f604d4cc9f79e Mon Sep 17 00:00:00 2001 From: Rover Wang <1308533838@qq.com> Date: Sat, 22 Mar 2025 06:19:30 +0000 Subject: [PATCH 26/26] update docs/en/docs/Virtualization/environment-preparation.md. Signed-off-by: Rover Wang <1308533838@qq.com> --- docs/en/docs/Virtualization/environment-preparation.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/en/docs/Virtualization/environment-preparation.md b/docs/en/docs/Virtualization/environment-preparation.md index b96669540..b9c39a089 100644 --- a/docs/en/docs/Virtualization/environment-preparation.md +++ b/docs/en/docs/Virtualization/environment-preparation.md @@ -251,8 +251,6 @@ The following describes how to set up an Open vSwitch layer-1 bridge br0. dhclient br0 ``` - - If you use DHCP to set a dynamic IP address for br0, you need to clear the existing dynamic IP address. Run the dhclient -r command to clear the possible dynamic IP addresses. - - If no DHCP server is available, configure a static IP address for br0, for example, 192.168.1.2. ```shell -- Gitee