nova/volume/driver.py _create_volume will fail if volume exists

Bug #851073 reported by Scott Moser
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Low
Unassigned

Bug Description

I just ran euca-create-volume on a machine that I'd re-installed nova (and wiped DB on).
The volume named 'volume-00000001' still existed from a previous install, so when I did it this time it failed, and I see a trace like:

2011-09-15 11:54:59,249 DEBUG nova.utils [-] Running cmd (subprocess): sudo lvcreate -L 1G -n volume-00000001 nova-volumes from (pid=1119) execute /home/ubuntu/src/nova/nova/utils.py:165
2011-09-15 11:54:59,340 DEBUG nova.utils [-] Result was 5 from (pid=1119) execute /home/ubuntu/src/nova/nova/utils.py:180
2011-09-15 11:54:59,342 ERROR nova.volume.driver [-] Recovering from a failed execute. Try number 2
(nova.volume.driver): TRACE: Traceback (most recent call last):
(nova.volume.driver): TRACE: File "/home/ubuntu/src/nova/nova/volume/driver.py", line 77, in _try_execute
(nova.volume.driver): TRACE: self._execute(*command, **kwargs)
(nova.volume.driver): TRACE: File "/home/ubuntu/src/nova/nova/utils.py", line 188, in execute
(nova.volume.driver): TRACE: cmd=' '.join(cmd))
(nova.volume.driver): TRACE: ProcessExecutionError: Unexpected error while running command.
(nova.volume.driver): TRACE: Command: sudo lvcreate -L 1G -n volume-00000001 nova-volumes
(nova.volume.driver): TRACE: Exit code: 5
(nova.volume.driver): TRACE: Stdout: ''
(nova.volume.driver): TRACE: Stderr: ' Logical volume "volume-00000001" already exists in volume group "nova-volumes"\n'
(nova.volume.driver): TRACE:

The issue is fairly clear,
  Logical volume "volume-00000001" already exists in volume group "nova-volumes"

I'm not sure how this should be handled.

Revision history for this message
Razique Mahroua (razique) wrote :

it means the LVM volume exist, you should see this volume by running $ lvdisplay
You can remove it by running $ lvremove /dev/nova-volumes/volume-00000001

Would you after that remove again the volume and see if you see any errors into your nova-volumes.log (I suspect a "nova is not sudoer")

Thanks :)

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

Yeah, not sure how you can handle this. I guess you could compare volumes in nova-volumes at nova-volume startup to make sure the created LVMs match the DB status...

Changed in nova:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Russell Bryant (russellb) wrote :

No longer relevant since nova-volume has been removed

Changed in nova:
status: Confirmed → Invalid
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.