← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1616782] [NEW] driver_discard='unmap' is written without considering the configuration

 

Public bug reported:

The original code is as follows:

        if data.get('discard', False) is True:
            min_qemu = nova.virt.libvirt.driver.MIN_QEMU_DISCARD_VERSION
            if self.connection._host.has_min_version(
                    hv_ver=min_qemu,
                    hv_type=host.HV_DRIVER_QEMU):
                conf.driver_discard = 'unmap'
            else:
                global SHOULD_LOG_DISCARD_WARNING
                if SHOULD_LOG_DISCARD_WARNING:
                    SHOULD_LOG_DISCARD_WARNING = False
                    LOG.warning(_LW('Unable to attach %(type)s volume '
                                    '%(serial)s with discard enabled: qemu '
                                    '%(qemu)s or later is required.'),
                                {
                        'qemu': min_qemu,
                        'serial': conf.serial,
                        'type': connection_info['driver_volume_type']
                    })

https://github.com/openstack/nova/blob/master/nova/virt/libvirt/volume/volume.py#L96

No consideration is given to the case when the configuration file is not
configured as hw_disk_discard=unmap

Only when the backend report can support discard, is to write the unmap
in XML

** Affects: nova
     Importance: Undecided
     Assignee: Ji.Wei (jiwei)
         Status: New


** Tags: discard

** Tags added: discard

** Changed in: nova
     Assignee: (unassigned) => Ji.Wei (jiwei)

-- 
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/1616782

Title:
  driver_discard='unmap' is written without considering the
  configuration

Status in OpenStack Compute (nova):
  New

Bug description:
  The original code is as follows:

          if data.get('discard', False) is True:
              min_qemu = nova.virt.libvirt.driver.MIN_QEMU_DISCARD_VERSION
              if self.connection._host.has_min_version(
                      hv_ver=min_qemu,
                      hv_type=host.HV_DRIVER_QEMU):
                  conf.driver_discard = 'unmap'
              else:
                  global SHOULD_LOG_DISCARD_WARNING
                  if SHOULD_LOG_DISCARD_WARNING:
                      SHOULD_LOG_DISCARD_WARNING = False
                      LOG.warning(_LW('Unable to attach %(type)s volume '
                                      '%(serial)s with discard enabled: qemu '
                                      '%(qemu)s or later is required.'),
                                  {
                          'qemu': min_qemu,
                          'serial': conf.serial,
                          'type': connection_info['driver_volume_type']
                      })

  https://github.com/openstack/nova/blob/master/nova/virt/libvirt/volume/volume.py#L96

  No consideration is given to the case when the configuration file is
  not configured as hw_disk_discard=unmap

  Only when the backend report can support discard, is to write the
  unmap in XML

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


Follow ups