Thank you, Laine for you time and patience to give me a detailed answer.
I missed the interfaceid parameter in the docs, but now I didn't manage
to get it working.
The docs state:
"The Open vSwitch type virtualport accepts two parameters in its
<parameters> element - an interfaceid which is a standard uuid used to
uniquely identify this particular interface to Open vSwitch (if you do
not specify one, a random interfaceid will be generated for you when you
first define the interface[...]"
This interfaceid doesn't seem to have anything to do with ovsdb values.
$ ovs-vsctl find Port 'name=vm_test'
_uuid : f0f06327-6fcc-4073-b8c8-3f42944d43ca
bond_downdelay : 0
bond_fake_iface : false
bond_mode : []
bond_updelay : 0
external_ids : {}
fake_bridge : false
interfaces : [eb7fad6e-3728-4bf7-b31e-4a1693e2ec4b]
lacp : []
mac : []
name : "vm_test"
other_config : {}
qos : []
statistics : {}
status : {}
tag : []
trunks : []
vlan_mode : []
The "_uuid" is ovsdb internal id of a record. If you take
"interfaces"
value for "interfaceid", libvirt will silently create its own new ovs
port, with its own new uuid and defining a libvirt guest's interface
with a unique uuid in "interfaceid"... Libvirt will create a new ovs
port, and the ovsdb-"interfaces" value will be the interfaceid... And I
could not find anything specific about this ovsdb/Port/interfaces.
Actually, my point was to find a way to control ovs vlans outside
libvirt. Since virsh doesn't have capabilities to edit interface's vlan
options, the only way to do it is editing domains' xml-configs through
virsh-edit, which is a bit tiresome. (By the way, there must be some
technical reason(beyond virt-xml-validate) for designing libvirt writing
it's own configuration files instead of reading them...)
There should be.. There must be a way to do this. Port parameters are
ovs authority. If there is no such way, could you, please, tell me the
reason.
On 11/21/2016 09:46 PM, Laine Stump wrote:
On 11/13/2016 01:23 PM, Ivan Borodin wrote:
> Somehow with interface types 'bridge' and 'network', libvirt does
attach
> domain to the existing port specified in <target dev=''/>, wiping the
> exixting settings and always deletes this port upon domain shutdown,
> thus making me loose ovs configuration.