<div dir="ltr"><div><div><div>hi, <br></div>   I am implementing a driver for cinder services and I am stuck with a problem in creation of snapshot , I have a need to fetch the volume details in snapshot creation.<br></div>
<div>I am using Openstack-Grizzly  <br></div><div><br></div>I am trying to use this line of code <br><br><span style="color:rgb(11,83,148)">def create_snapshot(self, snapshot_ref):<br>      ..........<br></span></div><span style="color:rgb(11,83,148)"><br>
      volume = snapshot_ref['volume']<br></span><div><span style="color:rgb(11,83,148)"><br>      ...........</span><br><br><br></div><div>Error :<br><br><span style="color:rgb(153,0,0)">Traceback (most recent call last):<br>
  File "/usr/lib/python2.6/site-packages/cinder/openstack/common/rpc/amqp.py", line 430, in _process_data<br>    rval = self.proxy.dispatch(ctxt, version, method, **args)<br>  File "/usr/lib/python2.6/site-packages/cinder/openstack/common/rpc/dispatcher.py", line 133, in dispatch<br>
    return getattr(proxyobj, method)(ctxt, **kwargs)<br>  File "/usr/lib/python2.6/site-packages/cinder/volume/manager.py", line 564, in create_snapshot<br>    {'status': 'error'})<br>  File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__<br>
    self.gen.next()<br>  File "/usr/lib/python2.6/site-packages/cinder/volume/manager.py", line 554, in create_snapshot<br>    model_update = self.driver.create_snapshot(snapshot_ref,volume_name)<br>  File "/usr/lib/python2.6/site-packages/cinder/volume/drivers/cloudbyte.py", line 195, in create_snapshot<br>
    LOG.debug(_("phani volume object in snapshot : %s"),snapshot_ref['volume'])<br>  File "/usr/lib/python2.6/site-packages/cinder/db/sqlalchemy/models.py", line 74, in __getitem__<br>    return getattr(self, key)<br>
  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/attributes.py", line 168, in __get__<br>    return self.impl.get(instance_state(instance),dict_)<br>  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/attributes.py", line 453, in get<br>
    value = self.callable_(state, passive)<br>  File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.7.8-py2.6-linux-x86_64.egg/sqlalchemy/orm/strategies.py", line 481, in _load_for_state<br>    (mapperutil.state_str(state), self.key)<br>
<br><br> DetachedInstanceError: Parent instance <Snapshot at 0x30a0cd0> is not bound to a Session; lazy load operation of attribute 'volume' cannot proceed</span><br><br></div><div>hoping for a solution <br>
<br></div><div>Thanks <br></div><div>Dinakar<br></div></div>