Instance with two attached volumes fails to start with error: Duplicate ID 'drive-ide0-0-0' for drive

Bug #1686999 reported by Saverio Proto
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Undecided
Unassigned

Bug Description

nova version: mitaka

I imported into Openstack a Linux Centos machine. The instance does not have support for VirtIO. I had to import the boot disk as hda (decorating the glance image with hw_disk_bus='ide'). Now I have this instance with two volumes attached, but when I try to boot the following XML is generated.

<disk type='network' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
  [..CUT...]
      <target dev='hda' bus='ide'/>
      <serial>c3841ee3-3f9a-457e-b504-d35e367a1193</serial>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='network' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
  [..CUT...]
      <target dev='vda' bus='ide'/>
      <serial>63e05c59-8de1-4908-a3dd-3f2261c82ea9</serial>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

This is because the two cinder volumes attached appear as /dev/hda and /dev/sda, and this creates a duplicate disk in the XML.

The machine does not boot, and in the nova-compute.log I find a stacktrace.

2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 138, in _dispatch_and_reply
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher incoming.message))
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 185, in _dispatch
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher return self._do_dispatch(endpoint, method, ctxt, args)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 127, in _do_dispatch
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/nova/exception.py", line 110, in wrapped
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher payload)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher self.force_reraise()
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/nova/exception.py", line 89, in wrapped
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher return f(self, context, *args, **kw)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 359, in decorated_function
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher LOG.warning(msg, e, instance=instance)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher self.force_reraise()
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 328, in decorated_function
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher return function(self, context, *args, **kwargs)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 409, in decorated_function
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher return function(self, context, *args, **kwargs)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 387, in decorated_function
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher kwargs['instance'], e, sys.exc_info())
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher self.force_reraise()
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 375, in decorated_function
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher return function(self, context, *args, **kwargs)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2606, in start_instance
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher self._power_on(context, instance)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2579, in _power_on
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher block_device_info)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 2623, in power_on
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher self._hard_reboot(context, instance, network_info, block_device_info)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 2514, in _hard_reboot
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher vifs_already_plugged=True)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 4926, in _create_domain_and_network
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher xml, pause=pause, power_on=power_on)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 4857, in _create_domain
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher guest.launch(pause=pause)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/guest.py", line 142, in launch
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher self._encoded_xml, errors='ignore')
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher self.force_reraise()
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/guest.py", line 137, in launch
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher return self._domain.createWithFlags(flags)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/eventlet/tpool.py", line 186, in doit
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher result = proxy_call(self._autowrap, f, *args, **kwargs)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/eventlet/tpool.py", line 144, in proxy_call
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher rv = execute(f, *args, **kwargs)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/eventlet/tpool.py", line 125, in execute
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher six.reraise(c, e, tb)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/eventlet/tpool.py", line 83, in tworker
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher rv = meth(*args, **kwargs)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/libvirt.py", line 1065, in createWithFlags
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher if ret == -1: raise libvirtError ('virDomainCreateWithFlags() failed', dom=self)
2017-04-28 12:56:35.356 43378 ERROR oslo_messaging.rpc.dispatcher libvirtError: internal error: process exited while connecting to monitor: [..CUT..] Duplicate ID 'drive-ide0-0-0' for drive

In liberty the two disked attached where marked as /dev/sda /dev/hdb, and everything was working. In mitaka I see this behavior where the two attachments are marked as /dev/sda and /dev/hda and the VM is not booting.

Revision history for this message
Saverio Proto (zioproto) wrote :

As a workaround to start the VM I did the following

1) I got a snapshot of the volume that was attached as /dev/hda
2) Using the snapshot I created a new volume
3) I attached also this third volume to the instance, and this attachment was marked by nova as /dev/hdb.
4) I now detached the volume that was marked as /dev/hda
5) Now you have two volumes attached marked as /dev/hdb and /dev/sda

the machine now boots correctly.

description: updated
Revision history for this message
Sean Dague (sdague) wrote :

Automatically discovered version liberty in description. If this is incorrect, please update the description to include 'nova version: ...'

tags: added: openstack-version.liberty
Saverio Proto (zioproto)
description: updated
Revision history for this message
Sean Dague (sdague) wrote :

I think this is one of those edge cases that the work around you provided is the right way through. The decorating on images is meant to be part of the original image build process, and doesn't magically fix things.

Changed in nova:
status: New → Won't Fix
Revision history for this message
JANG DASEONG (plumage) wrote :

I wonder who could control disk address in xml file....

while i edit xml by force, openstack roll back it.

i solved issue by using Saverio Proto's work-around...

but it is very annoying situation when it occur to me

patch is needed...

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.