1st example: if a second request is 6 seconds after the first request (> KeepAliveTimeout=5), tcp connection is not reused under keystoneauth1.session.Session.
The line to highlight is "urllib3.connectionpool:Resetting dropped connection" which is resetting the TCP connection and to re-establish another TCP connection.
1st example: if a second request is 6 seconds after the first request (> KeepAliveTimeou t=5), tcp connection is not reused under keystoneauth1. session. Session.
The line to highlight is "urllib3. connectionpool: Resetting dropped connection" which is resetting the TCP connection and to re-establish another TCP connection.
https:/ /docs.openstack .org/python- novaclient/ latest/ user/python- api.html identity import v3
====
from keystoneauth1.
from keystoneauth1 import session
from novaclient import client
import logging
logging. basicConfig( level=logging. DEBUG)
from time import sleep
auth = v3.Password( auth_url= "https:/ /192.168. 151.112: 5000/v3",
username= "admin" , password= "MY_PASSWORD" ,
project_ name="admin" ,
user_ domain_ name="admin_ domain" ,
project_ domain_ name="admin_ domain" )
sess = session. Session( auth=auth, "/home/ ubuntu/ snap/openstackc lients/ common/ root-ca. crt")
verify=
nova = client.Client(2, session=sess)
nova.servers.list()
sleep(6)
nova.flavors.list()
====
>>> nova.flavors.list() uth.session: REQ: curl -g -i --cacert "/home/ ubuntu/ snap/openstackc lients/ common/ root-ca. crt" -X GET https:/ /192.168. 151.115: 8774/v2. 1/flavors/ detail -H "Accept: application/json" -H "User-Agent: python-novaclient" -H "X-Auth-Token: {SHA256} 5849e99d70d26ae 11c4c62e4940105 9c89a66c6a1172b 9bd867e1b36477a 07f8" connectionpool: Resetting dropped connection: 192.168.151.115 connectionpool:https:/ /192.168. 151.115: 8774 "GET /v2.1/flavors/ detail HTTP/1.1" 200 478 uth.session: RESP: [200] Connection: Keep-Alive Content-Length: 478 Content-Type: application/json Date: Wed, 13 Oct 2021 15:41:02 GMT Keep-Alive: timeout=5, max=100 OpenStack- API-Version: compute 2.1 Server: Apache/2.4.41 (Ubuntu) Vary: OpenStack- API-Version, X-OpenStack- Nova-API- Version X-OpenStack- Nova-API- Version: 2.1 x-compute- request- id: req-f299ee15- cad8-429a- 954c-a1b79047e3 5f x-openstack- request- id: req-f299ee15- cad8-429a- 954c-a1b79047e3 5f
DEBUG:keystonea
DEBUG:urllib3.
DEBUG:urllib3.
DEBUG:keystonea
...