← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2012056] [NEW] DiskNotFound exeption is rised when attaching disk just after VM creation

 

Public bug reported:

Description
===========
Faced problem while performing tempest.api.compute.admin.test_volume_swap.TestVolumeSwap.test_volume_swap.

Test create 2 volumes, than create VM and than attaches one volume to
VM:

https://github.com/openstack/tempest/blob/master/tempest/api/compute/admin/test_volume_swap.py#L105


Error appears in 2 ways:

1. exception.DiskNotFound

2023-03-13 17:20:41.406 7 ERROR oslo_messaging.rpc.server   File "/var/lib/kolla/venv/lib/python3.8/site-packages/nova/virt/libvirt/driver.py", line 2171, in swap_volume
2023-03-13 17:20:41.406 7 ERROR oslo_messaging.rpc.server     raise exception.DiskNotFound(location=disk_dev)
2023-03-13 17:20:41.406 7 ERROR oslo_messaging.rpc.server nova.exception.DiskNotFound: No disk at vdb

https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L2270

2. exception.VolumeRebaseFailed

2023-03-13 23:15:30.319 7 ERROR oslo_messaging.rpc.server     raise exception.VolumeRebaseFailed(reason=str(exc))
2023-03-13 23:15:30.319 7 ERROR oslo_messaging.rpc.server nova.exception.VolumeRebaseFailed: Volume rebase failed: invalid argument: disk 'vdb' not found in domain
2023-03-13 23:15:30.319 7 ERROR oslo_messaging.rpc.server

https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L2255

It looks like race condition problem because:

- both ways described before have the same root cause but in second case we are moved a bit further cause race condition event came a bit later
- if we add sleep in tempest, the error will disappear and won't been fixed anymore:

        server = self.create_test_server(wait_until='ACTIVE')
        time.sleep(2)
 
        # Attach "volume1" to server
        self.attach_volume(server, volume1)

Environment
===========

stable/xena
libvirt/KVM/QEMU

** Affects: nova
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/2012056

Title:
  DiskNotFound exeption is rised when attaching disk just after VM
  creation

Status in OpenStack Compute (nova):
  New

Bug description:
  Description
  ===========
  Faced problem while performing tempest.api.compute.admin.test_volume_swap.TestVolumeSwap.test_volume_swap.

  Test create 2 volumes, than create VM and than attaches one volume to
  VM:

  https://github.com/openstack/tempest/blob/master/tempest/api/compute/admin/test_volume_swap.py#L105

  
  Error appears in 2 ways:

  1. exception.DiskNotFound

  2023-03-13 17:20:41.406 7 ERROR oslo_messaging.rpc.server   File "/var/lib/kolla/venv/lib/python3.8/site-packages/nova/virt/libvirt/driver.py", line 2171, in swap_volume
  2023-03-13 17:20:41.406 7 ERROR oslo_messaging.rpc.server     raise exception.DiskNotFound(location=disk_dev)
  2023-03-13 17:20:41.406 7 ERROR oslo_messaging.rpc.server nova.exception.DiskNotFound: No disk at vdb

  https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L2270

  2. exception.VolumeRebaseFailed

  2023-03-13 23:15:30.319 7 ERROR oslo_messaging.rpc.server     raise exception.VolumeRebaseFailed(reason=str(exc))
  2023-03-13 23:15:30.319 7 ERROR oslo_messaging.rpc.server nova.exception.VolumeRebaseFailed: Volume rebase failed: invalid argument: disk 'vdb' not found in domain
  2023-03-13 23:15:30.319 7 ERROR oslo_messaging.rpc.server

  https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L2255

  It looks like race condition problem because:

  - both ways described before have the same root cause but in second case we are moved a bit further cause race condition event came a bit later
  - if we add sleep in tempest, the error will disappear and won't been fixed anymore:

          server = self.create_test_server(wait_until='ACTIVE')
          time.sleep(2)
   
          # Attach "volume1" to server
          self.attach_volume(server, volume1)

  Environment
  ===========

  stable/xena
  libvirt/KVM/QEMU

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/2012056/+subscriptions