Discussion:
omf_sfa: creating resources
Juan Antonio Martínez Navarro
2015-08-05 10:03:29 UTC
Permalink
Hello again,

I installed omf_sfa in a computer. I'm able to see the API REST vía web
using https://serverip:8001.

However, when I try to create a new resource I obtain an error and I
don't know its reason.

./create_resource -t node -c conf.yaml -i nodes_description.json

I got this error message:
[2015-08-05 11:55:09 +0200] INFO OmfCommon::Comm::XMPP::Communicator:
Connecting to 'localhost' ...
[2015-08-05 11:55:09 +0200] INFO OmfCommon::Comm::XMPP::Communicator:
Connected
[2015-08-05 11:55:09 +0200] WARN OmfCommon::Auth::CertificateStore:
Overriding certificate 'omf' - new:
/C=US/ST=CA/O=ACME/OU=Roadrunner/CN=xmpp://***@localhost/type=am_controller/uuid=67cfa2ae-40f2-4fc0-a8a5-22c2cf3df708
old:
/C=US/ST=CA/O=ACME/OU=Roadrunner/CN=3dfdc326-2682-52b9-82d2-09b99794d985/emailAddress=***@localhost
am_controller <inform(ERROR)>
reason: undefined method `include?' for nil:NilClass
------
done.
[2015-08-05 11:55:10 +0200] INFO OmfCommon::Comm::XMPP::Communicator:
Disconnecting...

Could you help me, please?



This is my conf.yaml file:
:auth:
:root_cert_dir: /root/.omf/trusted_roots
:entity_cert: /root/.omf/user_cert.pem
:entity_key: /root/.omf/user_cert.pkey

:xmpp:
:username: am_mgr-1.0
:password: pw
:server: localhost
:topic: am_controller
:operation_mode: development

I've created the user in the xmpp (openfire)

And this is the json of the new resource to be added:
nodes_description.json
[
{
"name" : "OMF-RC1",
"hostname" : "OMF-RC1",
"urn" : "urn:publicid:IDN+omf:10.0.0.40+node+OMF-RC1",
"ram" : "995MB",
"hd_capacity" : "10 GB",
"cpu" : {
"cpu_type" : "Intel(R) CORE(TM) i5-2500 CPU @ 3.30GHz",
"cores" : "1"
},
"interfaces" : [
{
"name" : "OMF-RC1:if1",
"role" : "control",
"mac" : "08:00:27:07:d3:8a",
"ip" : {
"address" : "10.0.0.1",
"netmask" : "255.255.255.0",
"ip_type" : "ipv4"
}
}
]
}
]


Kind regards,
Juan Antonio
Aris Dadoukis
2015-08-05 10:30:04 UTC
Permalink
Hi Juan,

the bad news are that the create_resource script is currently broken.
The good news are that you can use the REST interface to create resources.
Try this command:

*$ curl --cert /root/.omf/user_cert.pem --key
/root/.omf/user_cert.pkey -i -H "Accept: application/json" -H
"Content-Type:application/json" -X POST -d @node_description.json -k
https://localhost:8001/resources/nodes/
<https://localhost:8001/resources/nodes/>*

There is also an issue with your json file, a sample file for this purpose
can be found here:
https://github.com/dostavro/omf_sfa/blob/master/examples/Populate_DB/sample_nitos_enriched_nodes_out.json
Please use this file as a skeleton to create your own json file.

I hope this helps.

Best regards,
Aris

On Wed, Aug 5, 2015 at 1:03 PM, Juan Antonio Martínez Navarro <
Post by Juan Antonio Martínez Navarro
Hello again,
I installed omf_sfa in a computer. I'm able to see the API REST vía web
using https://serverip:8001.
However, when I try to create a new resource I obtain an error and I don't
know its reason.
./create_resource -t node -c conf.yaml -i nodes_description.json
Connecting to 'localhost' ...
Connected
am_controller <inform(ERROR)>
reason: undefined method `include?' for nil:NilClass
------
done.
Disconnecting...
Could you help me, please?
:root_cert_dir: /root/.omf/trusted_roots
:entity_cert: /root/.omf/user_cert.pem
:entity_key: /root/.omf/user_cert.pkey
:username: am_mgr-1.0
:password: pw
:server: localhost
:topic: am_controller
:operation_mode: development
I've created the user in the xmpp (openfire)
nodes_description.json
[
{
"name" : "OMF-RC1",
"hostname" : "OMF-RC1",
"urn" : "urn:publicid:IDN+omf:10.0.0.40+node+OMF-RC1",
"ram" : "995MB",
"hd_capacity" : "10 GB",
"cpu" : {
"cores" : "1"
},
"interfaces" : [
{
"name" : "OMF-RC1:if1",
"role" : "control",
"mac" : "08:00:27:07:d3:8a",
"ip" : {
"address" : "10.0.0.1",
"netmask" : "255.255.255.0",
"ip_type" : "ipv4"
}
}
]
}
]
Kind regards,
Juan Antonio
Juan Antonio Martínez Navarro
2015-08-05 10:40:45 UTC
Permalink
Thank you very much.

Could you give me an example of json file?

When I run the curl command I got an error messages saying that method
cpu doesn't exist. I removed it from my json file, but now the error is
the same but about interfaces, and I think that this one could be important.

Perhaps I'm using an old json format, and that's the reason for all
these errors.

Thank you again,
Juan Antonio
Post by Aris Dadoukis
Hi Juan,
the bad news are that the create_resource script is currently broken.
The good news are that you can use the REST interface to create
There is also an issue with your json file, a sample file for this
https://github.com/dostavro/omf_sfa/blob/master/examples/Populate_DB/sample_nitos_enriched_nodes_out.json
Please use this file as a skeleton to create your own json file.
I hope this helps.
Best regards,
Aris
On Wed, Aug 5, 2015 at 1:03 PM, Juan Antonio Martínez Navarro
Hello again,
I installed omf_sfa in a computer. I'm able to see the API REST
vía web using https://serverip:8001.
However, when I try to create a new resource I obtain an error and
I don't know its reason.
./create_resource -t node -c conf.yaml -i nodes_description.json
[2015-08-05 11:55:09 +0200] INFO
OmfCommon::Comm::XMPP::Communicator: Connecting to 'localhost' ...
[2015-08-05 11:55:09 +0200] INFO
OmfCommon::Comm::XMPP::Communicator: Connected
[2015-08-05 11:55:09 +0200] WARN
OmfCommon::Auth::CertificateStore: Overriding certificate 'omf' -
am_controller <inform(ERROR)>
reason: undefined method `include?' for nil:NilClass
------
done.
[2015-08-05 11:55:10 +0200] INFO
OmfCommon::Comm::XMPP::Communicator: Disconnecting...
Could you help me, please?
:root_cert_dir: /root/.omf/trusted_roots
:entity_cert: /root/.omf/user_cert.pem
:entity_key: /root/.omf/user_cert.pkey
:username: am_mgr-1.0
:password: pw
:server: localhost
:topic: am_controller
:operation_mode: development
I've created the user in the xmpp (openfire)
nodes_description.json
[
{
"name" : "OMF-RC1",
"hostname" : "OMF-RC1",
"urn" : "urn:publicid:IDN+omf:10.0.0.40+node+OMF-RC1",
"ram" : "995MB",
"hd_capacity" : "10 GB",
"cpu" : {
"cores" : "1"
},
"interfaces" : [
{
"name" : "OMF-RC1:if1",
"role" : "control",
"mac" : "08:00:27:07:d3:8a",
"ip" : {
"address" : "10.0.0.1",
"netmask" : "255.255.255.0 <tel:255.255.255.0>",
"ip_type" : "ipv4"
}
}
]
}
]
Kind regards,
Juan Antonio
Juan Antonio Martínez Navarro
2015-08-05 10:44:42 UTC
Permalink
Oh, sorry.

Now I've read the full e-mail.
I'll use the json that you provided in the email.

Thank you,
Juan Antonio
Post by Juan Antonio Martínez Navarro
Thank you very much.
Could you give me an example of json file?
When I run the curl command I got an error messages saying that method
cpu doesn't exist. I removed it from my json file, but now the error
is the same but about interfaces, and I think that this one could be
important.
Perhaps I'm using an old json format, and that's the reason for all
these errors.
Thank you again,
Juan Antonio
Post by Aris Dadoukis
Hi Juan,
the bad news are that the create_resource script is currently broken.
The good news are that you can use the REST interface to create
There is also an issue with your json file, a sample file for this
https://github.com/dostavro/omf_sfa/blob/master/examples/Populate_DB/sample_nitos_enriched_nodes_out.json
Please use this file as a skeleton to create your own json file.
I hope this helps.
Best regards,
Aris
On Wed, Aug 5, 2015 at 1:03 PM, Juan Antonio Martínez Navarro
Hello again,
I installed omf_sfa in a computer. I'm able to see the API REST
vía web using https://serverip:8001.
However, when I try to create a new resource I obtain an error
and I don't know its reason.
./create_resource -t node -c conf.yaml -i nodes_description.json
[2015-08-05 11:55:09 +0200] INFO
OmfCommon::Comm::XMPP::Communicator: Connecting to 'localhost' ...
[2015-08-05 11:55:09 +0200] INFO
OmfCommon::Comm::XMPP::Communicator: Connected
[2015-08-05 11:55:09 +0200] WARN
OmfCommon::Auth::CertificateStore: Overriding certificate 'omf' -
am_controller <inform(ERROR)>
reason: undefined method `include?' for nil:NilClass
------
done.
[2015-08-05 11:55:10 +0200] INFO
OmfCommon::Comm::XMPP::Communicator: Disconnecting...
Could you help me, please?
:root_cert_dir: /root/.omf/trusted_roots
:entity_cert: /root/.omf/user_cert.pem
:entity_key: /root/.omf/user_cert.pkey
:username: am_mgr-1.0
:password: pw
:server: localhost
:topic: am_controller
:operation_mode: development
I've created the user in the xmpp (openfire)
nodes_description.json
[
{
"name" : "OMF-RC1",
"hostname" : "OMF-RC1",
"urn" : "urn:publicid:IDN+omf:10.0.0.40+node+OMF-RC1",
"ram" : "995MB",
"hd_capacity" : "10 GB",
"cpu" : {
"cores" : "1"
},
"interfaces" : [
{
"name" : "OMF-RC1:if1",
"role" : "control",
"mac" : "08:00:27:07:d3:8a",
"ip" : {
"address" : "10.0.0.1",
"netmask" : "255.255.255.0 <tel:255.255.255.0>",
"ip_type" : "ipv4"
}
}
]
}
]
Kind regards,
Juan Antonio
Loading...