Restart of nova-volume with volumes in wrong state: global name 'volume_ref' is not defined

Bug #713430 reported by Christian Berendt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Vish Ishaya
Bexar
Fix Released
High
Thierry Carrez

Bug Description

I tried using the SheepdogDriver by setting the flag "--volume_driver=nova.volume.driver.SheepdogDriver" in /etc/nova/nova.conf. Now I try to start nova-volume, but I end in this error:

2011-02-05 00:32:35,834 AUDIT nova.root [-] Starting volume node (version 2011.1-workspace:tarmac-20110202111800-10sib5zxlu8xluca)
2011-02-05 00:32:36,088 CRITICAL nova.root [-] global name 'volume_ref' is not defined
(nova.root): TRACE: Traceback (most recent call last):
(nova.root): TRACE: File "/usr/bin/nova-volume", line 44, in <module>
(nova.root): TRACE: service.serve()
(nova.root): TRACE: File "/usr/lib64/python2.6/site-packages/nova/service.py", line 231, in serve
(nova.root): TRACE: x.start()
(nova.root): TRACE: File "/usr/lib64/python2.6/site-packages/nova/service.py", line 81, in start
(nova.root): TRACE: self.manager.init_host()
(nova.root): TRACE: File "/usr/lib64/python2.6/site-packages/nova/volume/manager.py", line 90, in init_host
(nova.root): TRACE: LOG.info(_("volume %s: skipping export"), volume_ref['name'])
(nova.root): TRACE: NameError: global name 'volume_ref' is not defined
(nova.root): TRACE:

Related branches

Revision history for this message
Christian Berendt (berendt) wrote :

problem is in init_host() (nova/volume/manager.py) in line 89-90. volume_ref is not set in this method, but the log message wants to use it. i simply uncommented the both lines and now i can start nova-volume without an error. Now I'll test if I can use Sheepdog images...

(I hope I added the patch in the correct way...)

Revision history for this message
Christian Berendt (berendt) wrote :

I think it looks good now...

# euca-create-volume -s 5 -z nova
VOLUME vol-00000004 5 creating (berendt, None, None, None) 2011-02-05 17:49:23.394126

# euca-describe-volumes
[...]
VOLUME vol-00000004 5 nova available (berendt, mandarin, None, None) 2011-02-05 17:49:23

# collie vdi list
  name id size used shared creation time vdi id
------------------------------------------------------------------
  volume-00000004 1 5.0 GB 0.0 MB 0.0 MB 2011-02-05 18:49 a1ff92

# collie vdi object volume-00000004
Looking for the inode object 0xa1ff92 with 4 nodes

172.19.134.24:7000: doesn't have
172.19.134.26:7000: has the object (should be 2 copies)
172.19.134.25:7000: has the object (should be 2 copies)
172.19.134.27:7000: doesn't have

Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Vish Ishaya (vishvananda) wrote :

This patch affects all volume modes if volume is started with a volume that isn't in available or in-use

Changed in nova:
status: Confirmed → In Progress
assignee: nobody → Vish Ishaya (vishvananda)
Revision history for this message
Vish Ishaya (vishvananda) wrote :

The patch above isn't quite correct, volume_ref should just be changed to volume.

summary: - nova.volume.driver.SheepdogDriver: global name 'volume_ref' is not
- defined
+ Restart of nova-volume with volumes in wrong state: global name
+ 'volume_ref' is not defined
Thierry Carrez (ttx)
tags: added: bexar-post-release
Thierry Carrez (ttx)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
tags: removed: bexar-post-release
Revision history for this message
Thierry Carrez (ttx) wrote :

I'm looking into validating that this is indeed fixed in 2011.1.1 release candidates... but I'm not sure I understand how to reproduce the bug (or absence thereof). Can anyone involved come up with a simple test case that I could use in validation ?

Revision history for this message
Thierry Carrez (ttx) wrote :

validated:

with bzr645:
CRITICAL nova.root [-] global name 'volume_ref' is not defined

with bzr653:
Re-exporting 1 volumes from MainProcess (pid=7167) init_host
INFO nova.volume.manager [-] volume volume-00000002: skipping export

Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.2
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.