VMware driver: AttributeError when creating a volume with a host having no datastore

Bug #1229653 reported by Subbu on 2013-09-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Undecided
Kartik Bommepally

Bug Description

Using the cinder.volume.drivers.vmware.vmdk.VMwareVcVmdkDriver against a VC containing at least one host that has no attached datastore. When trying to create a volume through cinder client, an exception is thrown as follows.

2013-09-24 15:26:24.200 14748 INFO cinder.volume.drivers.vmware.vmdk [req-1f08cdc4-e63b-4588-8056-6fc6484a9a7a a038902df2744c01b7485bc8595925eb e0ef1acf1b9a425f9e84da3a82a5d80e] Backing not found, creating for volume: volume-17760ecc-2796-42e2-875a-5e65a23ec512
2013-09-24 15:26:24.295 14748 ERROR cinder.openstack.common.rpc.amqp [req-1f08cdc4-e63b-4588-8056-6fc6484a9a7a a038902df2744c01b7485bc8595925eb e0ef1acf1b9a425f9e84da3a82a5d80e] Exception during message handling
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp Traceback (most recent call last):
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp File "/home/subbu/review/cinder/cinder/openstack/common/rpc/amqp.py", line 441, in _process_data
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp **args)
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp File "/home/subbu/review/cinder/cinder/openstack/common/rpc/dispatcher.py", line 148, in dispatch
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp return getattr(proxyobj, method)(ctxt, **kwargs)
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp File "/home/subbu/review/cinder/cinder/volume/manager.py", line 512, in copy_volume_to_image
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp payload['message'] = unicode(error)
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp self.gen.next()
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp File "/home/subbu/review/cinder/cinder/volume/manager.py", line 506, in copy_volume_to_image
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp image_meta)
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp File "/home/subbu/review/cinder/cinder/volume/drivers/vmware/vmdk.py", line 683, in copy_volume_to_image
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp backing = self._create_backing_in_inventory(volume)
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp File "/home/subbu/review/cinder/cinder/volume/drivers/vmware/vmdk.py", line 330, in _create_backing_in_inventory
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp backing = self._create_backing(volume, host)
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp File "/home/subbu/review/cinder/cinder/volume/drivers/vmware/vmdk.py", line 293, in _create_backing
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp (datastores, resource_pool) = self.volumeops.get_dss_rp(host)
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp File "/home/subbu/review/cinder/cinder/volume/drivers/vmware/volumeops.py", line 129, in get_dss_rp
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp datastores = prop.val.ManagedObjectReference
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp AttributeError: 'Text' object has no attribute 'ManagedObjectReference'
2013-09-24 15:26:24.295 14748 TRACE cinder.openstack.common.rpc.amqp

Fix proposed to branch: master
Review: https://review.openstack.org/48026

Changed in cinder:
assignee: nobody → Kartik Bommepally (kartikaditya)
status: New → In Progress
tags: added: vmdk

Reviewed: https://review.openstack.org/48026
Committed: http://github.com/openstack/cinder/commit/04608f9126d2bc34abff7a80afe7ad1a39679a04
Submitter: Jenkins
Branch: master

commit 04608f9126d2bc34abff7a80afe7ad1a39679a04
Author: Kartik Bommepally <email address hidden>
Date: Tue Sep 24 03:58:10 2013 -0700

    VMware: Handles no datastores case

    If the host does not have datastores mounted or is in maintenance mode
    then it reports empty datastores list. Modified code to ignore such cases.

    Fixes bug: 1229653

    Change-Id: I8f076d7b652181988b45738664a0d549c0b5ff9b

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-10-04
Changed in cinder:
milestone: none → havana-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in cinder:
milestone: havana-rc1 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers