[Openstack] problem fetching volume details in snapshot creation

Dinakar Gorti Maruti dinakar.gm at cloudbyte.co
Wed Oct 16 04:41:02 UTC 2013


hi,
   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.
I am using Openstack-Grizzly

I am trying to use this line of code

def create_snapshot(self, snapshot_ref):
      ..........

      volume = snapshot_ref['volume']

      ...........


Error :

Traceback (most recent call last):
  File
"/usr/lib/python2.6/site-packages/cinder/openstack/common/rpc/amqp.py",
line 430, in _process_data
    rval = self.proxy.dispatch(ctxt, version, method, **args)
  File
"/usr/lib/python2.6/site-packages/cinder/openstack/common/rpc/dispatcher.py",
line 133, in dispatch
    return getattr(proxyobj, method)(ctxt, **kwargs)
  File "/usr/lib/python2.6/site-packages/cinder/volume/manager.py", line
564, in create_snapshot
    {'status': 'error'})
  File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
    self.gen.next()
  File "/usr/lib/python2.6/site-packages/cinder/volume/manager.py", line
554, in create_snapshot
    model_update = self.driver.create_snapshot(snapshot_ref,volume_name)
  File
"/usr/lib/python2.6/site-packages/cinder/volume/drivers/cloudbyte.py", line
195, in create_snapshot
    LOG.debug(_("phani volume object in snapshot :
%s"),snapshot_ref['volume'])
  File "/usr/lib/python2.6/site-packages/cinder/db/sqlalchemy/models.py",
line 74, in __getitem__
    return getattr(self, key)
  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__
    return self.impl.get(instance_state(instance),dict_)
  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
    value = self.callable_(state, passive)
  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
    (mapperutil.state_str(state), self.key)


 DetachedInstanceError: Parent instance <Snapshot at 0x30a0cd0> is not
bound to a Session; lazy load operation of attribute 'volume' cannot proceed

hoping for a solution

Thanks
Dinakar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20131016/9d0cfebe/attachment.html>


More information about the Openstack mailing list