R2.20 Build 25 Ubuntu 14.04 Juno multi-node setup
On vn vn-02899298, we set the flood-unknown-unicast flag to true.
In config node, it is set correctly as True on the VN, but in control-node and agent, the flag is still false
http://nodec2:8083/Snh_SandeshTraceRequest?x=IFMapBigMsgTraceBuf shows True for this flag:
"2015-05-21 10:56:28.546 IFMapServerConnectionTrace: 0 bytes in reply_. 3428 bytes in reply_str. PollResponse message is: HTTP/1.1 200 Content-Type: application/soap+xml Content-Length: 3353 <?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns3:Envelope xmlns:ns2="http://www.trustedcomputinggroup.org/2010/IFMAP/2" xmlns:ns3="http://www.w3.org/2003/05/soap-envelope"><ns3:Body><ns2:response><pollResult><updateResult name="root"><resultItem><identity name="contrail:virtual-network:default-domain:TestTor-12621274:vn-02899298" type="other" other-type-definition="extended"/><identity name="contrail:network-ipam:default-domain:default-project:default-network-ipam" type="other" other-type-definition="extended"/><metadata><contrail:virtual-network-network-ipam xmlns:contrail="http://www.contrailsystems.com/vnc_cfg.xsd" ifmap-cardinality="singleValue" ifmap-publisher-id="api-server-1--0000000001-1" ifmap-timestamp="2015-05-21T10:56:28+05:30"><ipam-subnets><subnet><ip-prefix>49.52.230.0</ip-prefix><ip-prefix-len>24</ip-prefix-len> </subnet><default-gateway>49.52.230.1</default-gateway><dns-server-address>49.52.230.2</dns-server-address><subnet-uuid>07aabfb3-2b2b-4b4e-a498-b31454d54668</subnet-uuid><enable-dhcp>true</enable-dhcp><addr_from_start>true</addr_from_start><dhcp-option-list><dhcp-option><dhcp-option-name>6</dhcp-option-name><dhcp-option-value>0.0.0.0</dhcp-option-value> </dhcp-option> </dhcp-option-list><host-routes/></ipam-subnets></contrail:virtual-network-network-ipam></metadata></resultItem><resultItem><identity name="contrail:virtual-network:default-domain:TestTor-12621274:vn-02899298" type="other" other-type-definition="extended"/><metadata><contrail:flood-unknown-unicast xmlns:contrail="http://www.contrailsystems.com/vnc_cfg.xsd" ifmap-cardinality="singleValue" ifmap-publisher-id="api-server-1--0000000001-1" ifmap-timestamp="2015-05-21T10:56:28+05:30">True</contrail:flood-unknown-unicast></metadata></resultItem><resultItem><identity name="contrail:virtual-network:default-domain:TestTor-12621274:vn-02899298" type="other" other-type-definition="extended"/><identity name="contrail:network-policy:default-domain:TestTor-12621274:default-analyzer-ana1-policy" type="other" other-type-definition="extended"/><metadata><contrail:virtual-network-network-policy xmlns:contrail="http://www.contrailsystems.com/vnc_cfg.xsd" ifmap-cardinality="singleValue" ifmap-publisher-id="api-server-1--0000000001-1" ifmap-timestamp="2015-05-21T10:56:28+05:30"><sequence><major>0</major><minor>0</minor></sequence><timer><start-time/></timer></contrail:virtual-network-network-policy></metadata></resultItem><resultItem><identity name="contrail:virtual-network:default-domain:TestTor-12621274:vn-02899298" type="other" other-type-definition="extended"/><metadata><contrail:id-perms xmlns:contrail="http://www.contrailsystems.com/vnc_cfg.xsd" ifmap-cardinality="singleValue" ifmap-publisher-id="api-server-1--0000000001-1" ifmap-timestamp="2015-05-21T10:56:28+05:30"><permissions><owner>admin</owner><owner-access>7</owner-access><group>KeystoneAdmin</group><group-access>7</group-access><other-access>7</other-access></permissions><uuid><uuid-mslong>4711378623372806750</uuid-mslong><uuid-lslong>11190990926001937359</uuid-lslong></uuid><enable>true</enable><created>2015-05-21T03:19:59.739947</created><last-modified>2015-05-21T05:26:28.477746</last-modified><user-visible>true</user-visible></contrail:id-perms></metadata></resultItem></updateResult></pollResult></ns2:response></ns3:Body></ns3:Envelope> controller/src/ifmap/client/ifmap_channel.cc 585
"
In control-node ifmap db, it is false :
http://nodec1:8083/Snh_IFMapTableShowReq?table_name=&search_string=
"<iq>
<virtual-network-properties>
<allow-transit>false</allow-transit>
<network-id>0</network-id>
<vxlan-network-identifier>4</vxlan-network-identifier>
<forwarding-mode>l2_l3</forwarding-mode>
<rpf></rpf>
</virtual-network-properties>
<virtual-network-network-id>4</virtual-network-network-id>
<route-target-list>
<route-target>target:64512:5000</route-target>
</route-target-list>
<router-external>false</router-external>
<is-shared>false</is-shared>
<flood-unknown-unicast>false</flood-unknown-unicast>
<id-perms>
<permissions>
<owner>admin</owner>
<owner-access>7</owner-access>
<group>KeystoneAdmin</group>
<group-access>7</group-access>
<other-access>7</other-access>
</permissions>
<uuid>
<uuid-mslong>4711378623372806750</uuid-mslong>
<uuid-lslong>11190990926001937359</uuid-lslong>
</uuid>
<enable>true</enable>
<created>2015-05-21T03:19:59</created>
<last-modified>2015-05-21T05:54:09</last-modified>
<description></description>
<user-visible>true</user-visible>
<creator></creator>
</id-perms>
<display-name>vn-02899298</display-name>
</iq>"
Currently, if config sets a boolean value in any node, we receive the right value in the incoming ifmap packet. But, the autogen code does not set the field with the incoming value.
Here is an example from today's codebase:
bool IsShared_ ParseMetadata( const pugi::xml_node &parent, std::auto_ ptr<AutogenProp erty > *resultp) { ork::OolPropert y *data = new VirtualNetwork: :OolProperty( ); >reset( data);
<<<<< <<<<<<< <<<<< we should set data->data from the value in parent here.
VirtualNetw
resultp-
return true;
}
Here is the XML: www.contrailsys tems.com/ vnc_cfg. xsd" ifmap-cardinali ty="singleValue " ifmap-publisher -id="api- server- 1--0000000001- 1" ifmap-timestamp ="2015- 05-22T09: 25:59-07: 00"> is-shared>
<contrail:is-shared xmlns:contrail="http://
False
</contrail:
Fixed autogen-code will look like:
bool IsShared_ ParseMetadata( const pugi::xml_node &parent, std::auto_ ptr<AutogenProp erty > *resultp) { ork::OolPropert y *data = new VirtualNetwork: :OolProperty( ); >reset( data); text(). as_bool( );
VirtualNetw
resultp-
data->data = parent.
return true;
}
(gdb) p parent.type()
$11 = pugi::node_element
(gdb) p child.type()
$12 = pugi::node_pcdata
(gdb) p parent.value()
$13 = (const pugi::char_t *) 0xecf7c5 ""
(gdb) p child.value()
$14 = (const pugi::char_t *) 0x7f376576c66d "True"
The documentation says:
You can get the text object from a node by using text() method. If the node has a type node_pcdata or node_cdata, then the node itself is used to return data; otherwise, a first child node of type node_pcdata or node_cdata is used.
as_bool converts attribute value to boolean as follows: if attribute handle is null, def argument is returned (which is false by default). If attribute value is empty, false is returned. Otherwise, true is returned if the first character is one of '1', 't', 'T', 'y', 'Y'. This means that strings like "true" and "yes" are recognized as true, while strings like "false" and "no" are recognized as false.