Hi there!<div><br></div><div>You need to make sure that you load the settings as if you don't load them, SQLAlchemy will try to read the default path (which it seems like it's doing).  You can take a look at this script which interacts with the database</div>
<div><br></div><div><a href="https://github.com/openstack/nova/blob/master/tools/xenserver/vm_vdi_cleaner.py">https://github.com/openstack/nova/blob/master/tools/xenserver/vm_vdi_cleaner.py</a></div><div><br></div><div>It'd be helpful to paste the script as well to help us debug it. </div>
<div><br></div><div>Regards,</div><div>Mohammed Naser</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 5, 2012 at 6:15 AM, Trinath Somanchi <span dir="ltr"><<a href="mailto:trinath.somanchi@gmail.com" target="_blank">trinath.somanchi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi-<div><br></div><div>I have added the correct credentials with respect to my setup.</div><div><br></div><div>But still the same error exists.</div>
<div><br></div><div>Kindly help me resolve the issue.</div><div><br></div>
<div>-</div><div>Trinath</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 5, 2012 at 4:38 PM, Razique Mahroua <span dir="ltr"><<a href="mailto:razique.mahroua@gmail.com" target="_blank">razique.mahroua@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">HI Trinath,<div>just add the right credentials into your .bashrc or any file the system user can source : </div>

<div><br></div><div><div></div><blockquote type="cite"><div><font face="Consolas">export SERVICE_TOKEN=admin</font></div><div><font face="Consolas">                                    </font></div><div><font face="Consolas">export OS_TENANT_NAME=admin</font></div>

<div><font face="Consolas">export OS_USERNAME=admin</font></div><div><font face="Consolas">export OS_PASSWORD=openstack</font></div><div><font face="Consolas">export OS_AUTH_URL=<a href="http://$keystone-IP:5000/v2.0/" target="_blank">http://$keystone-IP:5000/v2.0/</a></font></div>

<div><font face="Consolas">export SERVICE_ENDPOINT=<a href="http://$keystone-IP:35357/v2.0/" target="_blank">http://$keystone-IP:35357/v2.0/</a></font></div></blockquote>and it would work</div><div><br></div><div>Regards,</div>

<div><span style="white-space:pre-wrap">  </span></div><div><div>
<span style="border-collapse:separate;font-family:'Lucida Grande';border-spacing:0px"><span style="font-weight:normal;font-family:Helvetica"><b style="color:rgb(19,112,138)">Razique Mahroua</b></span><span style="font-weight:normal;font-family:Helvetica;color:rgb(19,112,138)"><b> - </b></span><span style="font-family:Helvetica"><span style="font-weight:normal;font-family:Helvetica"><b style="color:rgb(19,112,138)">Nuage & Co</b></span><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;border-spacing:0px;font-size:medium"><span style="border-spacing:0px;text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;border-spacing:0px"><div style="font-style:normal;font-size:medium;font-family:Helvetica;font-weight:normal">

<font color="#13708a"><a href="mailto:razique.mahroua@gmail.com" target="_blank">razique.mahroua@gmail.com</a></font></div><div style="font-style:normal;font-size:medium;font-family:Helvetica"><font color="#13708a">Tel : <a href="tel:%2B33%209%2072%2037%2094%2015" value="+33972379415" target="_blank">+33 9 72 37 94 15</a></font></div>

</span><br><span></span><span style="font-style:normal;font-size:medium;font-family:Helvetica;font-weight:normal"></span><span style="font-weight:normal"></span></span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><span><span><span><img height="125" width="125" src="cid:00E07450-433E-43E6-9005-48B8FD5C669F@la.fabrique"></span>
</span></span></span></span></span></span></div>
<br><div><div>Le 5 déc. 2012 à 12:04, Trinath Somanchi <<a href="mailto:trinath.somanchi@gmail.com" target="_blank">trinath.somanchi@gmail.com</a>> a écrit :</div><br><blockquote type="cite"><div><div>Hi-<div>
<br></div><div>Is there any way with out using the nova-client from the compute host, to access the nova database?</div><div><br></div><div>I tried, using the /nova/db/api.py and /nova/db/sqlalchemy/api.py class definitions for accessing the database but failed to get the data.</div>


<div><br></div><div><br></div><div>I get this error for the sample def. i have written.</div><div><br></div><div><div> File "/usr/lib/python2.7/dist-packages/nova/db/sqlalchemy/api.py", line 5263, in sampledata_by_host</div>


<div>    filter(models.Instance.host == host_name).all()</div><div>  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2115, in all</div><div>    return list(self)</div><div>  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2227, in __iter__</div>


<div>    return self._execute_and_instances(context)</div><div>  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2240, in _execute_and_instances</div><div>    close_with_result=True)</div>

<div>
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2231, in _connection_from_session</div><div>    **kw)</div><div>  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 730, in connection</div>


<div>    close_with_result=close_with_result)</div><div>  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 736, in _connection_for_bind</div><div>    return engine.contextual_connect(**kwargs)</div>


<div>  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2490, in contextual_connect</div><div>    self.pool.connect(),</div><div>  File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 224, in connect</div>


<div>    return _ConnectionFairy(self).checkout()</div><div>  File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 387, in __init__</div><div>    rec = self._connection_record = pool._do_get()</div>

<div>
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 802, in _do_get</div><div>    return self._create_connection()</div><div>  File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 188, in _create_connection</div>


<div>    return _ConnectionRecord(self)</div><div>  File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 270, in __init__</div><div>    self.connection = self.__connect()</div><div>  File "/usr/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 330, in __connect</div>


<div>    connection = self.__pool._creator()</div><div>  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 80, in connect</div><div>    return dialect.connect(*cargs, **cparams)</div>


<div>  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 281, in connect</div><div>    return self.dbapi.connect(*cargs, **cparams)</div><div><b>OperationalError: (OperationalError) unable to open database file None None</b></div>


</div><div><div><br></div><div>Can any one help when does this error occur and how to resolve the same.</div><div><br></div><div>Thanks in advance.</div><div><br></div>-- <br>Regards,<br>----------------------------------------------<br>


Trinath Somanchi,<div><a href="tel:%2B91%209866%20235%20130" value="+919866235130" target="_blank">+91 9866 235 130</a></div><br>
</div></div></div>
_______________________________________________<br>Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>Post to     : <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a><br>

Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>

</blockquote></div><br></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>----------------------------------------------<br>Trinath Somanchi,<div><a href="tel:%2B91%209866%20235%20130" value="+919866235130" target="_blank">+91 9866 235 130</a></div>
<br>
</div>
</div></div><br>_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><span style="font-family:Arial;font-size:8pt"><span style="color:rgb(70,130,180);font-size:10pt">Mohammed Naser</span> — <span style="font-weight:bold">vexxhost</span><br>
</span><div><span style="font-family:Arial;font-size:8pt"><span><span style="color:rgb(220,220,220)">-----------------------------------------------------</span></span></span></div><div><span style="font-family:Arial;font-size:11px;font-weight:bold">D. </span><span style="font-family:Arial;font-size:11px">514-316-8872</span></div>
<div><span style="font-family:Arial;font-size:11px"><span style="font-weight:bold">D.</span> 800-910-1726 ext. 200</span></div><div><span style="font-family:Arial;font-size:11px"><span style="font-weight:bold">E. </span><a href="mailto:mnaser@vexxhost.com" target="_blank">mnaser@vexxhost.com</a></span></div>
<div><span style="font-family:Arial;font-size:11px"><span style="font-weight:bold">W. </span><a href="http://vexxhost.com/" target="_blank">http://vexxhost.com</a></span></div><br>
</div>