- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
01-Text | 1.21 MB |
Establishing Layer 2 connectivity between a VM and an external device
Establishing Layer 3 connectivity between a VM and an external device
Setting up the deployment environment
Connecting the management host and the converged gateway
Configuring management IP addresses
Selecting a VM deployment method
Selecting an automatic deployment procedure
Automatically deploying a VM from the CLI
CLI-based automatic deployment procedure
Installing the .pkg file to deploy the VM
Installing the guest OS and configuring the network settings
Automatically deploying a VM from a USB flash drive
Manual VM deployment procedure
Identifying the file system format of the converged gateway
Importing the guest OS image file
Configuring VM network settings
Configuring the vTap NIC of a VM
Configuring the SR-IOV NIC of a VM
Creating a .pkg VM file for automatic deployment
Connecting the management host to the source converged gateway
Preparing the source VM for .pkg file creation
Creating a .pkg VM file for CLI-based automatic deployment
Exporting the source VM as a .pkg VM file to a hard disk drive
Transferring the .pkg VM file to the destination converged gateway
Exporting the VM as a .pkg file for USB-based automatic VM deployment
Display and maintenance commands for VM management
Introduction
This document guides you to deploy virtual machines (VMs) on the H3C MSR3610-I-DP and MSR 3610-IE-DP ICT converged gateways.
The converged gateways support the following VM operations:
· Creating, deleting, or maintaining VM resources from the CLI.
· Installing and debugging the operating systems of VMs (guest OSs) from their Web GUI through VNC Viewer.
· Configuring the VMs to provide services.
Supported vNICs
The VMs on an ICT converged gateway communicate with the converged gateway and connect to the network through vNICs. vNICs include vTap NICs and single-root I/O virtualization (SR-IOV) NICs.
· A vTap NIC provides software-based forwarding. It is slower than an SR-IOV NIC. However, you do not need to install any driver for the vTap NICs. A vTap NIC communicates with the converged gateway through VM-Ethernet interfaces VMEth 0/9 through VMEth 0/16.
· An SR-IOV NIC provides hardware-based forwarding. It forwards traffic at higher speeds than vTap NICs. A converged gateway provides one SR-IOV NIC, which connects to internal Layer 2 Ethernet interface GigibitEthernet 0/8 on the converged gateway.
A VM must use a vTap NIC when it first connects to the network. Then, you can configure SR-IOV vNICs to provide high-speed data forwarding for VMs.
Figure 1 shows the interfaces on an ICT converged gateway.
Figure 1 ICT converged gateway interface network diagram
VM networking
You can assign VMs on a converged gateway to the same VLAN or different VLANs. VMs in the same VLAN can communicate with each other directly. VMs in different VLANs communicate with each other through their respective gateways.
A VM can communicate with an external device in bridged mode at Layer 2 or in routed mode at Layer 3 depending on your networking method.
Establishing Layer 2 connectivity between a VM and an external device
To enable a VM to communicate with an external device at Layer 2:
1. Connect the external device to a Layer 2 Ethernet interface on the converged gateway.
2. Add this interface to the same VLAN as the vNIC.
3. Assign the vNIC an IP address in the same subnet as the external device.
As shown in Figure 2, the external device is connected to GigabitEthernet 0/6 on the converged gateway and the interface is added to VLAN 2.
Figure 2 Network setup for Layer 2 connectivity
Establishing Layer 3 connectivity between a VM and an external device
To enable a VM to communicate with an external device in different subnets, establish Layer 3 connectivity between them as follows:
1. Assign the vNIC of the VM to a VLAN, create the VLAN interface, and assign an IP address to the VLAN interface.
2. Assign an IP address to the vNIC of the VM. Make sure that IP address is on the same subnet as the IP address of the VLAN interface.
3. Set the default gateway of the VM to the IP address of the VLAN interface on the converged gateway.
Then, a client can access the VM as along as it has a route to the subnet.
Figure 3 shows a sample network setup for Layer 3 connectivity.
Figure 3 Network setup for Layer 3 connectivity
VM deployment methods
The ICT converged gateways support the following VM deployment methods:
· Automatic VM deployment.
· Manual VM deployment.
Automatic VM deployment
Automatic VM deployment enables you to bulk-deploy VMs by using a .pkg VM file.
A .pkg file contains all files that make up a VM. All VMs created from a .pkg file have the same parameter settings as the source VM, including their guest OS, CPU and memory settings.
Depending on the storage medium used to store the .pkg VM file, the following automatic deployment methods are available:
· CLI-based automatic VM deployment—If you store the .pkg file on a disk of the converged gateway, use this method to deploy the VM from the CLI of the converged gateway.
· USB-based automatic VM deployment—If you store the .pkg file on a USB flash drive, use this method. To install the VM, you only need to reboot the converged gateway after you insert the USB flash drive.
After a VM is deployed, you can tune its settings as needed.
|
NOTE: If the .pkg file does not contain a guest OS, you must install a guest OS after you deploy the VM. |
For more information about automatic VM deployment, see "Automatically deploying a VM."
Manual VM deployment
Manual VM deployment enables you to create and set up VMs from the CLI of the converged gateway.
Manual VM deployment is more complicated than automatic VM deployment. Typically, use manual deployment only if you do not have a .pkg VM file or cannot export one from an existing VM.
For more information about manual VM deployment, see "Manually deploying a VM."
VM GUI login method
Use VNC Viewer to log in to the GUI of a VM by connecting to the VNC server on the converged gateway. In VNC Viewer, enter the server address in VNC server IP address:VNC port number format.
· VNC server IP address—The IP address of a Layer 3 Ethernet interface or a VLAN interface on the converged gateway.
· VNC port number—The VNC port number configured when the VM is deployed.
|
NOTE: The VNC server IP address in this document is the IP address of a VLAN interface on the converged gateway. |
Figure 4 VM GUI login method
Preparing for VM deployment
Before you deploy VMs, perform the following tasks:
· Setting up the deployment environment
· Connecting the management host and the converged gateway
· Configuring management IP addresses
· Selecting a VM deployment method
Setting up the deployment environment
· To access the converged gateway through the console port, install a terminal emulation program (for example, Putty) on the management host.
· To access the GUI of the VM, install VNC Viewer.
· To transfer VM deployment files to the converged gateway, set up a file server, typically, an FTP server such as TYPSoft-FtpServer.
You can install VNC Viewer and the FTP server on the management host.
Connecting the management host and the converged gateway
· Use a serial cable or USB–to-serial cable to connect the host to the console port of the converged gateway.
· Select a network scheme for the converged gateway, the management host, and the VM to communicate at Layer 2 or Layer 3. For more information, see "VM networking."
¡ Figure 5 shows a sample network scheme for establishing Layer 2 connectivity.
¡ Figure 6 shows a sample network scheme for establishing Layer 3 connectivity.
· Connect the management host to an Ethernet port on the converged gateway for file transfer and data transmission.
|
NOTE: Unless otherwise stated, this document uses the Layer 2 network scheme. |
Figure 5 Network scheme for Layer 2 connectivity
Figure 6 Network scheme for Layer 3 connectivity
Table 1 Component description
Number |
Component name |
Description |
1 |
Management host |
The host from which you deploy VMs. You can install the file server and VNC Viewer on the management host. |
2 |
App client |
Client that accesses services offered by the VMs. |
3 |
vTap |
The vTap NIC. |
4 |
SR-IOV |
The SR-IOV NIC. |
Configuring management IP addresses
1. Configure IP address settings for the management host:
a. On the management host, open the Network and Sharing Center and select Local Area Connection.
b. In the dialog box that opens, click Properties.
c. In the dialog box that opens, select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
d. In the dialog box that opens, configure the IP address settings.
In this example, the IP address is 172.32.24.10/16.
Figure 7 Configuring IP address settings for the management host
2. On the converged gateway, add GigabitEthernet 0/6 and GigabitEthernet 0/7 (the interfaces connected to the management host) to VLAN 20 and configure an IP address for VLAN-interface 20:
# Enter system view and create VLAN 20.
<H3C> system-view
[H3C] vlan 20
# Add GigabitEthernet 0/6 and GigabitEthernet 0/7 to VLAN 20 and return to system view.
[H3C-vlan20] port gigabitethernet 0/6 to gigabitethernet 0/7
[H3C-vlan20] quit
# Enter the VLAN interface view of VLAN 20, assign an IP address to the VLAN interface, and return to system view.
[H3C] interface vlan-interface 20
[H3C-Vlan-interface20] ip address 172.32.24.20 16
[H3C-Vlan-interface20] quit
Selecting a VM deployment method
Select manual deployment or automatic deployment as shown in Figure 8.
· To perform an automatic deployment, see "Automatically deploying a VM."
· To perform a manual deployment, see "Manually deploying a VM."
Figure 8 Selecting a VM deployment method
Automatically deploying a VM
Selecting an automatic deployment procedure
Figure 9 shows the automatic VM deployment workflow.
If you have a USB flash drive, select USB-based automatic deployment.
If you do not have a USB flash drive or do not need to reboot the converged gateway, select CLI-based automatic deployment.
Figure 9 Automatic VM deployment workflow
Automatically deploying a VM from the CLI
CLI-based automatic deployment procedure
1. Creating a .pkg VM file for automatic deployment
If you do not have a .pkg VM file, perform this task to create one from an existing VM on another converged gateway and transfer the file to this converged gateway.
2. Installing the .pkg file to deploy the VM
4. Install the guest OS if the VM does not have an operating system and configure network settings.
Installing the .pkg file to deploy the VM
About this task
The amount of time used to deploy a VM depends on the size of the .pkg VM file.
Procedure
1. Enter VMM view.
<H3C> system-view
[H3C] vmm
2. Install the VM.
[H3C-vmm] install vm-pkg hda0:/centos7.pkg
install VM package centos7.pkg...
After the VM is installed successfully, the following VMM view prompt appears:
[H3C-vmm]
Configuring VM parameters
1. Enter VMM view and display network interface information for VM centos7.
<H3C> system-view
[H3C] vmm
[H3C-vmm] display vminterface vm centos7
Interface Type Model MAC
-----------------------------------------------------------
VMEth0/9 ethernet e1000 2019-0724-092f
PF0/VF0 hostdev - 2019-0724-0937
2. Add the vNICs to a VLAN (for example, VLAN 20) on the converged gateway.
[H3C-vmm] set vtap vm centos7 mac 2019-0724-092f vlan 20
[H3C-vmm] set sriov pf 0 vf 0 vlan 20
Installing the guest OS and configuring the network settings
1. Use FTP to download the guest OS image file (centos-7.0-x86_64-bin-DVD.iso in this example) to the converged gateway.
For more information about file transfer, see "Installing a guest OS."
2. Display the VNC port number of the VM.
<H3C> display vncport vm centos7
:20
3. Use VNC Viewer to log in to the VM and install the guest OS.
4. Configure the vNIC of the VM. For more information about the configuration procedure, see "Configuring VM network settings."
Automatically deploying a VM from a USB flash drive
1. Creating a .pkg VM file for automatic deployment
If you do not have a .pkg VM file, perform this task to create one from an existing VM on the source converged gateway and export the file to a USB flash drive.
2. Insert the USB drive into the destination converged gateway.
3. Execute the reboot command to restart the destination converged gateway.
The converged gateway automatically deploys the VM. The amount of time used for deployment depends on the size of the .pkg VM file.
4. Configure VM parameters. For more information, see "Configuring VM parameters."
5. Install the guest OS and configure the vNIC of the VM. For more information, see "Installing the guest OS and configuring the network settings."
Manually deploying a VM
Manual VM deployment procedure
To deploy a VM manually:
4. Configuring VM network settings
Figure 10 Manual VM deployment workflow
Creating a VM
Identifying the file system format of the converged gateway
About storage devices
The converged gateway provides external disk hda0 and built-in disk sda for VM deployment. By default, sda is partitioned into sda0 and sda1.
You install the guest OSs of VMs and run their applications in hda0 and store the configuration files of VMs in sda1.
Partition sda0 typically stores the Comware software image files and configuration files of the converged gateway.
Procedure
1. Verify that the file system format of disk hda0 and partition sda1 is EXT4 on the converged gateway:
# Verify that the file system format of disk hda0 is EXT4. The format is EXT4 if the value for the Directory of hda0: field is (EXT4).
<H3C> dir hda0:/
Directory of hda0: (EXT4)
0 drw- - Nov 30 2018 09:32:55 lost+found
1922729848 KB total (1847501584 KB free)
# Verify that the file system format of partition sda1 is EXT4. The format is EXT4 if the value for the Directory of sda1: field is (EXT4).
<H3C> dir sda1:/
Directory of sda1: (EXT4)
0 drw- - Jan 15 2019 11:09:04 VmImages
1 -rw- 124086 Jan 17 2019 18:03:30 libvirtd.log
2. If the format of a file system is not EXT4, use the format command to format it.
|
CAUTION: If the disk contains useful data, back up the data before you format the disk. This command will clear data from the file system. |
<H3C> format hda0: ext4
All data on hda0: will be lost, continue? [Y/N]:
Importing the guest OS image file
1. Configure a username, password, and image file path on the FTP server.
2. Put the guest OS image file in the file path. Make sure the image file name does not exceed 63 characters.
3. On the converged gateway, download the image file to disk hda0, for example, to the root directory of disk hda0:
# Change the current working directory to the root directory of disk hda0.
<H3C> cd hda0:/
# Connect to the FTP server.
<H3C> ftp 172.32.24.10
Press CTRL+C to abort.
Connected to 172.32.24.10 (172.32.24.10).
220 TYPSoft FTP Server Version 2.0
# Enter the FTP username and password. The FTP username and password must be the same as those configured on the FTP server.
User (172.32.24.10:(none)): 1234
331 password required for 1234
Password:
230 User logged in
Remote system type is UNIX.
Using binary mode to transfer files.
# Set the file transfer mode to binary to ensure the integrity of the transferred file.
ftp> binary
# Download the image file to the root directory of disk hda0 on the converged gateway and save the image file. In this example, the image file is centos-7.0-x86_64-bin-DVD.iso.
ftp> get centos-7.0-x86_64-bin-DVD.iso
# Verify that the image file has been transferred to the converged gateway successfully. The file transfer is finished if the following message appears:
226 Closing data connection; File transfer successful.
4521459712 bytes received in 385.518 seconds (11.18 Mbytes/s)
# Terminate the FTP connection.
ftp> quit
Configuring VM parameters
Restrictions and guidelines
VMs cannot share disks. The disks created for a VM can be used by that VM.
For more information about configuring VMs and the related commands, see the following documents:
· Virtual Technologies Configuration Guide in H3C MSR810[2600][3600] Routers Configuration Guides.
· Virtual Technologies Command Reference in H3C MSR810[2600][3600] Routers Command References.
Procedure
1. Enter VMM view.
<H3C> system-view
[H3C] vmm
[H3C-vmm]
2. Create a disk for VM centos7. In this example, the disk file path is hda0:/centos7.qcow, the size is 30 GB, and the format is QCOW2.
[H3C-vmm] create-disk hda0:/centos7.qcow size 30 format qcow2
3. Install VM centos7. The number of vCPUs is 2, the memory size is 1 GB, the VNC port number is 12, the disk path is hda0:/centos7.qcow, the disk format is QCOW2, the disk BUS type is ide, and the CD-ROM image path is hda0:/centos-7.0-x86_64-bin-DVD.iso.
[H3C-vmm] install vm-name centos7 vcpu 2 memory 1024000 vncport 12 disk hda0:/centos7.qcow format qcow2 disk-bus ide cdrom hda0:/centos-7.0-x86_64-bin-DVD.iso
4. Verify that the VM is installed successfully.
A VM is installed successfully if the following message appears:
Domain centos7 defined successfully
Adding vNICs to a VM
About vNIC configuration
The converged gateway supports vTap and SR-IOV NICs for VMs. For more information about the vNICs, see "Supported vNICs."
For a VM to communicate with the management host, assign the VM NICs to a VLAN (for example, VLAN 20).
Adding a vTap NIC to a VM
About this task
A vTap NIC is uniquely identified by its MAC address. The Comware system has reserved eight MAC addresses for vTap NICs. When you use the add vtap command to add a vTap NIC to a VM, select an available MAC address as needed.
You can add a vTap NIC only to one VM. The vTap NICs of a VM communicate with the converged gateway through VM-Ethernet interfaces VMEth 0/9 through VMEth 0/16.
When a VM accesses the network through a vTap NIC, the converged gateway randomly selects one of the VM-Ethernet interfaces for the NIC.
Prerequisites
To configure NIC settings for a VM, you must first shut down the VM. By default, a VM is shut down after it is installed.
Procedure
1. Enter VMM view.
<H3C> system-view
[H3C] vmm
[H3C-vmm]
2. Add a vTap NIC to the VM and bind the NIC to a VLAN:
# Obtain the MAC addresses of vTap NICs.
[H3C-vmm] add vtap vm centos7 mac ?
04D7-A557-96FB
04D7-A557-96FC
04D7-A557-96A1
04D7-A557-96B2
04D7-A557-96D1
04D7-A557-96F6
04D7-A557-96C3
04D7-A557-9662
# Select one of the MAC addresses to add a vTap NIC to the VM and bind the NIC to VLAN 20. This example selects the vTap NIC with MAC address 04D7-A557-96FB.
[H3C-vmm] add vtap vm centos7 mac 04D7-A557-96FB vlan 20
Adding an SR-IOV NIC to a VM
About this task
The converged gateway provides a built-in SR-IOV NIC, which can virtualize physical function (PF) interfaces into virtual function (VF) interfaces. The converged gateway provides eight VF interfaces. You can use the display sriov command to display the PF and VF numbers and their MAC address information.
The converged gateway supports the following VM network modes based on how the physical SR-IOV NIC is used:
· Passthrough—The physical NIC is allocated to a VM exclusively. The VM uses the PF interface of the physical NIC for communication.
· SR-IOV shared—Multiple VMs share the physical NIC. The VMs use the VF interfaces of the physical NIC for communication.
Procedure
1. Enter VMM view.
<H3C> system-view
[H3C] vmm
[H3C-vmm]
2. Add an SR-IOV NIC and bind VLAN 20 to the NIC. This example uses SR-IOV shared mode.
[H3C-vmm] add sriov vm centos7 pf 0 vf 0 vlan 20
Verifying the configuration
1. Enter VMM view.
<H3C> system-view
[H3C] vmm
[H3C-vmm]
2. Verify that the vNICs are added successfully.
[H3C-vmm] display vminterface vm centos7
Interface Type Model MAC
-----------------------------------------------------------------
VMEth0/9 ethernet e1000 04D7-A557-96FB
PF0/VF0 hostdev - 04D7-A557-9603
Installing a guest OS
The following information uses the CentOS system as an example to illustrate the guest OS installation procedure. The installation procedure might slightly differ depending on the guest OS type.
Logging in to the VM GUI
1. Start the VM.
<H3C> system-view
[H3C] vmm
[H3C-vmm] start vm centos7
Domain centos7 started
2. On the management host, open VNC Viewer, and log in to the VM GUI in the format of VNC server IP address:VNC port number, as shown in Figure 11.
Figure 11 VNC Viewer login interface
3. If VNC Viewer closes incorrectly, re-open it and set the VNC configuration color level to full, as shown in Figure 12.
Figure 12 Modifying the color level
Installing the guest OS in the VM
After you log in to the VM GUI (see Figure 13), install the guest OS as instructed.
In the figure, the GNOME Desktop and Development Tools options are selected when configuring the basic environment. You can make your choice as needed.
Figure 13 VM GUI login initial interface
Configuring VM network settings
Configuring the vTap NIC of a VM
About this task
To configure the network settings for the vTap NIC of a VM, access its guest OS.
Restrictions and guidelines
The IP address of the vTap NIC must be on the same subnet as the IP addresses of the management host and the gateway VLAN interface.
Prerequisites
Manually shut down the VM firewall when you use the ping utility to test the connectivity between the VM, the converged gateway, and the management host.
Procedure
1. On the desktop of the guest OS (CentOS 7 in this example), enable the Intel Ethernet service and click Network Settings. as shown in Figure 14.
Figure 14 Configuring network settings
2. Find the vTap NIC with the MAC address specified in "Adding a vTap NIC to a VM," and click the gear icon in the lower right corner to add NIC settings, as shown in Figure 15. In this example, the MAC address of the vTap NIC is 04D7-A557-96FB.
3. Select IPv4, configure the IP address and add the gateway, as shown in Figure 16.
Figure 16 Configuring IP address settings
4. Disable and then re-enable the vNIC for the configuration to take effect, as shown in Figure 17.
Figure 17 Disabling and re-enabling the NIC
5. Use the ping command to verify that the VM can communicate with the management host and converged gateway. (Details not shown.)
Configuring the SR-IOV NIC of a VM
About this task
For the SR-IOV PF or VF on a VM to operate correctly, you must install the SR-IOV driver for the guest OS.
The SR-IOV driver for a Linux system is Intel® Network Adapter Virtual Function Driver for Intel® 10 Gigabit Ethernet Network Connections.
The SR-IOV driver for Windows 2012 is Intel® Network Adapter Driver for Windows Server 2012*.
Prerequisites
1. Download the SR-IOV driver to a directory on the FTP server. In this example, FTP server is on the management host, and the driver file is ixgbevf-4.0.5.tar.gz.
¡ To download the SR-IOV driver for a Linux system, access https://downloadcenter.intel.com/zh-cn/download/18700/Ethernet--10
¡ To download the SR-IOV driver for Windows 2012, access
https://downloadcenter.intel.com/zh-cn/download/21694
|
NOTE: If the download links are inaccessible, access the Intel download center to download the SR-IOV driver. |
2. Make sure you have configured the vTap NIC of the VM to provide network services.
3. Transfer the driver from the FTP server to the converged gateway. For more information about configuring and using FTP to transfer files, see "Importing the guest OS image file."
Procedure
1. Open the Firefox web browser that comes with the CentOS system.
Figure 18 Opening the Firefox web browser
2. Enter the FTP server address to access the FTP server, find file ixgbevf-4.0.5.tar.gz, and save the file on the VM.
Figure 19 Accessing the FTP server
3. Open the directory where the file is saved, select the driver, and right-click in the blank space, and then select Open in Terminal.
Figure 20 Opening the driver file
4. Install the SR-IOV driver.
[centos7@localhost~]# su
Password:
[root@localhost~]# mv ixgbevf-4.0.5.tar.gz /tmp
[root@localhost~]# cd /tmp
[root@localhost tmp]# tar –xzvf ixgbevf-4.0.5.tar.gz
[root@localhost tmp]# cd ixgbevf-4.0.5/src
[root@localhost src]# make
[root@localhost src]# make install
6. Access the guest OS to configure the network settings. Find the SR-IOV NIC with the MAC address specified in "Adding an SR-IOV NIC to a VM," and configure IP address settings for the NIC. The IP address cannot be on the same subnet as the vTap NIC. For more information about configuring a vTap NIC, see "Configuring the vTap NIC of a VM."
Creating a .pkg VM file for automatic deployment
To create a .pkg VM for automatic deployment:
1. Connecting the management host to the source converged gateway
2. Preparing the source VM for .pkg file creation
3. Creating a .pkg file for CLI-based or USB-based automatic deployment:
¡ Creating a .pkg VM file for CLI-based automatic deployment
¡ Exporting the VM as a .pkg file for USB-based automatic VM deployment
|
NOTE: In this document, the source converged gateway is the device on which a .pkg VM file is created. The destination converged gateway is the device on which the .pkg VM file is installed. |
Connecting the management host to the source converged gateway
To create a .pkg VM file, connect the source converged gateway and management host. You can log in to the CLI of the converged gateway from the management host to create the .pkg file.
Figure 21 shows a sample networking scheme.
Figure 21 Connecting the management host and the source converged gateway
Preparing the source VM for .pkg file creation
About this task
When you create a .pkg file from the source VM, you must shut down the source VM, and delete its guest OS image path.
When exporting a VM as a .pkg file, the system does not include the image file in the package. If you do not delete the guest OS image path, error will occur when you use the .pkg file to deploy a VM.
Procedure
1. Verify that the source VM is operating correctly and shut it down:
a. Log in to the source VM from VNC Viewer to verify that the VM is operating correctly.
b. Shut down the VM.
<H3C> system-view
[H3C] vmm
[H3C-vmm] stop vm centos7
It takes about 6 minutes for a VM to shut down.
c. Forcibly shut down the VM if it has not responded to the normal stop operation or if it has stuck at that operation for an unreasonably long time.
[H3C-vmm] stop vm centos7 force
d. Verify that the VM has shut down.
[H3C-vmm] display vmlist
Id Name Status
------------------------------------------
1 centos7 shutoff
2. Delete the operating system installation image file path:
a. Display detailed information about the VM.
[H3C-vmm] display vm centos7
VM:centos7
CPU count: 2
Memory size: 29689068 KB
Disks:
Disk0: vda
capacity: 200 GB
path: /mnt/hda0:/ centos7.qcow
Disk1: hda
capacity: 3 GB
path: /mnt/hda0:/centos-7.0-x86_64-bin-DVD.iso
Interfaces:
Interface0: VMEth0/9
Type: ethernet
Mode: e1000
MAC: 2019-0724-092f
Interface1: PF0/VF0
Type: hostdev
Mode: -
MAC: 2019-0724-0937
b. Delete the .iso installation image file path configuration.
[H3C-vmm] delete disk vm centos7 target hda
Creating a .pkg VM file for CLI-based automatic deployment
To use a .pkg VM file for CLI-based automatic deployment:
1. Exporting the source VM as a .pkg VM file to a hard disk drive
2. Transferring the .pkg VM file to the destination converged gateway
Exporting the source VM as a .pkg VM file to a hard disk drive
# Create a .pkg VM file.
<H3C> system-view
[H3C] vmm
[H3C-vmm] export vm centos7 hda0:/centos7.pkg
Transferring the .pkg VM file to the destination converged gateway
About this task
You can transfer the .pkg VM file from the source converged gateway to the destination converged gateway through a USB flash drive or through FTP.
If you use FTP, you can use either of the following methods to transfer the file:
· Use the source converged gateway as the FTP client and the management host as the FTP server. If you use this method, you must also obtain the file from the management host to the destination converged gateway through FTP.
· Use the source converged gateway as the FTP server and the destination gateway as the FTP client.
Transferring the .pkg file through a USB flash drive
|
IMPORTANT: If the size of the .pkg file exceeds 4 GB, you must first change the file system format of the USB flash drive to EXT4. |
1. Insert the USB flash drive into the source converged gateway, and copy the .pkg file to the USB flash drive.
<H3C> copy hda0:/centos7.pkg usba0:/
2. Insert the USB flash drive in the destination converged gateway.
3. Copy the .pkg file to the root directory of disk hda0 on the converged gateway.
<H3C> copy usba0:/centos7.pkg hda0:/
Transferring the .pkg file through FTP
This procedure uses the source converged gateway as the FTP server and the destination converged gateway as the FTP client.
1. On the source converged gateway, enable the FTP service, configure the FTP server, and create an FTP user account.
# Enter system view and disable password control.
<H3C> system-view
[H3C] undo password-control enable
# Create user 123 and allow the user to use the FTP service.
[H3C] local-user 123 class manage
[H3C-luser-manage-123] service-type ftp
# Set the FTP working directory and configure a user password.
[H3C-luser-manage-123] authorization-attribute user-role network-admin work-directory hda0:/
[H3C-luser-manage-123] password simple 123456
[H3C-luser-manage-123] quit
# Enable the FTP server.
[H3C] ftp server enable
2. On the destination converged gateway, verify that the file system format of the destination disk (for example, disk hda0) is EXT4. For more information, see "Identifying the file system format of the converged gateway."
3. On the destination converged gateway, download the .pkg file (for example, centos7.pkg) by using FTP:
# Change the current working directory to the root directory of disk hda0 on the converged gateway.
<H3C> cd hda0:/
# Access the FTP server.
<H3C> ftp 10.1.1.1
Press CTRL+C to abort.
Connected to 10.1.1.1 (10.1.1.1).
220 TYPSoft FTP Server Version 2.0
# Enter the FTP username and password.
User (10.1.1.1:(none)): 123
331 password required for 123
Password:
230 User logged in
Remote system type is UNIX.
Using binary mode to transfer files.
# Set the file transfer mode to binary.
ftp> binary
# Download the .pkg file to the root directory of disk hda0 on the converged gateway and save the file.
ftp> get centos7.pkg
Exporting the VM as a .pkg file for USB-based automatic VM deployment
About this task
If you use a USB flash drive for VM deployment, you must save the created .pkg file to the VmImages folder in the root directory of the USB flash drive. The folder name is case sensitive.
Procedure
1. Format the USB flash drive and set the disk format to EXT4 format.
<H3C> format usba0: ext4
All data on usba0: will be lost, continue? [Y/N]:Y
2. Create the VmImages folder in the root directory of the USB flash drive.
<H3C> mkdir usba0:/VmImages/
Creating directory usba0:/VmImages... Done.
3. Export the source VM as a .pkg file to the usba0:/VmImages directory.
<H3C> system-view
[H3C] vmm
[H3C-vmm] export vm centos7 usba0:/VmImages/centos7.pkg
Managing VMs
Starting a VM
1. Enter VMM view.
<H3C> system-view
[H3C] vmm
2. Start a VM. For example, start VM centos7.
[H3C-vmm] start vm centos7
Shutting down a VM
About this task
Shutting down a VM takes about 6 minutes. If a VM cannot be normally shut down, execute the stop command with the force keyword to forcibly shut down the VM.
Procedure
1. Enter VMM view.
<H3C> system-view
[H3C] vmm
2. Shut down a VM. For example, shut down VM centos7.
[H3C-vmm] stop vm centos7
Configuring VM auto-start
Restrictions and guidelines
You can perform this task only when the VM is running.
Procedure
1. Enter VMM view.
<H3C> system-view
[H3C] vmm
2. Configure auto-start on a VM, for example, VM centos7:
¡ Enable auto-start.
[H3C-vmm] autostart vm centos7
¡ Disable VM auto-start.
[H3C-vmm] undo autostart vm centos7
3. Restart the VM for the setting to take effect.
[H3C-vmm] start vm centos7
Backing up a VM
Prerequisites
Make sure the VM has been shut down.
Procedure
1. Enter VMM view.
<H3C> system-view
[H3C] vmm
2. Back up the VM to a .vmb file. For example, back up VM centos7 to file hda0:/centos7.vmb.
[H3C-vmm] backup vm centos7 hda0:/centos7.vmb
Restoring a VM
About this task
Perform this task to restore a VM from a .vmb backup file.
This operation reverts the VM to the state when the .vmb backup file was generated.
Procedure
1. Enter VMM view.
<H3C> system-view
[H3C] vmm
2. Restore a VM from a backup file. For example, restore a VM from file hda0:/centos7.vmb.
[H3C-vmm] restore pakagepath hda0:/centos7.vmb
Exporting a VM as a .pkg file
Prerequisites
Make sure the VM has been shut down.
Procedure
1. Enter VMM view.
<H3C> system-view
[H3C] vmm
2. Export the VM to a .pkg file. For example, export VM centos7 to file hda0:/centos7.pkg.
[H3C-vmm] export vm centos7 hda0:/centos7.pkg
Uninstalling a VM
Prerequisites
Make sure the VM has been shut down.
Procedure
1. Enter VMM view.
<H3C> system-view
[H3C] vmm
2. Uninstall the VM. For example, uninstall VM centos7.
[H3C-vmm] stop vm centos7
[H3C-vmm] uninstall vm centos7
Adding disks to expand a VM
Restrictions and guidelines
You can perform this task only when the VM is running.
Procedure
1. Enter VMM view.
<H3C> system-view
[H3C] vmm
2. Create a VM disk.
create-disk disk-file size size format { raw | qcow2 }
3. Add the disk to the VM.
add disk vm vm-name format { raw | qcow2 } disk-file path-file disk-bus { ide | virtio }
4. Restart the VM to have the add operation take effect.
[H3C-vmm] start vm vm-name
Example
The following example adds a 30 GB disk in QCOW2 format to VM centos8:
# Enter VMM view.
<H3C> system-view
[H3C] vmm
# Create a 30 GB disk in QCOW2 format and set its disk file path to hda0:/centos8.qcow.
[H3C-vmm] create-disk hda0:/centos8.qcow size 30 format qcow2
# Add the disk to VM centos8.
[H3C-vmm] add disk vm centos8 format qcow2 disk-file hda0:/centos8.qcow disk-bus ide
# Restart the VM.
[H3C-vmm] start vm centos8
Configuring VMs
For more information about configuring hard disks, vNICs, memory, vCPUs, and other parameters for a VM, see the following documents:
· VM configuration in Virtual Technologies Configuration Guide of H3C MSR810[2600][3600] Routers Configuration Guides.
· VM commands in Virtual Technologies Command Reference of H3C MSR810[2600][3600] Routers Command References.
Display and maintenance commands for VM management
Execute display commands in any view.
Command |
|
Display the VM list. |
display vmlist |
Display the VM disk list. |
display vmdisklist vm vm-name |
Display detailed information about a VM. |
display vm vm-name |
Display the number of CPU cores allocated to VMs. |
display vcpu-pool |
Display the CPU usage of a VM. |
display vmcpu-usage vm vm-name |
Display the memory usage of a VM. |
display vmmem-usage vm vm-name |
Display SR-IOV vNIC information. |
display sriov |
Display network interface information about a VM. |
display vminterface vm vm-name |
Display the VNC port number of a VM. |
display vncport vm vm-name |
Display the bindings between vCPUs and physical CPUs for a VM. |
display vmcpupin vm vm-name |
Display disk usage information about a VM. |
display vmdisk-usage vm vm-name |
Display passthrough NIC information. |
display passthrough |
Display the VM network mode of the NIC. |
display vm-network-mode |