CLI Command Overview - containernet/vim-emu GitHub Wiki

This page summarized available CLI (vim-emu) commands.

vim-emu datacenter

positional arguments:
  {list,status}         Action to be executed.

optional arguments:
  -h, --help            show this help message and exit
  --datacenter DATACENTER, -d DATACENTER
                        Data center to which the command should be applied.
  --endpoint ENDPOINT, -e ENDPOINT
                        REST API endpoint of vim-emu
                        (default:http://127.0.0.1:5001)
Command/Example Description
vim-emu datacenter list List all data centers of running topology
vim-emu datacenter status -d <dc-label> Get status data of DC

vim-emu compute

positional arguments:
  {start,stop,list,status,xterm}
                        Action to be executed.
  vnf_names             vnf names to open an xterm for

optional arguments:
  -h, --help            show this help message and exit
  --datacenter DATACENTER, -d DATACENTER
                        Data center to which the command should be applied.
  --name NAME, -n NAME  Name of compute instance e.g. 'vnf1'.
  --image IMAGE, -i IMAGE
                        Name of container image to be used e.g. 'ubuntu:trusty'
  --dcmd DOCKER_COMMAND, -c DOCKER_COMMAND
                        Startup command of the container e.g. './start.sh'
  --net NETWORK         Network properties of a compute instance 
                        e.g. '(id=input,ip=10.0.10.3/24),(id=output,ip=10.0.10.4/24)' 
                        for multiple interfaces.
  --endpoint ENDPOINT, -e ENDPOINT
                        REST API endpoint of vim-emu (default:http://127.0.0.1:5001)
Command/Example Description
vim-emu compute start -d DC1 -n vnf1 Start a container vnf1 in DC1, returns the status info of the container
vim-emu compute start -d DC1 -n vnf1 -i firewall -c ./start.sh start Docker image 'firewall' with startup script './start.sh' '
vim-emu compute start -d DC1 -n vnf1 --image ubuntu --net '(id=input,ip=10.0.0.123/8)' More options: define id, ip per interface (eg. specify interface options defined in descriptor)
vim-emu compute start -d DC1 -n vnf1 --image ubuntu --net '(id=input,ip=10.0.0.123/8),(id=output1,ip=11.0.0.123/24),(id=output2,ip=12.0.0.123/8)' Multiple interfaces
vim-emu compute stop -d DC1 -n vnf1 Stop container vnf1
vim-emu compute list List info about all running containers
vim-emu compute status -d DC1 -n vnf1 Get status info of vnf1
vim-emu compute xterm vnf1 vnf2 start an xterm window that attaches to the CLI of the vnf docker container (does not work yet when accessing vim-emu running in an isolated VM)

vim-emu network

positional arguments:
  {add,remove}          Action to be executed.

optional arguments:
  -h, --help            show this help message and exit
  --datacenter DATACENTER, -d DATACENTER
                        Data center to in which the network action should be
                        initiated
  --source SOURCE, -src SOURCE
                        vnf name of the source of the chain
  --destination DESTINATION, -dst DESTINATION
                        vnf name of the destination of the chain
  --weight WEIGHT, -w WEIGHT
                        weight edge attribute to calculate the path
  --priority PRIORITY, -p PRIORITY
                        priority of flow rule
  --match MATCH, -m MATCH
                        string holding extra matches for the flow entries
  --bidirectional, -b   add/remove the flow entries from src to dst and back
  --cookie COOKIE, -c COOKIE
                        cookie for this flow, as easy to use identifier (eg.
                        per tenant/service)
  --endpoint ENDPOINT, -e ENDPOINT
                        REST API endpoint of vim-emu
                        (default:http://127.0.0.1:5001)
Command/Example Description
vim-emu network add -src vnf1:intf1 -dst vnf2:intf2 Setup a directional path from vnf1, interface 1 to vnf2, interface 2. This calculates the shortest path and sets the OpenFlow entries in the datacenters' switches accordingly.
vim-emu network add -src vnf1:intf1 -dst vnf2:intf2 -b Setup a bidirectional path from vnf1, interface 1 to vnf2, interface 2 (this sets the openflow entries in the datacenters' switches accordingly).

vim-emu monitor (deprecated)

positional arguments:
  {setup_metric,stop_metric,setup_flow,stop_flow,prometheus}
                        setup/stop a metric/flow to be monitored or query
                        Prometheus

optional arguments:
  -h, --help            show this help message and exit
  --vnf_name VNF_NAME, -vnf VNF_NAME
                        vnf name:interface to be monitored
  --metric METRIC, -m METRIC
                        tx_bytes, rx_bytes, tx_packets, rx_packets
  --cookie COOKIE, -c COOKIE
                        flow cookie to monitor
  --query QUERY, -q QUERY
                        prometheus query
  --datacenter DATACENTER, -d DATACENTER
                        Data center where the vnf is deployed
  --endpoint ENDPOINT, -e ENDPOINT
                        REST API endpoint of vim-emu
                        (default:http://127.0.0.1:5001)
Command/Example Description
vim-emu monitor setup_metric -vnf vnf1:intf1 --metric tx_packets Initializes vim-emu to export port statistics of vnf 'vnf1', interface 'intf1' to a Prometheus push gateway. Possible metrics: tx_bytes, rx_bytes, rx_packets, tx_packets
vim-emu monitor stop_metric -vnf vnf1:intf1 --metric tx_packets Stops the export of previously started metrics
vim-emu monitor setup_flow -vnf vnf1:input --metric tx_packets --cookie 10 Export to a Prometheus pushgateway the transmitted packets count of the flow with cookie = 10. The monitored flow inputs to the port where the interface 'input' of 'vnf1' is connected to
vim-emu monitor stop_flow -vnf vnf1:input --metric tx_packets --cookie 10 Stop exporting the transmitted packets count of the flow with cookie = 10. The monitored flow inputs to the port where the interface 'input' of 'vnf1' is connected to
⚠️ **GitHub.com Fallback** ⚠️