-
Notifications
You must be signed in to change notification settings - Fork 6
openvim usage
This page is obsolete.
The project OpenVIM, as well as OpenMANO, has been contributed to the open source community project Open Source MANO (OSM), hosted by ETSI.
Go to the URL osm.etsi.org to know more about OSM.
#Table of Contents#
##Getting help##
$ ./openvim -h
usage: openvim [-h] [--version]
{
config,
image-list,image-create,image-delete,image-edit,
vm-list,vm-create,vm-delete,vm-edit,vm-shutdown,vm-start,vm-rebuild,vm-reboot,vm-createImage,
port-list,port-create,port-delete,port-edit,port-attach,port-detach,
host-list,host-add,host-remove,host-edit,host-up,host-down,
net-list,net-create,net-delete,net-edit,net-up,net-down,
flavor-list,flavor-create,flavor-delete,flavor-edit,
tenant-list,tenant-create,tenant-delete,tenant-edit,
openflow-port-list,openflow-clear-all,openflow-net-reinstall,openflow-net-list
}
You can get additional help for each command by running:
$ ./openvim <command> --help
##General commands##
$ ./openvim -h|--help # show help message and exit
$ ./openvim --version # show program's version number and exit
$ ./openvim config # prints configuration values
##Setting environment variables##
The easiest way to extract this information is from the configuration file openvim server is using (openvimd.cfg)
$ ./openvim config openvimd.cfg # extract and prints configuration variables
export OPENVIM_HOST=localhost
export OPENVIM_PORT=9080
export OPENVIM_ADMIN_PORT=9085
export OPENVIM_TENANT=fc7b43b6-6bfa-11e4-84d2-5254006d6777
Then you can copy and execute the export commands directly in the shell. Also you can add this lines directly to your .bashrc for automatic configuration:
$ ./openvim config file.cfg >> /home/${USER}/.bashrc
You will need to set manually the OPENVIM_TENANT variable with one of the tenants showed with 'openvim tenant-list'; or the tenant create with 'openvim tenant-create'
##Basic actions## openvim acts over the following items:
- tenants: a tenant is like a project. All Flavors, VMs, images depend from a concrete tenant
- vms: virtual machines or servers. See Instances management
- images: disk images to be use for a virtual machine. See Images management
- flavors: description of virtual machines requirement regarding number of cpus, memory, nics,... See Flavors management
- hosts: every one of the compute node to host virtual machines. See Hosts management
- networks: public or tenant-associated layer 2 networks. Openvim does not use subnetworks concept. See Networks and ports mananement
- ports: a port is VM interface. Also "external" ports are used for connecting networks to external openflow switch ports. See Networks and ports mananement
for every item openvim can make the following actions
-
list: list of items with the uuid and name.
- ... name/uuid shows the items with this name or uuid
- level of verbosity can be increased with -v,-vv, or -vvv.
- -F 'A=B[&C=D]' allows filter those than parameter A equals to B and C equals to D
-
delete: remove this item (for host use remove instead)
- ... name/uuid delete those with this name or uuid
- -f force so that it is not ask for confirmation
- -F 'A=B[&C=D]' allows filter those than parameter A equals to B and C equals to D
- create: creates a new item (for host use add instead). It can be followed by a yaml/json file, or a yaml/json text. If empty user is interactively interrogated for the needed parameters to complete the action
- edit: edit a parameter of the item. It must be followed by the name/uuid and a yaml/json file, or a yaml/json text with the parameters to edit.
##Hosts management## Host can be managed using the OPENVIM_ADMIN_PORT API. Adding a compute node can be done with only providing the name and the IP address (or DNS name). But previously the compute node must be configured using this guidelines. In test mode fake hosts can be added providing all the needed information in the yaml/json file. You can see examples at test/hosts/host-example?.json files.
Previously to add a host, you must indicate where the dataplane NIC interfaces of this hosts (to be used by virtual machines as SRIOV or passthrough) are connected to the openflow switch. For that, fill the database_utils/of_ports_pci_correspondence.sql file with the compute pci interfaces and switch port before addig the host; and load into the database with
$ mysql -uvim -p vim_db << database_utils/of_ports_pci_correspondence.sql
To add a compute node use:
$ ./openvim host-add [file-description]
To remove a compute node use:
$ ./openvim host-remove <host> # host must not contain any virtual machine
To see the description of a host
$ ./openvim host-list <host> -vvv
You can prevent openvim to use a compute node by putting it administratively down/up with
$ ./openvim host-down <host>
$ ./openvim host-up <host>
Also a concrete numa from a compute node can be put administratively down/up with the host-edit command:
$ ./openvim host-edit <host> '{"numas": [{"numa_socket": 0, "admin_state_up": false}]}'
Images must be preloaded into a shared compute node folder. After that edit the template file (openvim/templates/images.yaml) and load into openvim with:
$ ./openvim image-create <file>
#note that openvim does not check image path here, but at the virtual machine creation
Formats admitted can be .qcow2 and .img
Optionally you can add metadata to indicate extra information. The most importantant are:
- use_incremental : openvim creates and incremental image by default. You can avoid setting it to "no"
- os_type: by default linux is assumed, you can indicates windows operating system
- bus: by default disk bus type is virtio for linux, or ide for windows. You can set other type here
Flavors are openstack-like, but with an "extended" field that can impose extrict numa settings. See carefully the template file at templates/flavor.yaml for a description
##Networks and Ports management## Openvim considers the networks as a layer 2 network. In this version no ip management is done, so this must be resolved manually for every virtual machine. Openvim distinguishes between control networks (bridge_data or bridge_man) and openflow or dataplane networks (ptp or data).
The control networks uses the pre-created compute host bridge networks (virbrMan). The difference between bridge_data and bridge_man are that openvim tries to allocate those bridge interfaces with more bandwidth to bridge_data. But there is not any bandwidth guarantee.
The dataplane networks uses the openflow switch and controller to create point to point (ptp) or point to multipoint (data) networks. These networks can be connected to an external switch port by inserting an openvim "external" port (with the field "binding:switch_port" set to the physical switch port), and attaching this port to the network.
Networks can be put administratively down/up with commands
$ ./openvim net-up <network>
$ ./openvim net-down <network>
Regarding ports, they represents the virtual machines interfaces and "external" switch connections. The first one can not be created neither deleted because they are created and deleted with the virtual machine live cycle. However they can be edited, for example dataplane interfaces can be reconnect to a different network if desired. The "external" ports can be created/deleted using OPENVIM_ADMIN_PORT API (used automatically by openvim client). To connect/disconnect a port to/from a network you can use the commnads:
$ ./openvim port-attach <port> <net>
$ ./openvim port-detach <port>
For creating a Virtual machines, an image, flavor must be present. Appart from creation and deletion, the following ations can be done:
- vm-shutdown: to send an acpi shutdown command
- vm-start: to run a paused or not running machine
- vm-rebuild: to create again a virtual machine. Needed if machine is in error status
- vm-reboot: reboot
- vm-creteImage: creates a new image. You need to suply extra parameters, name is mandatary, the others are optional $ ./openvim vm-createImage ' {"createImage": {"name": "imageName", "description":"image description", "path":"/mnt/powervault/virtualization/vnfs/backup/fileName.qcow2"} } '
openvim server is running with the openvimd.py file. It is advise to run it inside a screen. You can obtain help with
$ ./openvimd.py -h
By default it loads the ./openvimd.cfg configuration file. See this file openvimd.cfg for a complete description of the running configuration