- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
02-VM commands | 113.18 KB |
Virtual machine commands
This feature is supported only on the MSR3610-I-DP and MSR3610-IE-DP routers.
To ensure correct operation of VMs, make sure the storage medium where the VMs are installed has sufficient storage space.
add disk
Use add disk to add a disk to a VM.
Syntax
add disk vm vm-name format { raw | qcow2 } disk-file path-file
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
format: Specifies the disk format.
raw: Specifies the RAW format.
qcow2: Specifies the QCOW2 format.
disk-file path-file: Specifies the disk file path, a case-sensitive string of 1 to 63 characters.
Usage guidelines
Before you add a disk to a VM, you must use the create-disk command to create the disk.
Examples
# Add a disk in QCOW2 format to VM centos7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] add disk vm centos7 format qcow2 disk-file hda0:/centos7.qcow
add sriov
Use add sriov to assign an SR-IOV NIC to a VM.
Syntax
Passthrough mode:
add sriov vm vm-name pf pfid
SR-IOV share mode:
add sriov vm vm-name pf pfid vf vfid [ vlan vlan-id ]
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
pf pfid: Specifies a physical NIC by its PF ID. The value for the pfid argument is 0.
vf vfid: Specifies a vNIC by its VF ID. The value range for the vfid argument is 0 to 7.
vlan vlan-id: Specifies a VLAN for the VF interface. The value range for the vlan-id argument is 1 to 4094.
Examples
# Assign an SR-IOV NIC to VM centos7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] add sriov vm centos7 pf 0 vf 0
add vtap
Use add vtap to add a vTap NIC to a VM.
Syntax
add vtap vm vm-name mac mac-address [ vlan vlan-id ]
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
mac mac-address: Specifies a vTap NIC by its MAC address, a hexadecimal string in the format of xxxx-xxxx-xxxx.
vlan vlan-id: Specifies a VLAN for the vTap interface. The value range for the vlan-id argument is 1 to 4094.
Examples
# Add the vTap NIC with the MAC address 0010-1110-5872 to VM centos7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] add vtap vm centos7 mac 0010-1110-5872
autostart
Use autostart to enable auto-start for a VM.
Use undo autostart to disable auto-start for a VM.
Syntax
autostart vm vm-name
undo autostart vm vm-name
Default
Auto-start is disabled for a VM.
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
Examples
# Enable auto-start for VM centos7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] autostart vm centos7
backup
Use backup to back up a VM to a .vmb file in the specified path.
Syntax
backup vm vm-name backup-path
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
backup-path: Specifies the backup file path, a case-sensitive string of 1 to 63 characters.
Examples
# Back up VM centos7 to the specified path.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] backup vm centos7 hda0:/VmImages/centos7.vmb
create-disk
Use create-disk to create a VM disk.
Syntax
create-disk disk-file size size format { raw | qcow2 }
Views
VMM view
Predefined user roles
network-admin
Parameters
disk-file: Specifies the disk file path, a case-sensitive string of 1 to 63 characters.
size size: Sets the maximum disk size in GB. The value for the size argument must be an interger. The value range for this argument depends on the available storage space of the device.
format: Specifies the disk format.
raw: Specifies the RAW format.
qcow2: Specifies the QCOW2 format.
Usage guidelines
Use the size size option to set the maximum disk space that a VM can occupy. The actual disk space occupied by the VM might differ from the configured value. If the disk format is RAW, the dir command displays the disk size configured for the VM. If the disk format is QCOW2, the dir command displays the disk size actually occupied by the VM.
Examples
# Create a disk in QCOW2 format.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] create-disk hda0:/centos7.qcow size 30 format qcow2
delete disk
Use delete disk to delete a disk from a VM.
Syntax
delete disk vm vm-name target target
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
target target: Specifies a disk by its name, a case-sensitive string of three characters.
Examples
# Remove disk hdb from VM centos7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] delete disk vm centos7 target hdb
delete vtap
Use delete vtap to remove a vTap NIC from a VM.
Syntax
delete vtap vm vm-name mac mac-address
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
mac mac-address: Specifies a vTap NIC by its MAC address, a hexadecimal string in the format of xxxx-xxxx-xxxx.
Examples
# Remove a vTap NIC from VM centos7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] delete vtap vm centos7 mac 0011-0111-1234
delete sriov
Use delete sriov to remove an SR-IOV NIC from a VM.
Syntax
Passthrough mode:
delete sriov vm vm-name pf pfid
SR-IOV share mode:
delete sriov vm vm-name pf pfid vf vfid
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name. The vm-name argument is a case-sensitive string of 1 to 30 characters.
pf pfid: Specifies a physical NIC by its PF ID. The value for the pfid argument is 0.
vf vfid: Specifies a vNIC by its VF ID. The value range for the vfid argument is 0 to 7.
Examples
# Remove VF 0 of PF 0 from VM centos7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] delete sriov vm centos7 pf 0 vf 0
display sriov
Use display sriov to display SR-IOV vNIC information.
Syntax
display sriov
Views
Any view
Predefined user roles
network-admin
Examples
# Display SR-IOV vNIC information.
<Sysname> display sriov
PF VF vlan pciaddr macaddr
-------------------------------------------------------------------------
0 0 - 0000:03:10.0 00:10:11:10:58:7a
0 1 - 0000:03:10.2 00:10:11:10:58:7b
0 2 - 0000:03:10.4 00:10:11:10:58:7c
0 3 - 0000:03:10.6 00:10:11:10:58:7d
0 4 - 0000:03:11.0 00:10:11:10:58:7e
0 5 - 0000:03:11.2 00:10:11:10:58:7f
0 6 - 0000:03:11.4 00:10:11:10:58:80
0 7 - 0000:03:11.6 00:10:11:10:58:81
Table 1 Command output
Field |
Description |
PF |
PF ID of the physical NIC. |
VF |
VF ID of the vNIC. |
vlan |
VLAN to which the VF interface belongs. |
pciaddr |
PCI address of the VF interface. |
macaddr |
MAC address of the vNIC. |
display passthrough
Use display passthrough to display passthrough NIC information.
Syntax
display passthrough
Views
Any view
Predefined user roles
network-admin
Usage guidelines
For this command to display passthrough NIC information, you must first use the vm network-mode passthrough command to set the VM network mode to passthrough mode.
Examples
# Display passthrough NIC information.
<Sysname> display passthrough
PF pciaddr macaddr
--------------------------------------------------
0 0000:03:00.0 80:48:c9:00:00:02
Table 2 Command output
Field |
Description |
PF |
PF ID of the physical NIC. |
pciaddr |
PCI address of the PF interface. |
macaddr |
MAC address of the NIC. |
display vcpu-pool
Use display vcpu-pool to display the number of CPU cores allocated to VMs.
Syntax
display vcpu-pool
Views
Any view
Predefined user roles
network-admin
Examples
# Display the number of vCPU cores allocated to VMs.
<Sysname> display vcpu-pool
CPU Pool for VMPlane is 1.
display vm
Use display vm to display VM information.
Syntax
display vm vm-name
Views
Any view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
Examples
# Display information about VM centos7.
<Sysname> display vm centos7
VM: centos7
CPU count: 1
Memory size: 1024000 KB
Disks:
Disk0: hda
capacity: 200 GB
path: /mnt/hda0:/he.qcow
Interfaces:
Interface0: -
Type: ethernet
Mode: e1000
MAC: 5254-00f2-1aec
Interface1: PF0/VF7
Type: hostdev
Mode: -
MAC: 0010-1110-5881
VNC port:
:10 AutoStart: disabled
Table 3 Command output
Field |
Description |
VM |
VM name. |
CPU count |
Number of vCPUs. |
Memory size |
Memory size in KB. |
Disks |
Disk information. |
Disk |
Disk number. The following values are available: · Disk0. · Disk1. · Disk2. · Disk3. |
path |
Disk file path. |
capacity |
Disk capacity in GB. |
Interfaces |
NIC information. |
Type |
NIC type. |
Mode |
NIC mode. |
MAC |
MAC address of the NIC. |
VNC port |
VNC port number. |
AutoStart |
Status of the auto-start feature: · Disabled. · Enabled. |
display vmcpupin
Use display vmcpupin to display the bindings between vCPUs and physical CPUs for a VM.
Syntax
display vmcpupin vm vm-name
Views
Any view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
Examples
# Display the bindings between vCPUs and physical CPUs for VM centos7.
<Sysname> dis vmcpupin vm centos7
VCPU: CPU Affinity
----------------------------------
0: 2-7
1: 2-7
2: 2-7
3: 2-7
4: 2-7
5: 2-7
6: 2-7
display vmcpu-usage
Use display vmcpu-usage to display CPU usage information about a VM.
Syntax
display vmcpu-usage vm vm-name
Views
Any view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
Examples
# Display CPU usage information about VM centos7.
<Sysname> dis vmcpu-usage vm CentOS-7
CpuNum Cpu-Usage
---------------------------------------
0 27%
Table 4 Command output
Field |
Description |
CpuNum |
CPU number. |
Cpu-Usage |
CPU usage. |
display vmdisklist
Use display vmdisklist to display the disk list of a VM.
Syntax
display vmdisklist vm vm-name
Views
Any view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
Examples
# Display the disk list of VM centos7.
<Sysname> display vmdisklist vm centos7
Target Source
------------------------------------------------
hda /mnt/hda0:/test1.qcow
Table 5 Command output
Field |
Description |
Target |
Disk name. |
Source |
Disk file path. |
display vmdisk-usage
Use display vmdisk-usage to display disk usage information about a VM.
Syntax
display vmdisk-usage vm vm-name
Views
Any view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
Examples
# Display disk usage information about VM centos7.
<Sysname> dis vmdisk-usage vm centos7
Target Capacity(KB) Blk-Used(KB) Usage
------------------------------------------------------------
hda 32212254720 4659224576 14%
hdc 4148080640 4148084736 100%
Table 6 Command output
Field |
Description |
Target |
Disk name. |
Capacity |
Disk capacity in KB. |
Blk-Used |
Used disk space in KB. |
Usage |
Disk usage in percentage. |
display vminterface
Use display vminterface to display network interface information for a VM.
Syntax
display vminterface vm vm-name
Views
Any view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
Examples
# Display network interface information for VM centos7.
<Sysname> display vminterface vm centos7
Interface Type Model MAC
-----------------------------------------------------------
VMEth0/9 ethernet e1000 5254-00f3-1814
PF0/VF0 hostdev - 00a0-c901-0102
Table 7 Command output
Field |
Description |
Interface |
Name of the network interface. |
Type |
Type of the network interface. |
Model |
vTap NIC mode. |
MAC |
MAC address of the VM NIC. |
display vmlist
Use display vmlist to display the VM list.
Syntax
display vmlist
Views
Any view
Predefined user roles
network-admin
Usage guidelines
The list displays VMs in startup order. The lower the ID, the earlier the VM starts up.
Examples
# Display the VM list.
<Sysname> display vmlist
Id Name Status
------------------------------------------
1 centos7 running
2 vm2 shutoff
Table 8 Command output
Field |
Description |
Id |
VM ID in the list. |
Name |
VM name. |
State |
VM operating state: · Running—The VM is operating. · Paused—The VM is suspended. · Shutoff—The VM is shut down. |
display vmmem-usage
Use display vmmem-usage to display the memory usage of a VM.
Syntax
display vmmem-usage vm vm-name
Views
Any view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
Usage guidelines
This command is supported only on systems that support the virtio driver.
Release versions of the Linux operating system support the memballon virtio driver of the guest OS. On the Windows operating system, you need to install a separate virtio driver. The vFW does not support the virtio driver.
Examples
# Display the memory usage of VM centos7.
<Sysname> display vmmem-usage vm centos7
Total Used Mem-usage
----------------------------------------------------------
2973036 82988 3%
Table 9 Command output
Field |
Description |
Total |
Total memory on the VM . |
Used |
Memory in use. |
Mem-usage |
Memory usage in percentage. |
display vm-network-mode
Use display vm-network-mode to display the VM network mode.
Syntax
display vm-network-mode
Views
Any view
Predefined user roles
network-admin
Examples
# Display the VM network mode.
<Sysname> display vm-network-mode
vm networkmode: passthrough
Table 10 Command output
Field |
Description |
vm networkmode |
VM network mode: · Passthrough. · SR-IOV share. |
display vncport
Use display vncport to display the VNC port number of a VM.
Syntax
display vncport vm vm-name
Views
Any view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
Examples
# Display the VNC port number of a VM.
<Sysname> display vncport vm centos7
:12
export
Use export to export the files of a VM to a .pkg file in the hda0:/VmImages directory.
Syntax
export vm vm-name
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
Examples
# Export VM centos7 to the hda0:/VmImages directory.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] export vm centos7
install vm-name
Use install vm-name to install a VM based on the specified parameters.
Syntax
install vm-name vm-name vcpu vcpu-count memory size vncport vncport disk disk-file format { raw | qcow2 } [ cdrom cdrom-file ] [ vnic { vtap [ mac mac-address ] [ vlan vlan-id ] | sriov pf pfid vf vfid [ vlan vlan-id ] } ]
Views
VMM view
Predefined user roles
network-admin
Parameters
vm-name vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
vcpu vcpu-count: Sets the number of vCPUs allocated to the VM. The value range for the vcpu-count argument depends on the number of CPUs on the device.
memory size: Sets the size of memory allocated to the VM, in KB. The value range for the size argument depends on the memory size of the device.
vncport vncport: Sets the VNC port number in the range of 0 to 99.
disk disk-file: Specifies the disk file path of the VM. The disk-file argument is a case-sensitive string of 1 to 63 characters.
raw: Sets the disk format to RAW.
qcow2: Sets the disk format to QCOW2.
vnic: Configures the vNIC of the VM.
sriov: Specifies an SR-IOV NIC for the VM.
vtap: Specifies a vTap NIC for the VM. This type of NIC is virtualized by software.
cdrom cdrom-file: Specifies the VM system image file path, a case-sensitive string of 1 to 63 characters.
mac mac-address: Specifies the MAC address of the NIC, a hexadecimal string in the format of xxxx-xxxx-xxxx.
vlan vlan-id: Specifies the VLAN to which the NIC belongs. The value range for the vlan-id argument is 1 to 4094.
pf pfid: Specifies the ID of the physical SR-IOV NIC that holds the VF interface connected to the VM. The value for the pfid argument is 0.
vf vfid: Specifies the ID of the VF interface connected to the VM. The value range for the vfid argument is 0 to 7.
Usage guidelines
Before you add a disk to a VM, you must use the create-disk command to create the disk.
Examples
# Install a VM based on the specified parameters.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] install vm-name centos7 vcpu 1 memory 1048576 vncport 12 disk hda0:/centos7.qcow format qcow2 cdrom hda0:/centos7.iso vnic vtap mac 0010-1110-5872 vlan 21
install vm-pkg
Use install vm-pkg to install a VM from a .pkg file.
Syntax
install vm-pkg pkg-path
Views
VMM view
Predefined user roles
network-admin
Parameters
pkg-path: Specifies the absolute path of the .pkg file, a case-sensitive string of 1 to 63 characters.
Usage guidelines
Prepare the .pkg file before you use the file to install a VM. You can use the export command to export .pkg files.
Examples
# Install a VM from a .pkg file.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] install vm-pkg hda0:/VmImages/CentOS-7.pkg
install VM package CentOS-7.pkg...
restore pakagepath
Use restore pakagepath to restore a VM from a .vmb VM backup file in the specified path.
Syntax
restore pakagepath backup-image-path
Views
VMM view
Predefined user roles
network-admin
Parameters
backup-image-path: Specifies the absolute path of the VM backup file, a case-sensitive string of 1 to 63 characters.
Examples
# Restore a VM from the specified VM backup file.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] restore pakagepath usba0:/VmImages/centos7.vmb
resume
Use resume to resume a VM in Paused state.
Syntax
resume vm vm-name
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
Examples
# Resume VM centos7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] resume vm centos7
set cdrom
Use set cdrom to specify the path of the system image file for a VM.
Syntax
set cdrom vm vm-name cdrom-file cdrom-file
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
cdrom-file cdrom-file: Specifies the path of the system image file, a case-sensitive string of 1 to 63 characters.
Examples
# Specify hda0:/centos7.iso as the path of the system image file for VM centos7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] set cdrom vm centos7 cdrom-file hda0:/centos7.iso
set memory
Use set memory to set the size of the memory allocated to a VM.
Syntax
set memory vm vm-name size size
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
size size: Sets the size of the VM memory, in KB. The value range for the size argument depends on the memory size of the device.
Examples
# Allocate 1048576 KB of memory to VM centos7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] set memory vm centos7 size 1048576
set sriov
Use set sriov to specify the VLAN to which a VF interface belongs.
Use undo set sriov to remove a VF interface from a VLAN.
Syntax
set sriov pf pfid vf vfid vlan vlan-id
undo set sriov pf pfid vf vfid vlan vlan-id
Views
VMM view
Predefined user roles
network-admin
Parameters
pf pfid: Specifies a physical SR-IOV NIC by its PF ID. The value for the pfid argument is 0.
vf vfid: Specifies a vNIC by its VF ID. The value range for the vfid argument is 0 to 7.
vlan vlan-id: Specifies a VLAN ID in the range of 1 to 4094.
Examples
# Assign the VF interface on VF 0 of PF 0 to VLAN 20.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] set sriov pf 0 vf 0 vlan 20
set vcpupin
Use set vcpupin to bind a vCPU on a VM to a physical CPU on the device.
Syntax
set vcpupin vm vmname vcpuindex vcpuindex cpuindex cpuindex
Views
System view
Predefined user roles
network-admin
Parameters
vm vmname: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
vcpuindex vcpu-index: Specifies a vCPU by its index.
cpuindex cpuindex: Specifies a physical CPU by its index.
Examples
# Bind vCPU 0 on VM centos7 to physical CPU 2.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] set vcpupin vm centos7 vcpuindex 0 cpuindex 2
set vcpu
Use set vcpu to set the number of vCPUs allocated to a VM.
Syntax
set vcpu vm vm-name vcpu-count vcpu-count
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
vcpu-count vcpu-count: Sets the number of vCPUs. The value range for the vcpu-count argument depends on the number of CPUs on the device.
Examples
# Set the number of vCPUs to 2 for VM centos7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] set vcpu vm centos7 vcpu-count 2
set vcpu-pool
Use set vcpu-pool to set the total number of CPU cores allocated to the VM plane.
Syntax
set vcpu-pool vcpu-number
Views
System view
Predefined user roles
network-admin
Parameters
vcpu-number: Set the total number of CPU cores allocated to the VM plane. The number depends on the number of CPU cores on the device.
Usage guidelines
For the configuration to take effect, you must reboot the device. If you set the number to 0, VMs will be unaccessible after the device reboots.
Examples
# Allocate two CPU cores to the VM plane.
<Sysname> system-view
[Sysname] set vcpu-pool 2
VCPU pool changed, please reconfig vcpu-pin for each virtual machine and reboot the router.
set vnc
Use set vnc to configure parameters for the VNC port that connects a VM to a host.
Syntax
set vnc vm vm-name { vncport vncport | delpasswd | listen ip-address | setpasswd password }
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
vncport vncport: Sets the VNC port number in the range of 0 to 99.
setpassword password: Sets the VNC login password, a case-sensitive string of 6 to 15 characters.
listen ip-address: Specifies an IP address on the device for the host to connect to the VM. If you specify 0.0.0.0, any IP address on the device can be used to connect to the VM.
delpasswd: Deletes the VNC login password.
Examples
# Configure parameters for the VNC port of VM CentOS-7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] set vnc vm CentOS-7 vncport 12
[Sysname-vmm] set vnc vm CentOS-7 setpasswd 12344556
[Sysname-vmm] set vnc vm CentOS-7 delpasswd
[Sysname-vmm] set vnc vm CentOS-7 listen 172.33.3.158
set vtap
Use set vtap to specify the VLAN to which a vTap interface belongs.
Syntax
set vtap vm vm-name mac mac-address vlan vlan-id
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
mac mac-address: Specifies a vTap NIC by its MAC address, a hexadecimal string in the format of xxxx-xxxx-xxxx.
vlan vlan-id: Specifies a VLAN ID in the range of 1 to 4094.
Examples
# Assign the vTap interface of VM centos7 to VLAN 10.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] set vtap vm centos7 mac 5254-00f2-1aec vlan 10
start
Use start to start a VM.
Syntax
start vm vm-name
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
Usage guidelines
Make sure the VM you want to start has been created on the device and the system has sufficient memory to start the VM.
Besides allocating memory to VMs, the system needs to allocate some amount of memory to run the VM plane. As a best practice to make sure the system has sufficient memory to run the VM plane, adjust the amount of memory allocated to VMs to a small number if multiple VMs start. If the memory is insufficient, the system automatically shuts down the VM that occupies the most memory.
Examples
# Start VM centos7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] start vm centos7
stop
Use stop to shut down a VM.
Syntax
stop vm vm-name [ force ]
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
force: Forcibly shuts down the VM.
Usage guidelines
|
CAUTION: Use the force keyword with caution. A force shutdown might cause data loss. |
Shutting down a VM requires an amount of time. If a process stops the VM from shutting down, you need to access the VM and manually close the process.
If no operating system is installed on a VM, you must specify the force keyword to forcibly shut down the VM.
Examples
# Shut down VM centos7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] stop vm centos7
suspend
Use suspend to suspend a VM.
Syntax
suspend vm vm-name
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
Examples
# Suspend VM centos7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] suspend vm centos7
uninstall
Use uninstall to uninstall a VM.
Syntax
uninstall vm vm-name
Views
VMM view
Predefined user roles
network-admin
Parameters
vm vm-name: Specifies a VM by its name, a case-sensitive string of 1 to 30 characters.
Examples
# Uninstall VM centos7.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm] uninstall vm centos7
Related commands
install
vmm
Use vmm to enter virtual machine management (VMM) view from system view.
Syntax
vmm
Views
System view
Predefined user roles
network-admin
Examples
# Enter VMM view.
<Sysname> system-view
[Sysname] vmm
[Sysname-vmm]
vm network-mode
Use vm network-mode to set the VM network mode.
Syntax
vm network-mode { passthrough | sr-iov }
Default
The SR-IOV share mode is used.
Views
System view
Predefined user roles
network-admin
Parameters
passthrough: Specifies the passthrough mode. In this mode, a VM uses the PF interface of a physical NIC for communication.
sr-iov: Specifies the SR-IOV share mode. In this mode, VMs use the VF interfaces of a physical NIC for communication.
Usage guidelines
For the configuration to take effect, you must save the configuration and reboot the device.
Examples
# Set the VM network mode to passthrough mode.
<Sysname> system-view
[Sysname] vm network-mode passthrough
# Set the VM network mode to SR-IOV share mode.
<Sysname> system-view
[Sysname] vm network-mode sr-iov