ODL configuration netconf server fails - opendaylight

I am a newbie to OpenDaylight. I am going to configure an interface through the RESTAPI. Here it is my following API:
http://localhost:8181/restconf/operations/network-topology:network-topology/topology/topology-netconf/node/new-netconf-device/yang-ext:mount/ietf-netconf:edit-config
This is my xml code:
<input xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<target>
<running/>
</target>
<config>
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<interface>
<name>host-vpp1out</name>
<description>Ethernet</description>
<type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-
type">ianaift:ethernetCsmacd</type>
<ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
<enabled>true</enabled>
<address>
<ip>10.80.17.54</ip>
<prefix-length>24</prefix-length>
</address>
</ipv4>
<enabled>true</enabled>
</interface>
</interfaces>
</config>
</input>
However, I receive an Error from remote netconf server
[ERR] unknown element interface /
when I see the MSG from netconf server odl remove the namespaces from xml.
I really appreciate if you can help me with this issue.

Related

Desktop Windows App to include capabilities

I am trying to test the newer Geolocation API (in place of the older ILocation COM API), which is a WinRT API.
I 've followed instructions from here to allow a normal C++ desktop Win32 app to call Windows 10 RT functions. It works normally in my tests.
However, for location, I must include a capability in a XML file as discussed here.
How am I supposed to create this XML file? I tried creating a file like this:
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
<Capabilities>
<!-- DeviceCapability elements must follow Capability elements (if present) -->
<DeviceCapability Name="location"/>
</Capabilities>
<Identity Name=""
Version=""
Publisher="" />
<Properties>
<DisplayName></DisplayName>
<PublisherDisplayName></PublisherDisplayName>
<Logo></Logo>
</Properties>
<Prerequisites>
<OSMinVersion></OSMinVersion>
<OSMaxVersionTested></OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="" />
</Resources>
<Applications>
<Application Id="" StartPage="">
<VisualElements DisplayName="" Description=""
Logo="" SmallLogo=""
ForegroundText="" BackgroundColor="">
<SplashScreen Image="" />
</VisualElements>
</Application>
</Applications>
</Package>
I am not sure what to do from now on. Is there a compiler setting that would tell the compiler/linker to include this appxmanifest file?
Thanks

How to boot up from CDROM(ISO image) to install the guest OS using virsh

UPDATE on Oct. 4th, 2017: See my answer below. The credit goes to DanielB as I wouldn't have solved the problem without Daniel's help, so I'll accept his answer instead of my own.
I'm a novice in libvirt as well as system administration so excuse me if I'm asking stupid questions, though I've tried to do as much homework as possible beforehand.
My question is: How to boot up from CDROM to install the guest OS right after creating a VM using virsh?
I'm working on Ubuntu Desktop 14.04, virsh 1.2.2.
When I used 'virt-install' and passed the ISO file path as its '--cdrom' argument, I could successfully bring up the virt-viewer window which allowed me to go through the guest OS installation.
As I know I can also create a VM using an XML definition, I dumped the XML definition of the VM which I created using 'virt-install'. I then expected that the 'virt-viewer' window would be brought up automatically when I started the VM so I could install the guest OS. But it didn't.
Below is the XML definition of my VM.
If I enable the loader line, as I marked as "suspicious" below, I would get an error message of "error: internal error: cannot load AppArmor profile 'libvirt-1092d51d-3b66-46a2-bf9b-71e13dc91799'". I did that because I was trying the example given in libvirt's document here.
However, if I disable the "loader" line, and ran virsh create def_domain_test.xml, the domain can be created successfully and is shown as 'running', but the virt-viewer window is not brought up, so I can't install the guest OS on the VM.
Could anyone help me on that? I don't understand why 'virt-install' can bring up the virt-viewer but my XML definition can't. I probably mis-configured the domain XML definition but I couldn't figure out which specific part I was wrong even if I'd tried to read as much documentation as possible.
Feel free to ask for more details if needed.
<!-- Let's call this file 'def_domain_test.xml' -->
<domain type='kvm'>
<name>vm_c2</name>
<memory unit='KiB'>2097152</memory>
<currentMemory unit='KiB'>2097152</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
<!-- Next line is suspicious! -->
<!-- <loader readonly='yes' secure='no' type='rom'>/usr/lib/xen-4.4/boot/hvmloader</loader> -->
<boot dev='cdrom'/>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/kvm-spice</emulator>
<!-- Here is the hard drive that doesn't have OS installed. -->
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/home/me/me/testing/vm/pool/mvs_vol_c2'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<!-- Here is the Ubuntu ISO. -->
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/home/me/me/testing/vm/ubuntu-14.04.5-server-amd64.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<alias name='ide0-1-0'/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'/>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='network'>
<source network='default'/>
<model type='rtl8139'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</memballoon>
</devices>
</domain>
virsh is a very low level tool whose commands direct map to individual libvirt API calls. A installation done by virt-install will make many API calls to accomplish its job. So just taking the final XML of the installed guest and passing it to virsh define is not equivalant.
For a start, virt-install will usually change the XML - it first creates a transient guest will an XML doc suitable for booting off the CDROM, and after that completes it'll change the XML to boot off the disk instead. virt-install will manually launch virt-viewer to display the console, which is not something virsh does.
That particular <loader> line should never be used with KVM - it is only relevant for Xen - by using that you've told KVM to run Xen paravirt code as its BIOS instead of SeaBIOS - this will certainly crash & burn.
If you use the '--debug' arg to virt-install you'll see details of what it does at each step. You could also set LIBVIRT_LOG_FILTERS=1:libvirt and LIBVIRT_LOG_OUTPUTS=1:stderr if you want to see details of every libvirt API call made.
Thanks for DanielB's help! The '--debug' argument of virt-install does reveal the information I need to solve this problem.
First of all, in the XML definition, I don't need the <loader> line. The <os> section should be:
<os>
<type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
<boot dev='cdrom'/>
<boot dev='hd'/>
</os>
The two <boot> tags already specify the order of booting.
Secondly, virt-install's debug output suggests the desired way to bring up virt-viewer:
Run: virt-viewer --connect=qemu:///system --wait vm_c2
Optionally, you can add '--debug' and '--verbose' to virt-viewer to see more output.
At this moment, the viewer window should be brought up and a message is shown: Waiting for guest domain to be created.
Run: virsh create --file def_domain_test.xml.
The viewer would now be activated and display the output of the VM.
Here is one caveat which caused me to get stuck at the beginning: You don't have to start virt-viewer prior to the VM. However, if you start VM first and then the viewer, the viewer screen may be a whole black one which may confuse you and make you think nothing is happening there. In this case, click the viewer window to let it get the input focus, then press 'Enter' key and you may get it refreshed and see what is there actually. (Resizing the window doesn't force it to refresh.)
FYI: If you output the virt-viewer's debug messages, you may see a message like this:
(virt-viewer:6296): virt-viewer-DEBUG: Error operation forbidden: read only access prevents virDomainOpenGraphics
This doesn't seem to cause me any problems, but maybe it's the hint of other problems if virt-viewer doesn't work correctly for you.

processing jms message in wso2 esb

I have the JMS message as
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<content>
<entry type="1">
<textMessage JMSDeliveryMode="2" JMSDestination="queue:///QUEUE" JMSExpiration="0" JMSMessageID="ID:c3e2d840d8e3c1f14040404040404040cf1eba01c4eff036" JMSPriority="4" JMSRedelivered="false" JMSTimestamp="1434705226223" fromQueue="true" codec="Base64">
<text>dGVzdA==</text>
</textMessage>
</entry>
</content>
but when i pull it into wso2 esb it gets into soap envelope and i'm not able to retrieve the properties over here, like JMSDestination etc.
I want to read those details in WSO2 ESB. Is there a way?
I get the following SOAP message after getting the message from JMS, and it is logging or the xPath works only on this.
[2015-06-22 11:08:33,632] INFO - LogMediator To: , WSAction: urn:mediate, SOAPA
ction: urn:mediate, MessageID: ID:c3e2d840d8e3c1f14040404040404040cf224f7f3bbf47
25, Direction: request, Envelope: <?xml version="1.0" encoding="utf-8"?><soapenv
:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Bod
y>test1</soapenv:Body></soapenv:Envelope>
Thanks
I'm setting the JMS headers in my sending proxy like this.
In the receiving proxy, you can then access the property with get-property like in the following example.
<log level="custom">
<property name="Autodeploy_TSONL_CreateProxyTarget - Config Params transport intervall "
expression="get-property('transport','TRANSPORT_TRANSFERINTERVALL')"/>
Hope that helps.
You can select any information from the message body (even if there is a soap envelope for internal purposes) with the following code in your inSequence:
<property name="JMSDestination" expression="$body/content/entry/textMessage/#JMSDestination"/>
Verify that your message is being build with an appropriate message builder, otherwise you can't see the message content. See this JMS Proxy example:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="JMSProxyName" transports="jms" startOnLoad="true" trace="disable">
<target>
<inSequence>
<log level="custom">
<property name="Log JMSDestination" expression="$body/content/entry/textMessage/#JMSDestination"/>
</log>
<drop/>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>contentType</jmsProperty>
<default>application/xml</default>
</rules>
</parameter>
<parameter name="transport.jms.Destination">YourQueue</parameter>
</proxy>

WSO2ESB Simple Passthrough Proxy doesnt forward the url extensions

I implemented a simple pass through proxy i.e. when i call
"http://wso2esb:9443/services/proxy"
it should forward the request to
"http://destinationserver:80/" .
The question is the url extensions are not carried while forwarding.. i.e.
when i do a HTTP POST in
http://wso2esb:9443/services/proxy/path1/path2
the request is forwarded to
http://destinationserver:80
rather than to
http://destinationserver:80/path1/path2.
but HTTP GET behaves as expected. Could anyone help in where i am going wrong?
My Proxy.xml
<proxy xmlns="http://ws.apache.org/ns/synapse" name="proxy" transports="https,http"
statistics="disable" trace="disable" startOnLoad="true">
<target>
<outSequence>
<send/>
</outSequence>
<endpoint>
<address uri="http://destinationserver:80/"/>
</endpoint>
</target>
<description/>
</proxy>
Thanks in advance!
P.S: my WSO2ESB version : 4.8.1
If you really need that, one way (not sure this is the best) to achieve your goal would be :
<proxy xmlns="http://ws.apache.org/ns/synapse" name="proxy" transports="https,http"
statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<header name="To"
expression="concat('http://destinationserver:80',substring-after(syn:get-property('To'),'/services/proxy'))"/>
<send/>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<description/>
</proxy>
Send a post request to http://wso2esb:8280/services/proxy/path1/path2 and it should be forwarded to http://destinationserver:80/path1/path2
Things worked as per Jeans answer but Htttp HEAD request is not forwarded except it is returning 400 Bad Request. Testing with direct link on the destination server returns expected response.

WSO2 ESB aggregate mediator not working properly

i m using the wso2ESB 4.8.0 and i followed the sample at this url:
https://docs.wso2.org/display/ESB480/Sample+62:+Routing+a+Message+to+a+Dynamic+List+of+Recipients+and+Aggregating+Responses
writing this proxy service:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="adminBroadcastEndpoint"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<send>
<endpoint>
<recipientlist>
<endpoint>
<address uri="http://127.0.0.1:8080/RestService/rest/servizio/"/>
</endpoint>
<endpoint>
<address uri="http://127.0.0.1:8081/RestService/rest/servizio/"/>
</endpoint>
</recipientlist>
</endpoint>
</send>
<drop/>
</inSequence>
<outSequence>
<payloadFactory media-type="xml">
<format>
<broadcast>
$1
</broadcast>
</format>
<args>
<arg evaluator="xml" expression="$body/root"/>
</args>
</payloadFactory>
<aggregate>
<completeCondition>
<messageCount/>
</completeCondition>
<onComplete xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" expression="/">
<send/>
</onComplete>
</aggregate>
</outSequence>
</target>
<description/>
</proxy>
in the recipient list there are two servers who answer with an xml string. The first server answer with
<root>
<codice>0</codice>
<messaggio>MESSAGE1</messaggio>
<result><name>CorreggiPecJob1</name><group>POSTA1</group></result>
<result><name>SchedulaIndiceJob1</name><group>INDICE1</group></result>
</root>
and the second server with:
<root>
<codice>0</codice>
<messaggio>MESSAGE2</messaggio>
<result><name>CorreggiPecJob2</name><group>POSTA2</group></result>
<result><name>SchedulaIndiceJob2</name><group>INDICE2</group></result>
</root>
After the aggregate mediator i should expect a result with all those 2 message merged... but in the response from the proxy service i get just the second server answer or the first one randomly.
If i put a log mediator suddenly after the onComplete tag hawever i the esb prints the whole merged message with the two response, but it seems that on the send mediator something goes lost.
Why does this happen?
Another question is: why xpath expressions like
$body/broadcast//result
don't work rising this exception?
2014-03-02 17:37:32,021] ERROR - AggregateMediator Error evaluating expression: $body/broadcast//result
org.apache.synapse.SynapseException: Could not find matching elements to aggregate.
I realize that if i define a namespace and a prfix to append in the payloadfactory like:
<payloadFactory xmlns:m0="my.namespace" media-type="xml">
<m0:format>
<m0:broadcast>
$1
</m0:broadcast>
</m0:format>
<args>
<arg evaluator="xml" expression="$body/root"/>
</args>
</payloadFactory>
the expression: $body/m0:broadcast work fine... so is it the namespace definition mandatory?
Is it there anything i'm missing? thanks
If the XML elements are in namespaces, than you're XPath must either define and use namespace prefixes, or specify any namespace in the path steps, like this:
$body/*:broadcast
i found the answer here: wso2 ESB : Split / Gather Pattern - Single Response
i solved using the enrich mediator. But i think that the aggregate mediator has not a really correct behaviour... maybe should be checked.

Resources