Hi,
The setup went through fine once I commented out the SSLv3 line. Thanks
Sanju
Ignatious,
Here is the output of what you asked for.

Thanks
Chaitanya

root@ace35:~# contrail-status
== Contrail vRouter ==
supervisor-vrouter:           active
contrail-vrouter-agent        active
contrail-vrouter-nodemgr      active

== Contrail Control ==
supervisor-control:           active
contrail-control              active
contrail-control-nodemgr      active
contrail-dns                  active
contrail-named                active

== Contrail Analytics ==
supervisor-analytics:         active
contrail-analytics-api        active
contrail-analytics-nodemgr    active
contrail-collector            active
contrail-query-engine         active

== Contrail Config ==
supervisor-config:            active
contrail-api:0                active
contrail-config-nodemgr       active
contrail-discovery:0          active
contrail-schema               active
contrail-svc-monitor          active
ifmap                         active

== Contrail Web UI ==
supervisor-webui:             active
contrail-webui                active
contrail-webui-middleware     active
redis-webui                   active

== Contrail Database ==
supervisord-contrail-database:active
contrail-database             active
contrail-database-nodemgr     active

== Contrail Support Services ==
supervisor-support-service:   active
rabbitmq-server               active

root@ace35:~# contrail-version
Package                                Version
 Build-ID | Repo | Package Name
-------------------------------------- ------------------------------
----------------------------------
contrail-analytics                     1.20-63                        63

contrail-config                        1.20-63                        63

contrail-config-openstack              1.20-63                        63

contrail-control                       1.20-63                        63

contrail-dns                           1.20-63                        63

contrail-fabric-utils                  1.20-63                        63

contrail-lib                           1.20-63                        63

contrail-nodemgr                       1.20-63                        63

contrail-nova-vif                      1.20-63                        63

contrail-openstack                     1.20-63                        63

contrail-openstack-analytics           1.20-63                        63

contrail-openstack-config              1.20-63                        63

contrail-openstack-control             1.20-63                        63

contrail-openstack-dashboard           2014.1.2-0ubuntu1              63

contrail-openstack-database            1.20-63                        63

contrail-openstack-vrouter             1.20-63                        63

contrail-openstack-webui               1.20-63                        63

contrail-setup                         1.20-63                        63

contrail-utils                         1.20-63                        63

contrail-vrouter-agent                 1.20-63                        63

contrail-vrouter-dkms                  1.20-63                        63

contrail-vrouter-init                  1.20-63                        63

contrail-vrouter-utils                 1.20-63                        63

contrail-web-controller                1.20-63                        63

contrail-web-core                      1.20-63                        63

euca2ools                              1:2.1.3-2                      63

ifmap-python-client                    0.1-2                          63

ifmap-server                           0.3.2-1contrail1               63

neutron-plugin-contrail                1.20-63                        63

nova-api                               1:2014.1-0ubuntu1~cloud0       63

nova-common                            1:2014.1-0ubuntu1~cloud0       63

nova-compute                           1:2014.1-0ubuntu1~cloud0       63

nova-compute-kvm                       1:2014.1-0ubuntu1~cloud0       63

nova-compute-libvirt                   1:2014.1-0ubuntu1~cloud0       63

nova-conductor                         1:2014.1-0ubuntu1~cloud0       63

nova-console                           1:2014.1-0ubuntu1~cloud0       63

nova-consoleauth                       1:2014.1-0ubuntu1~cloud0       63

nova-novncproxy                        1:2014.1-0ubuntu1~cloud0       63

nova-objectstore                       1:2014.1-0ubuntu1~cloud0       63

nova-scheduler                         1:2014.1-0ubuntu1~cloud0       63

python-boto                            1:2.12.0                       63

python-contrail                        1.20-63                        63

python-contrail-vrouter-api            1.20-63                        63

python-neutronclient                   1:2.3.4-0ubuntu1~cloud0        63

python-nova                            1:2014.1-0ubuntu1~cloud0       63

python-opencontrail-vrouter-netns      1.20-63                        63

supervisor                             3.0r1-1                        63


On Tue, Apr 14, 2015 at 5:04 PM, Ignatious Johnson <[email protected]>
wrote:

>  Hi Chaitanya,
>
>  Can you let me know the contrail build version/sku.
> Also can you send this file from the config
> node /usr/lib/python2.7/dist-packages/cfgm_common/ifmap/client.py
>
>  Thanks,
> Ignatious
>
>   From: Ashish Ranjan <[email protected]>
> Date: Tuesday, April 14, 2015 at 4:37 PM
> To: Chaitanya Pemmaraju <[email protected]>
> Cc: "[email protected]" <[email protected]>, Sachin
> Bansal <[email protected]>, Ignatious Johnson Christober <
> [email protected]>
> Subject: Re: [opencontrail-dev] issue with opencontrail installation on
> ubuntu
>
>   Talked to Ignatious. He will work with you.
>
>  Ashish
>
>
>   On Apr 14, 2015, at 4:18 PM, Chaitanya Pemmaraju <[email protected]>
> wrote:
>
>  Tried it still the same behavior, the only change is that now the
> messages in ifmap-server.log print the external mgmt address. They seem to
> start at the same time the python script is trying to run.
>
>  see below.
>
>  2015-04-14 16:13:50:950668: [[email protected]] out: Skipping rewrite of
> this file
> 2015-04-14 16:13:50:950775: [[email protected]] out: [[email protected]] run:
> python /opt/contrail/utils/provision_vrouter.py --host_name ace35 --host_ip
> 10.2.1.35 --api_server_ip 10.2.1.35 --oper add --admin_user admin
> --admin_password acelio1234 --admin_tenant_name admin --openstack_ip
> 10.2.1.35
>
>
>  ifmap-server.log
>
>  2015-04-14 16:17:22,890 [pool-1-thread-3] DEBUG  - EventProcessor:
> Processing BadChannelEvent on 10.2.1.35:35750:54
> 2015-04-14 16:17:22,890 [pool-1-thread-3] DEBUG  - EventProcessor: No
> session found for 10.2.1.35:35750:54
> 2015-04-14 16:17:25,893 [pool-5-thread-1] DEBUG  - ChannelAcceptor: New
> connection from 10.2.1.35:35773 on port 8443
> 2015-04-14 16:17:25,895 [pool-6-thread-1] ERROR  - ChannelThread:
> Receiving request failed
> 2015-04-14 16:17:25,895 [pool-6-thread-1] ERROR  - ChannelThread:
> SSLHandshakeException: Client doesn't know about our certificate (?)
> 2015-04-14 16:17:25,896 [pool-6-thread-1] ERROR  - ChannelThread: Setting
> channel 10.2.1.35:35773:55 into state 'BROKEN'
> 2015-04-14 16:17:25,896 [pool-1-thread-4] DEBUG  - EventProcessor:
> Processing BadChannelEvent on 10.2.1.35:35773:55
> 2015-04-14 16:17:25,896 [pool-1-thread-4] DEBUG  - EventProcessor: No
> session found for 10.2.1.35:35773:55
> 2015-04-14 16:17:28,898 [pool-5-thread-1] DEBUG  - ChannelAcceptor: New
> connection from 10.2.1.35:35797 on port 8443
> 2015-04-14 16:17:28,901 [pool-6-thread-1] ERROR  - ChannelThread:
> Receiving request failed
> 2015-04-14 16:17:28,901 [pool-6-thread-1] ERROR  - ChannelThread:
> SSLHandshakeException: Client doesn't know about our certificate (?)
> 2015-04-14 16:17:28,901 [pool-6-thread-1] ERROR  - ChannelThread: Setting
> channel 10.2.1.35:35797:56 into state 'BROKEN'
> 2015-04-14 16:17:28,901 [pool-1-thread-1] DEBUG  - EventProcessor:
> Processing BadChannelEvent on 10.2.1.35:35797:56
> 2015-04-14 16:17:28,902 [pool-1-thread-1] DEBUG  - EventProcessor: No
> session found for 10.2.1.35:35797:56
> 2015-04-14 16:17:31,903 [pool-5-thread-1] DEBUG  - ChannelAcceptor: New
> connection from 10.2.1.35:35818 on port 8443
> 2015-04-14 16:17:31,905 [pool-6-thread-1] ERROR  - ChannelThread:
> Receiving request failed
>
>
>  Thanks
> Chaitanya
>
> On Tue, Apr 14, 2015 at 4:01 PM, Ashish Ranjan <[email protected]> wrote:
>
>>  Chaitanya,
>>
>>    Pl do not give lo address in testbed.py file. Lets try with mgmt
>> address. If this doesn't work we will take a look.
>>
>>  Once you are past this vrouter provisioning issue, pl revert back.
>> Sachin can help you with authentication issue on ifmap.
>>
>>  thanks
>> Ashish
>>
>>
>>  ------------------------------
>> Date: Tue, 14 Apr 2015 15:35:55 -0700
>> From: [email protected]
>> To: [email protected]
>> Subject: [opencontrail-dev] issue with opencontrail installation on
>> ubuntu
>>
>>
>> Hi,
>> I am trying to do a single node installation following the steps from
>>
>>
>> http://www.opencontrail.org/opencontrail-quick-start-guide/#_Getting_the_packages
>>
>>
>>  Attached my tesbed.py file. I see that my installation process stalls at
>> fab setup_all where the command
>>
>>  python /opt/contrail/utils/provision_vrouter.py --host_name ace35
>> --host_ip 127.0.0.1
>>             --api_server_ip 127.0.0.1 --oper add --admin_user admin
>> --admin_password acelio1234
>>             --admin_tenant_name admin --openstack_ip 127.0.0.1
>>
>>  gets stuck.
>> Also i noticed in /var/log/contrail/ifmap-server.log I see the following
>> errors being continuously printed.
>>
>>
>>  2015-04-14 15:12:28,477 [pool-6-thread-1] ERROR  - ChannelThread:
>>             SSLHandshakeException: Client doesn't know about our
>> certificate (?)
>> 2015-04-14 15:12:28,477 [pool-6-thread-1] ERROR  - ChannelThread: Setting
>> channel
>>             127.0.0.1:59964:391 into state 'BROKEN'
>> 2015-04-14 15:12:28,477 [pool-1-thread-4] DEBUG  - EventProcessor:
>> Processing
>>             BadChannelEvent on 127.0.0.1:59964:391
>> 2015-04-14 15:12:28,477 [pool-1-thread-4] DEBUG  - EventProcessor: No
>> session found
>>             for 127.0.0.1:59964:391
>> 2015-04-14 15:12:31,479 [pool-5-thread-1] DEBUG  - ChannelAcceptor: New
>> connection
>>             from 127.0.0.1:59983 on port 8443
>> 2015-04-14 15:12:31,481 [pool-6-thread-1] ERROR  - ChannelThread:
>> Receiving request
>>             failed
>>
>>  ace35 is the hostname and its ip is 10.2.1.35, but on the testbed.py i
>> gave the server ip as
>> 127.0.0.1 since i was running the installation locally on the server.
>>
>>  I had a brief chat with "aranjan" on the #opencontrail channel on irc.
>>
>>
>>  Thanks for the help.
>>
>>  -Chaitanya
>>
>>  _______________________________________________ Dev mailing list
>> [email protected]
>> http://lists.opencontrail.org/mailman/listinfo/dev_lists.opencontrail.org
>>
>
>
>
#!/usr/bin/python
#
# Copyright 2011, Infoblox, All Rights Reserved
#
# Open Source, see LICENSE
#

from _ssl import PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
import gevent
import geventhttpclient
from geventhttpclient import HTTPClient

import urllib

import base64
import cStringIO



from logging import getLogger

log = getLogger(__name__) # when imported, the logger will be named "ifmap.client"

# Import either httplib2 or urllib2 and map to same name
try:
	import httplib2 as http_client_lib
	Http = http_client_lib.Http
	HttpException = http_client_lib.HttpLib2Error
except ImportError:
	import urllib2 as http_client_lib
	HttpException = (http_client_lib.URLError, http_client_lib.HTTPError)
	class Http(): # wrapper to use when httplib2 not available
		def request(self, url, method, body, headers):
			f = http_client_lib.urlopen(http_client_lib.Request(url, body, headers))
			return f.info(), f.read()

#import urllib2 as http_client_lib
#HttpException = (http_client_lib.URLError, http_client_lib.HTTPError)
#class Http(): # wrapper to use when httplib2 not available
#	def request(self, url, method, body, headers):
#		f = http_client_lib.urlopen(http_client_lib.Request(url, body, headers))
#		return f.info(), f.read()

namespaces = {
	'env'   :   "http://www.w3.org/2003/05/soap-envelope";,
	'ifmap' :   "http://www.trustedcomputinggroup.org/2010/IFMAP/2";,
	'meta'  :   "http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2";
}

# NOTE(sahid): It seems that the geventhttpclient uses gevent.queue.LifoQueue
# to maintain a pool of connections and according to the doc it is possible
# to configure the maxsize of the queue with None or a value less than 0 to
# set the number of connections ulimited otherwise It is actually not possible
# to set it to None or less than 0 since lock.BoundedSemaphore will return an
# exception. https://github.com/gwik/geventhttpclient/blob/master/src/geventhttpclient/connectionpool.py#L37
concurrency = 1 # arbitrary value since it is not possible to use ulimited.

class AsyncReadWrapper(object):
    """ Perform the socket read in a separate greenlet """
    def __init__(self, request):
        self._greenlet = gevent.spawn(self.AsyncRead, request)
	self._content = None

    def AsyncRead(self, request):
        self._content = request.read()

    def __str__(self, *args, **kwargs):
        self._greenlet.join()
        return self._content

    def __repr__(self, *args, **kwargs):
        self._greenlet.join()
        return self._content

class client:
	"""
	IF-MAP client
	"""
	#http = Http()
    
	__url = None
	__session_id = None
	__publisher_id = None
	__last_sent = None
	__last_received = None
	__namespaces = None
	__ssl_options = {
		'cert_reqs'   : gevent.ssl.CERT_NONE,
		'ssl_version' : PROTOCOL_SSLv3
	}

	__envelope ="""<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"; %(ns)s>
  <env:Body>
		%(body)s
  </env:Body>
</env:Envelope>
"""

	def __init__(self, url, user=None, password=None, namespaces={}, ssl_opts=None):
		if user and password:
#			self.__password_mgr=http_client_lib.HTTPPasswordMgrWithDefaultRealm()
#			self.__password_mgr.add_password(None, url, user, password)
#			handler = http_client_lib.HTTPBasicAuthHandler(self.__password_mgr)
#			opener = http_client_lib.build_opener(handler)
#			http_client_lib.install_opener(opener)

                        #pycurl.global_init(pycurl.GLOBAL_SSL)

			pass

		#if namespaces:
		self.__namespaces = namespaces
		if ssl_opts:
			self.__ssl_options.update(ssl_opts)

		self.__url = url
                self.__username = user
                self.__password = password
                try:
                    self._http = HTTPClient(*self.__url, ssl = True,
                                        connection_timeout = None,
                                        network_timeout = None,
                                        ssl_options = self.__ssl_options,
                                        insecure = True,
                                        concurrency = concurrency)
                except TypeError:
                    self._http = HTTPClient(*self.__url, ssl = True,
                                        connection_timeout = None,
                                        network_timeout = None,
                                        ssl_options = self.__ssl_options,
                                        concurrency = concurrency)


	def last_sent(self):
		return self.__last_sent

	def last_received(self):
		return self.__last_received

	def envelope(self, body) :
		_ns = ""
		for ns_prefix, ns_uri in self.__namespaces.items():
			#if ns_prefix == "env": break # don't add the envelope namespace again
			if ns_prefix == "env": continue # don't add the envelope namespace again
			_ns += "xmlns:"+ns_prefix+'="'+ns_uri+'" '
		return self.__envelope % {'body':body, 'ns': _ns}

	def call(self, method, body):
		xml = self.envelope(body)
		#headers={
		#  'Content-type': 'text/xml; charset="UTF-8"',
		#  'Content-length': str(len(xml)),
		#  "SOAPAction": '"%s"' % (method),
		#}

                base64string = base64.encodestring('%s:%s' % (self.__username, self.__password)).replace('\n', '')
		# pycurl
		#headers=[
		#  'Content-type: text/xml; charset="UTF-8"',
		#  'Content-length: %s' %(str(len(xml))),
                #  'Authorization : Basic %s' %(base64string),
		#  'SOAPAction: %s' % (method),
		#]

                # geventhttp
		headers={
		  'Content-type': 'text/xml; charset="UTF-8"',
		  'Content-length': '%s' %(str(len(xml))),
                  'Authorization': 'Basic %s' %(base64string),
		  'SOAPAction': '%s' % (method),
		}

		try:
				log.info("sending IF-MAP message to server")
				log.debug("========  sending IF-MAP message ========")
				log.debug("\n%s\n", xml)
				log.debug("========  /sending IF-MAP message ========")

				#response, content = self.http.request(self.__url,"POST", body=xml, headers=headers )

                                #self.http = pycurl.Curl()
                                #self.http.setopt(pycurl.URL, self.__url)
                                #self.http.setopt(pycurl.HTTPHEADER, headers)
                                #self.http.setopt(pycurl.POSTFIELDS, xml)
                                #self.http.setopt(pycurl.VERBOSE, True)
                                #self.http.setopt(pycurl.SSL_VERIFYPEER, 0)   
                                #self.http.setopt(pycurl.SSL_VERIFYHOST, 0)
                                #content = cStringIO.StringIO()
                                #self.http.setopt(pycurl.WRITEFUNCTION,
                                #                 content.write)
                                #self.http.perform()

				#self.http = HTTPClient(*self.__url, ssl = True,
				#                       ssl_options = {'cert_reqs': gevent.ssl.CERT_NONE,
				#		                      'ssl_version': PROTOCOL_SSLv3})
				#response = self.http.post('/', body = xml, headers = headers)
				response = self._http.post('/', body = xml, headers = headers)
				content = response.read()

				self.__last_sent = xml

				#self.__last_received = content
				#pycurl self.__last_received = content.getvalue()
				self.__last_received = content

				log.debug("========  received IF-MAP response ========")
				#log.debug("\n%s\n", content)
				#pycurl log.debug("\n%s\n", content.getvalue())
				log.debug("\n%s\n", content)
				log.debug("========  /receive IF-MAP response ========")

				#return content
				#pycurl return content.getvalue()
				return content

		except	HttpException, e:
				log.error("HTTP Connection error in IF-MAP client: %s", e.reason)
		except:
				log.error("Uknown error sending IF-MAP message to server")
				raise

	def call_async_result(self, method, body):
		xml = self.envelope(body)
                base64string = base64.encodestring('%s:%s' % (self.__username, self.__password)).replace('\n', '')

                # geventhttp
		headers={
		  'Content-type': 'text/xml; charset="UTF-8"',
		  'Content-length': '%s' %(str(len(xml))),
                  'Authorization': 'Basic %s' %(base64string),
		  'SOAPAction': '%s' % (method),
		}

		try:
				response = self._http.post('/', body = xml, headers = headers)
				content = AsyncReadWrapper(response)

				return content

		except	HttpException, e:
				log.error("HTTP Connection error in IF-MAP client: %s", e.reason)
		except:
				log.error("Uknown error sending IF-MAP message to server")
				raise

	def set_session_id(self, session_id):
		self.__session_id = session_id

	def set_publisher_id(self, publisher_id):
		self.__publisher_id = publisher_id

	def get_session_id(self):
		return self.__session_id

	def get_publisher_id(self):
		return self.__publisher_id


if __name__ == "__main__":
	print """The ifmap client library is not meant to be run from the command line or python interpreter
- you should use it by including it in your python software. See testmap.py for an example.
Hint: add this line to use the library - 'from ifmap import ifmapClient' """
_______________________________________________
Dev mailing list
[email protected]
http://lists.opencontrail.org/mailman/listinfo/dev_lists.opencontrail.org

Reply via email to