OcNOS-DC 6.4.2 : Guest Virtual Machine Guide : Guest Virtual Machine Command Reference : Guest Virtual Machine Command Reference
Guest Virtual Machine Command Reference
This chapter contains the guest virtual machine commands.
memory
debug vm-events
Use this command to log virtual machine operations.
Use the no form of this command to stop logging virtual machine operations.
Command Syntax
debug vm-events
no debug vm-events
Parameters
None
Default
NA.
Command Mode
Exec and Privileged Exec Mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#debug vm-events
dhcp-lease-max
Use this command to set the maximum number of DHCP leases for the VM bridge.
Command Syntax
dhcp-lease-max <10-1000>
Parameters
<10-1000>
Maximum number of DHCP leases
Default
The default maximum number of DHCP leases is 1000.
Command Mode
Virtual machine bridge mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#ip vrf VRF1
(config-vrf)#vm-bridge-create Bridge1
(config-vrf-vm-bridge)#dhcp-lease-max 100
dhcp-lease-time
Use this command to set the maximum time for leasing an IP address for the VM bridge.
Command Syntax
dhcp-lease-time <2-3600>
Parameters
<2-3600>
Maximum time for leasing an IP address in minutes
Default
The default maximum time for leasing an IP address is 360 minutes.
Command Mode
Virtual machine bridge mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#ip vrf VRF1
(config-vrf)#vm-bridge-create Bridge1
(config-vrf-vm-bridge)#dhcp-lease-time 1400
dhcp-range
Use this command to set a DHCP range for the virtual machine bridge.
Use the no form of this command to remove the DHCP range.
Command Syntax
dhcp-range A.B.C.D A.B.C.D
no dhcp-range
Parameters
A.B.C.D
Starting and ending IP address of the DHCP range
Default
NA.
Command Mode
Virtual machine bridge mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#ip vrf VRF1
(config-vrf)#vm-bridge-create Bridge1
(config-vrf-vm-bridge)#dhcp-range 10.12.65.2 10.12.65.12
disk-image
Use this command to configure the disk image location for the VM template.
Command Syntax
disk-image DISK-IMAGE-LOCATION
Parameters
DISK-IMAGE-LOCATION
 
Location of the disk image to boot up the VM.
Default
NA.
Command Mode
Virtual machine template mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#vm-template sample
(config-vm-temp)#disk-image \sample_location
feature guest-vm
Use this command to enable the guest VM feature.
Use the no form of this command to disable the guest VM feature.
Command Syntax
feature guest-vm enable
no feature guest-vm enable
Parameters
None
Default
NA
Command Mode
Configuration Mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#feature guest-vm enable
gateway-ip
Use this command to set the gateway IP address for a virtual machine bridge.
Use the no form of this command to remove a gateway IP address.
Command Syntax
gateway-ip (A.B.C.D A.B.C.D | A.B.C.D/M)
no gateway-ip
Parameters
A.B.C.D A.B.C.D
 
Gateway IP address and subnet mask
A.B.C.D/M
Gateway IP address and subnet mask
Default
NA.
Command Mode
Virtual machine bridge mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#ip vrf VRF1
(config-vrf)#vm-bridge-create Bridge1
(config-vrf-vm-bridge)#gateway-ip 10.12.65.1/24
host-core-affinity
Use this command to set the core affinity value for a virtual machine template.
Use the no form of this command to set the core affinity value to its default.
Command Syntax
host-core-affinity AFFINITY-VALUE
no host-core-affinity
Parameters
AFFINITY-VALUE
The core affinity values between 0 and 7.
Default
Default value is 0.
Command Mode
Virtual machine template mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#vm-template sample
(config-vm-temp)#host-core-affinity 6
iptables
Use this command to create a rule for the IP tables.
Use the no form of this command to remove an IP tables rule.
Command Syntax
iptables STRING (position POS_NUM |)
no iptables STRING
Parameters
STRING
Rule string in double quotes.
POS_NUM
Position to insert the rule string <1-65535>.
Default
NA.
Command Mode
IP tables mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#iptables-template sample_template
(config-iptables)#iptables "INPUT DROP" position 65535
iptables restore
Use this command to restore the entries in the IP tables template to the IP tables.
Use the no form of this command to remove the entries in the IP tables.
Command Syntax
iptables restore iptables-template TEMPLATE_NAME (vrf VRF-NAME |)
no iptables restore (iptables-template TEMPLATE_NAME |) (vrf VRF-NAME |)
Parameters
TEMPLATE-NAME
Name of the IP tables template
VRF-NAME
Name of the VRF
Default
NA.
Command Mode
Configuration Mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#iptables restore iptables-template sample_template vrf VRF1
iptables-template
Use this command to create an IP tables template and enter IP tables mode.
Use the no form of this command to remove an IP tables template.
Command Syntax
iptables-template TEMPLATE_NAME
no iptables-template TEMPLATE_NAME
Parameters
TEMPLATE_NAME
Name of the IP tables template.
Default
NA.
Command Mode
Configure mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#iptables-template sample_template
(config-iptables)
memory
Use this command to configure the RAM size for the VM template.
Command Syntax
memory <128-8192>
Parameters
<128-8192>
Memory for Virtual Machine in MB
Default
Default value is 0.
Command Mode
Virtual machine template mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#vm-template sample
(config-vm-temp)#memory 1024
nat dnat
Use this command to set destination NAT addresses in the IP tables.
Use the no form of this command to remove the destination NAT addresses.
Command Syntax
nat dnat match-ip A.B.C.D to A.B.C.D (protocol (tcp | udp)|) (sport-num <0-65535> |) (dport-num <0-65535> |) (vrf VRF-NAME|)
no nat dnat match-ip A.B.C.D to A.B.C.D (protocol (tcp | udp)|) (sport-num <0-65535> |) (dport-num <0-65535> |) (vrf VRF-NAME|)
Parameters
A.B.C.D
From IP address
A.B.C.D
To IP address
tcp
Use TCP for NAT
udp
Use UDP for NAT
sport-num
Source port
<0-65535>
Source port number
dport-num
Destination port
<0-65535>
Destination port number
VRF-NAME
VRF Name
Default
NA.
Command Mode
Configuration Mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#nat dnat match-ip 1.1.1.1 to 1.1.1.2 protocol tcp
nat snat
Use this command to set the source NAT addresses in the IP tables.
Use the no form of this command to remove the source NAT addresses.
Command Syntax
nat snat from A.B.C.D/M to A.B.C.D (vrf VRF-NAME|)
no nat snat from A.B.C.D/M to A.B.C.D (vrf VRF-NAME|)
Parameters
A.B.C.D/M
From IP address and subnet mask
A.B.C.D
To IP address
VRF-NAME
VRF Name
Default
NA.
Command Mode
Configuration Mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#nat snat from 10.12.65.1 to 10.12.65.102 vrf VRF1
os-type
Use this command to configure the Operating System type of Virtual Machine.
Command Syntax
os-type (xen|linux|hvm|exe|uml)
Parameters
xen
Xen
linux
Linux
hvm
HVM
exe
Exe
uml
UML
Default
NA
Command Mode
Virtual machine template mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#vm-template sample
(config-vm-temp)#os-type linux
os-variant
Use this command to set the operating system variant for a virtual machine template.
Use the no form of this command to remove the operating system variant.
Command Syntax
os-variant (generic|fedora|rhel|ubuntu|debian)
no os-variant (generic|fedora|rhel|ubuntu|debian)
Parameters
generic
Generic
fedora
Fedora
rhel
Red Hat Linux
ubuntu
Ubuntu
debian
Debian
Default
NA.
Command Mode
Virtual machine template mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#vm-template sample
(config-vm-temp)#os-variant debian
reload vm-name
Use this command to reload a running VM with a new template configuration.
Command Syntax
reload vm-name VM_NAME vm-template TEMPLATE_NAME
Parameters
VM-NAME
Name of the VM.
TEMPLATE-NAME
Name of the VM template.
Default
NA.
Command Mode
Exec Mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#reload vm-name new vm-template sample
secondary-disk-image
Use this command to configure the secondary disk image location for the VM template.
Command Syntax
secondary-disk-image SECONDARY-DISK-IMAGE-LOCATION
no secondary-disk-image
Parameters
SECONDARY-DISK-IMAGE-LOCATION
 
Location of the secondary disk image to boot up the VM.
Default
NA.
Command Mode
Virtual machine template mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#vm-template sample
(config-vm-temp)#secondary-disk-image \sample_location
service dns-masq
Use this command to start the DHCP service in the virtual machne.
Use the no form of this command to stop the DHCP service.
Command Syntax
service dns-masq
no service dns-masq
Parameters
None
Default
NA.
Command Mode
Virtual machine bridge mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#ip vrf VRF1
(config-vrf)#vm-bridge-create Bridge1
(config-vrf-vm-bridge)#service dns-masq
show vm
Use this command to display the status of the virtual machine.
Command Syntax
show vm (details |) (VM_NAME |)
Parameters
details
Details
VM_NAME
Name of the virtual machine
Default
NA.
Command Mode
Exec and Privileged Exec Mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#show vm
show vm-bridge
Use this command to display the bridge configuration.
Command Syntax
show vm-bridge (vrf VRF-NAME|)
Parameters
VRF-NAME
Name of the VRF
Default
NA.
Command Mode
Exec and Privileged Exec Mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#show vm-bridge
show vm-iptables
Use this command to display the IP tables.
Command Syntax
show vm-iptables (TEMPLATE_NAME | restored-iptables |)
Parameters
TEMPLATE_NAME
Name of the IP tables template
restored-iptables
 
Restored IP tables
Default
NA.
Command Mode
Exec and Privileged Exec Mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#show vm-iptables
show vm-iptables kernel
Use this command to display the kernel IP tables.
Command Syntax
show vm-iptables kernel (vrf VRF-NAME|)
Parameters
VRF-NAME
Name of the VRF
Default
NA.
Command Mode
Exec and Privileged Exec Mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#show vm-iptables kernel
show vm-nat details
Use this command to display virtual machine NAT details.
Command Syntax
show vm-nat details (vrf VRF-NAME|)
Parameters
VRF-NAME
Name of the VRF
Default
NA.
Command Mode
Exec and Privileged Exec Mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#show vm-nat details
show vm-template
Use this command to display the status of the virtual machine template.
Command Syntax
show vm-template (VM-TEMP-NAME |)
Parameters
VM-TEMP-NAME
Name of the virtual machine template
Default
NA.
Command Mode
Exec and Privileged Exec Mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#show vm-template
start vm-name
Use this command to create a virtual machine (VM) based on the template configuration.
Use the no form of this command to end a running VM.
Command Syntax
start vm-name VM_NAME vm-template TEMPLATE_NAME
no start vm-name VM_NAME
Parameters
VM-NAME
Name of the VM
TEMPLATE-NAME
Name of the VM template
Default
NA
Command Mode
Configuration Mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)# start vm-name new vm-template sample
(config)# exit
 
#configure terminal
(config)# no start vm-name new
(config)# exit
static-bind
Use this command to bind an IP address to a MAC address for the virtual machine.
Use the no form of this command to unbind an IP address from a MAC address.
Command Syntax
static-bind vm-mac-address XXXX.XXXX.XXXX ip-address A.B.C.D
no static-bind vm-mac-address XXXX.XXXX.XXXX ip-address A.B.C.D
Parameters
XXXX.XXXX.XXXX
MAC Address
A.B.C.D
IP Address
Default
NA.
Command Mode
Virtual machine bridge mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#ip vrf VRF1
(config-vrf)#vm-bridge-create Bridge1
(config-vrf-vm-bridge)#static-bind vm-mac-address ABCD.HHHH.EFGH.HHHH ip-address 10.12.65.102
stop vm-name
Use this command to stop arunning VM.
Command Syntax
stop vm-name VM_NAME
Parameters
VM-NAME
Name of the VM.
Default
NA
Command Mode
Exec Mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#stop vm-name new
vcpu count
Use this command to configure the virtual CPU count for the VM template.
Command Syntax
vcpu count <1-16>
Parameters
<1-16>
Virtual CPU count
Default
Default value is 0.
Command Mode
Virtual machine template mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#vm-template sample
(config-vm-temp)#vcpu count 16
virt-type
Use this command to set the virt-type as KVM or QEMU.
Command Syntax
virt-type (KVM | QEMU)
Parameters
KVM
Give VM
VQEMU
Give QEMU
Default
NA.
Command Mode
Virtual machine template mode
Applicability
This command was introduced before OcNOS version 1.3.5.
Example
#configure terminal
(config)#vm-template sample
(config-vm-temp)#virt-type kvm
(config-vm-temp)#virt-type qemu
virtual-nic
Use this command to set the MAC address of a virtual machine template.
Use the no form of this command to remove the MAC address.
Command Syntax
virtual-nic (vm-mac-addr XXXX.XXXX.XXXX|)(vrf VRF-NAME|)
no virtual-nic (vrf VRF-NAME|)
Parameters
XXXX.XXXX.XXXX
MAC address of the VM
VRF-NAME
VRF Name
Default
NA.
Command Mode
Virtual machine template mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#vm-template sample
(config-vm-temp)#virtual-nic vm-mac-address ABCD.HHHH.EFGH.HHHH vrf VRF1
vm-bridge-create
Use this command to create a virtual machine bridge and enter virtual machine bridge mode.
Use the no form of this command to remove a virtual machine bridge.
Command Syntax
vm-bridge-create VM-BRIDGE-NAME
no vm-bridge-create VM-BRIDGE-NAME
Parameters
VM-BRIDGE-NAME
Name of the VM bridge.
Default
NA.
Command Mode
VRF mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#ip vrf VRF1
(config-vrf)#vm-bridge-create Bridge1
(config-vrf-vm-bridge)
vm-image delete
Use this command to delete a virtual machine image.
Command Syntax
vm-image delete VM_IMAGE_LOCATION
Parameters
VM_IMAGE_LOCATION
 
Location of the virtual machine image.
Default
NA.
Command Mode
Configure mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#vm-image delete \sample_location
vm-template
Use this command to create a virtual machine template and enter VM template mode.
Use the no form of this command to remove a virtual machine template.
Command Syntax
vm-template TEMPLATE_NAME
no vm-template TEMPLATE_NAME
Parameters
TEMPLATE_NAME
Name of the VM template.
Default
NA.
Command Mode
Configuration Mode
Applicability
This command was introduced before OcNOS version 1.3.
Example
#configure terminal
(config)#vm-template sample
(config-vm-temp)#