evscntl - API for Elastic Virtual Switch
interface EVSController EVSInfo createEVS(string nvpropstr, string tenantname, string evsname); deleteEVS(string evsname, string tenantname); EVSInfo[] getEVSInfo(string filterstr); VPortInfo[] getVPortInfo(string filterstr); IPnetInfo[] getIPnetInfo(string filterstr); VPortStat[] getVPortStat(integer interval, integer count, string filterstr); setProperty(string nvpropstr, string host); ControllerProperty[] getProperty(string propstr, string filterstr); L2TypeIdRange[] getL2TypeIdRange(string filterstr); interface EVS setProperty(string nvpropstr); Property[] getProperty(string propstr); IPnetInfo addIPnet(string nvpropstr, string ipnetname); removeIPnet(string ipnetname); VPortInfo addVPort(string nvpropstr, string vportname); removeVPort(string vportname, string nvpropstr); resetVPort(string vportname, string nvpropstr); EVSImplInfo assignVPort(string vnicname, string hostname, string vportname, string vmpropstr); unAssignVPort(string vnicname, string hostname, string vmpropstr); interface VPort setProperty(string nvpropstr); Property[] getProperty(string propstr); interface IPnet setProperty(string nvpropstr); Property[] getProperty(string propstr);
EVSCNTL(3rad) RAD Module Definitions EVSCNTL(3rad)
NAME
evscntl - API for Elastic Virtual Switch
SYNOPSIS
interface EVSController
EVSInfo createEVS(string nvpropstr,
string tenantname,
string evsname);
deleteEVS(string evsname,
string tenantname);
EVSInfo[] getEVSInfo(string filterstr);
VPortInfo[] getVPortInfo(string filterstr);
IPnetInfo[] getIPnetInfo(string filterstr);
VPortStat[] getVPortStat(integer interval,
integer count,
string filterstr);
setProperty(string nvpropstr,
string host);
ControllerProperty[] getProperty(string propstr,
string filterstr);
L2TypeIdRange[] getL2TypeIdRange(string filterstr);
interface EVS
setProperty(string nvpropstr);
Property[] getProperty(string propstr);
IPnetInfo addIPnet(string nvpropstr,
string ipnetname);
removeIPnet(string ipnetname);
VPortInfo addVPort(string nvpropstr,
string vportname);
removeVPort(string vportname,
string nvpropstr);
resetVPort(string vportname,
string nvpropstr);
EVSImplInfo assignVPort(string vnicname,
string hostname,
string vportname,
string vmpropstr);
unAssignVPort(string vnicname,
string hostname,
string vmpropstr);
interface VPort
setProperty(string nvpropstr);
Property[] getProperty(string propstr);
interface IPnet
setProperty(string nvpropstr);
Property[] getProperty(string propstr);
DESCRIPTION
API com.oracle.solaris.rad.evscntl
This API exposes Elastic Virtual Switch (EVS) configuration and
administration to rad(1m) clients.
The following are sample python clients which illustrate some simple
interactions with the module.
Example 1. Setup the EVS controller using VLANs
Note that SSH is used as RAD transport and authentication between
the client and the EVS controller. To achieve non-interactive
communication between the client and EVS controller SSH authentication
with pre-shared public keys must be setup. Please see evsadm(1m) manpage
for more information.
import rad.client as radcli
import rad.connect as radcon
import rad.bindings.com.oracle.solaris.rad.evscntl_1 as evscntl
with radcon.connect_ssh("evs-controller-host.example.com", user="evsuser") as rc:
cntl = rc.get_object(evscntl.EVSController())
cntl.setProperty("l2-type=vlan")
cntl.setProperty("uplink-port=net2")
cntl.setProperty("vlan-range=200-300,400-500")
cntl.setProperty("uplink-port=net3", "host2.example.com")
cntl.setProperty("uplink-port=net4", "host3.example.com")
Example 2. Setup the EVS controller using VXLANs
import rad.client as radcli
import rad.connect as radcon
import rad.bindings.com.oracle.solaris.rad.evscntl_1 as evscntl
with radcon.connect_ssh("evs-controller-host.example.com", user="evsuser") as rc:
cntl = rc.get_object(evscntl.EVSController())
cntl.setProperty("l2-type=vxlan")
cntl.setProperty("vxlan-range=20000-30000")
cntl.setProperty("vxlan-addr=192.168.10.0/24")
Example 3. Create an EVS and add an IPnet, and VPort
import rad.client as radcli
import rad.connect as radcon
import rad.bindings.com.oracle.solaris.rad.evscntl_1 as evscntl
with radcon.connect_ssh("evs-controller-host.example.com", user="evsuser") as rc:
cntl = rc.get_object(evscntl.EVSController())
cntl.createEVS("maxbw=200,priority=low", "tenantA", "HR")
pat = radcli.ADRGlobPattern({"name" : "HR", "tenant" : "tenantA"})
HR = rc.get_object(evscntl.EVS(), pat)
HR.addIPnet("subnet=192.168.13.0/24", "hr_ipnet")
HR.addVPort("maxbw=300,priority=high", "vport0")
Example 4. Get the properties of an EVS
import sys
import rad.client as radcli
import rad.connect as radcon
import rad.bindings.com.oracle.solaris.rad.evscntl_1 as evscntl
with radcon.connect_ssh("evs-controller-host.example.com", user="evsuser") as rc:
cntl = rc.get_object(evscntl.EVSController())
pat = radcli.ADRGlobPattern({"name" : "HR", "tenant" : "tenantA"})
HR = rc.get_object(evscntl.EVS(), pat)
props = HR.getProperty("maxbw,priority")
for prop in props:
print "prop:%s\tcurrent:%s" % (prop.name, prop.current_value)
Example 5. Get the properties of an VPort
import sys
import rad.client as radcli
import rad.connect as radcon
import rad.bindings.com.oracle.solaris.rad.evscntl_1 as evscntl
with radcon.connect_ssh("evs-controller-host.example.com", user="evsuser") as rc:
cntl = rc.get_object(evscntl.EVSController())
pat = radcli.ADRGlobPattern({"name" : "vport0",
"evs" : "HR", "tenant" : "tenantA"})
vport0 = rc.get_object(evscntl.VPort(), pat)
props = vport0.getProperty("maxbw,priority")
for prop in props:
print "prop:%s\tcurrent:%s" % (prop.name, prop.current_value)
Example 6. Remove a VPort from an EVS
import rad.client as radcli
import rad.connect as radcon
import rad.bindings.com.oracle.solaris.rad.evscntl_1 as evscntl
with radcon.connect_ssh("evs-controller-host.example.com", user="evsuser") as rc:
cntl = rc.get_object(evscntl.EVSController())
pat = radcli.ADRGlobPattern({"name" : "HR", "tenant" : "tenantA"})
HR = rc.get_object(evscntl.EVS(), pat)
HR.removeVPort("vport0")
Example 7. Remove an IPnet from an EVS
import rad.client as radcli
import rad.connect as radcon
import rad.bindings.com.oracle.solaris.rad.evscntl_1 as evscntl
with radcon.connect_ssh("evs-controller-host.example.com", user="evsuser") as rc:
cntl = rc.get_object(evscntl.EVSController())
pat = radcli.ADRGlobPattern({"name" : "HR", "tenant" : "tenantA"})
HR = rc.get_object(evscntl.EVS(), pat)
HR.removeIPnet("hr_ipnet")
Example 8. Delete an EVS
import rad.client as radcli
import rad.connect as radcon
import rad.bindings.com.oracle.solaris.rad.evscntl_1 as evscntl
with radcon.connect_ssh("evs-controller-host.example.com", user="evsuser") as rc:
cntl = rc.get_object(evscntl.EVSController())
cntl.deleteEVS("HR","tenantA")
INTERFACES
interface EVSController
The EVSController interface is an administrative API that can be used
at EVS client to administer EVS entities including EVS, VPort, IPnet,
client config, controller config.
EVSController Methods
EVSInfo createEVS(string nvpropstr, string tenantname,
string evsname)
create an EVS
Create an EVS with the supplied name and properties.
Arguments:
nvpropstr (nullable) -- a comma-separated name-value pairs of
properties
tenantname (nullable) -- the name of Tenant
evsname (nullable) -- the name of EVS
Result:
EVSInfo
Error:
EVSError
deleteEVS(string evsname, string tenantname)
delete an EVS
Arguments:
evsname -- the name of EVS
tenantname (nullable) -- the name of Tenant
Error:
EVSError
EVSInfo[] getEVSInfo(string filterstr)
Get a list of EVS either for all the EVS managed by the EVS
controller or for the specified EVS.
Arguments:
filterstr (nullable) -- a comma-separated name-value pairs used
to filter the result
Result:
EVSInfo[] -- a list of EVS
Error:
EVSError
VPortInfo[] getVPortInfo(string filterstr)
list all VPorts or specified VPort
Arguments:
filterstr (nullable) -- a comma-separated name-value pairs used
to filter the result
Result:
VPortInfo[] -- a list of VPort
Error:
EVSError
IPnetInfo[] getIPnetInfo(string filterstr)
get a list of IPnet either for all the IPnets managed by the
EVS controller or for the specified IPnet.
Arguments:
filterstr (nullable) -- a comma-separated name-value pairs used
to filter the result
Result:
IPnetInfo[] -- a list of IPnet
Error:
EVSError
VPortStat[] getVPortStat(integer interval, integer count,
string filterstr)
get a list of stats of VPort either for all the VPort managed
by the EVS controller or for the specified VPort.
Arguments:
interval -- the interval in seconds at which statistics are
refreshed
count -- specifies the number of times that the statistics are
repeated.
filterstr (nullable) -- a comma-separated name-value pairs used
to filter the result
Result:
VPortStat[] -- a list of VPortStat
Error:
EVSError
setProperty(string nvpropstr, string host)
modifies the EVS controller's property to the value specified
Arguments:
nvpropstr -- a name-value pair of property
host (nullable) -- the property being set is applicable only to
the specified host
Error:
EVSError
ControllerProperty[] getProperty(string propstr, string filterstr)
get the current values of one or more properties for the
controller
Arguments:
propstr (nullable) -- a comma-separated name-value pairs of
properties to get
filterstr (nullable)
Result:
ControllerProperty[]
Error:
EVSError
L2TypeIdRange[] getL2TypeIdRange(string filterstr)
get the range of L2 type IDs (VLAN and VXLAN) as applicable
per-host and for rest of the hosts that do not have per-host
setting
Arguments:
filterstr (nullable) -- a comma-separated list of filters to
apply.
Result:
L2TypeIdRange[]
Error:
EVSError
interface EVS
EVS Methods
setProperty(string nvpropstr)
Sets the values of a property on the specified EVS
Arguments:
nvpropstr -- the name-value pair of property to set
Error:
EVSError
Property[] getProperty(string propstr)
Get the value for the given property or for all the properties
for the specified EVS.
Arguments:
propstr (nullable) -- a comma-separated list of EVS properties
to get
Result:
Property[] -- a list of properties
Error:
EVSError
IPnetInfo addIPnet(string nvpropstr, string ipnetname)
Add an IPnet.
Arguments:
nvpropstr -- the name-value pair of property to set
ipnetname (nullable) -- the name of IPnet
Result:
IPnetInfo
Error:
EVSError
removeIPnet(string ipnetname)
remove an IPnet
Arguments:
ipnetname -- the name of IPnet
Error:
EVSError
VPortInfo addVPort(string nvpropstr, string vportname)
add a VPort
Arguments:
nvpropstr (nullable) -- a comma-separated name-value pair of
properties
vportname (nullable) -- the name of VPort
Result:
VPortInfo -- the information of EVS where we add the VPort to
Error:
EVSError
removeVPort(string vportname, string nvpropstr)
remove a VPort from an EVS
Arguments:
vportname -- the name of VPort
nvpropstr (nullable) -- a comma-separated name-value pairs of
properties
Error:
EVSError
resetVPort(string vportname, string nvpropstr)
Reset a VPort to idle status. Will delete the VPort if the
VPort is generated by system.
Arguments:
vportname -- the name of VPort
nvpropstr (nullable) -- a comma-separated name-value pairs of
properties
Error:
EVSError
EVSImplInfo assignVPort(string vnicname, string hostname,
string vportname, string vmpropstr)
assign a VNIC to a VPort with the supplied EVS name, VPort name
and Tenant name
Arguments:
vnicname -- the name of VNIC to connect with the VPort
hostname -- the name of the host where the vnic is created
vportname (nullable) -- the name of VPort to assign
vmpropstr (nullable) -- a name-value pair of property
Result:
EVSImplInfo -- the EVS of the assigned VPort
Error:
EVSError
unAssignVPort(string vnicname, string hostname, string vmpropstr)
unassign a VNIC from a VPort
Arguments:
vnicname -- the name of vnic connected to a VPort
hostname -- the name of host where the vnic is created
vmpropstr (nullable) -- a name-value pair of property
Error:
EVSError
interface VPort
VPort Methods
setProperty(string nvpropstr)
Sets the value of a property on the specified VPort
Arguments:
nvpropstr -- a name-value pair of property
Error:
EVSError
Property[] getProperty(string propstr)
Get the value for the given property or for all the properties
for the specified VPort.
Arguments:
propstr (nullable) -- a comma-separated list of VPort
properties to get
Result:
Property[] -- list of VPort property information
Error:
EVSError
interface IPnet
IPnet Methods
setProperty(string nvpropstr)
Sets the value of a property on the specified IPnet
Arguments:
nvpropstr -- a name-value pair of property
Error:
EVSError
Property[] getProperty(string propstr)
Get the value for the given property or for all the properties
for the specified IPnet.
Arguments:
propstr (nullable) -- a comma-separated list of IPnet
properties to get
Result:
Property[] -- list of IPnet property information
Error:
EVSError
ENUMERATED TYPES
enum EVSStatus -- the status of EVS
IDLE (0) -- EVS has no VPort in use
BUSY (1) -- EVS has at least one VPort in use
enum VPortStatus -- the status of VPort
FREE (0) -- VPort is not assigned
USED (1) -- VPort is assigned to a vnic
enum Permission -- permission of properties
READ (1) -- read permission
WRITE (2) -- write permission
READWRITE (3) -- read and write permission
enum IPVersion -- the IP version
IPV4 (0) -- IPv4
IPV6 (1) -- IPv6
STRUCTURE TYPES
struct EVSError
Fields:
integer err
string errmsg
struct PropertyNV
Property name and its value
Fields:
string name -- the name of property
string value (nullable) -- the current value of property
struct Property
Detailed information about a property.
Fields:
string name -- the name of property
Permission permission -- permission to read/wirte the property
string current_value (nullable) -- the current value of property
string effective_value (nullable) -- the effective value of
property
string default_value (nullable) -- the default value of property
string possible_values (nullable) -- the comma-separated list of
values the property can have.
struct IPnetInfo
IPnet. The networking configuration of an EVS which includes the
permissible IPv4 or IPv6 addresses along with the default router.
Fields:
string name -- the name of IPnet
string uuid -- the UUID of IPnet
string evsname -- the name of EVS
string evsuuid -- the UUID of EVS
string tenantname -- the name of the Tenant
PropertyNV[] props -- the properties of IPnet
string start -- start address of ip address range
string end -- end address of ip address range
string range -- a comma-separated list of available IP addresses
that can be assigned to VPort
IPVersion ipvers -- the IP version of IPnet
struct VPortInfo
Virtual Port. The configuration parameters of a EVS part which are
to be inherited by VNICs connected to the EVS.
Fields:
string name -- the name of VPort
string uuid -- the UUID of VPort
string evsname -- the name of EVS
string evsuuid -- the UUID of EVS associated with this VPort
string tenantname -- the name of EVS' Tenant
VPortStatus status -- the status of VPort
string vnicname -- name of the VNIC associated with the VPort
PropertyNV[] props -- the properties of VPort
string hostname -- the host that has the VNIC associated with the
VPort
struct EVSInfo
Elastic Virtual Switch. A software implentation of a Layer-2 switch
which facilitates inter-communication between Virtual Machines
connected to it.
Fields:
string name -- the name of EVS
string uuid -- the UUID of EVS
string tenantname -- name of the Tenant that owns the EVS
PropertyNV[] props -- the properties of EVS
EVSStatus status -- the status of EVS, could be idle or busy
VPortInfo[] vports (nullable) -- the VPort(s) associated with EVS
IPnetInfo[] ipnets (nullable) -- the IPnet associated with EVS
struct EVSImplInfo
Elastic Virtual Switch. A software implentation of a Layer-2 switch
which facilitates inter-communication between Virtual Machines
connected to it. Includes the detailed information of Layer-2
network configuration.
Fields:
EVSInfo evsinfo -- general information of EVS
string uplink_port -- datalink to be used for VLANs or for VXLANs
string vxlan_localaddr -- IP address on top of which VXLAN datalink
should be created
string vxlan_mgroup -- multicast address that needs to be used
while creating VXLAN links
string vxlan_ipvers -- IP version of the address that must be used
for the IP interface that will host VXLAN datalinks
struct VPortStat
VPort stats
Fields:
string vportname -- the name of VPort
string evsname -- the name of EVS
string tenantname -- the name of Tenant that owns the EVS
string vnicname (nullable) -- name of the VNIC associated with the
VPort
string hostname (nullable) -- the host that has the VNIC associated
with the VPort
ulong rbytes -- number of incoming byte
ulong ipackets -- number of incoming packet
ulong idrops -- number of incoming packet dropped
ulong idropbytes -- number of incoming bytes dropped
ulong obytes -- number of outgoing byte
ulong opackets -- number of outgoing packet
ulong odrops -- number of outgoing packet dropped
ulong odropbytes -- number of outgoing byte dropped
integer errcode -- EVS err code
struct ControllerProperty
Specifies a Controller Property
Fields:
string name -- the name of property
Permission permission -- permission to read/wirte the property
string current_value -- the value of property
string default_value (nullable) -- the default value of property
string host (nullable) -- the hostname for host-specific property
struct L2TypeIdRange
Captures the L2 Type (VLAN and VXLAN) ID range -- for a host and
(uplink-port or vxlan-addr) -- for rest of the hosts that do not
have per-host setting
Fields:
string name -- the name of property: uplink-port or vxlan-addr
string value -- the value of property
string host (nullable) -- the name of the host
PropertyNV[] range -- List of range values. Currently covers
vlan-range and vxlan-range.
Version: (1.2)
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-------------------------+
|Availability | system/management/rad/* |
+--------------------+-------------------------+
|Interface Stability | Private |
+--------------------+-------------------------+
SEE ALSO
rad(1M)
SunOS 5.11 2017-01-30 EVSCNTL(3rad)