← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1870357] Re: raw disk usage is not correctly reported during resource update

 

Reviewed:  https://review.opendev.org/717037
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=addd6caddaf2b0b808a414828d98486a9f7ffedd
Submitter: Zuul
Branch:    master

commit addd6caddaf2b0b808a414828d98486a9f7ffedd
Author: Alexandre Arents <alexandre.arents@xxxxxxxxxxxx>
Date:   Wed Apr 1 15:44:18 2020 +0000

    libvirt: Calculate disk_over_committed for raw instances
    
    During update_available_resource periodic task, nova-compute reports total
    amount of disk_over_committed in order to determine current hypervisor's
    available_disk_least.
    
    Currently, disk_over_committed is set to 0 for raw instances, which is
    appropriate when [compute]/preallocate_images option is set to space as images
    are fully allocated and because file size is equal to allocated size.
    If not set, the raw disk file is sparsely allocated and
    over_committed_disk_size have to be calculated in order to not mislead
    available_disk_least value.
    
    This change introduces over_committed_disk_size calucation also for raw disk.
    
    Closes-Bug: #1870357
    
    Change-Id: I9788ab12f5cfe0b1884f265482ceb9f533e9574e


** Changed in: nova
       Status: In Progress => Fix Released

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

Title:
  raw disk usage is not correctly reported  during resource update

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Description
  ===========

  available_disk_least r(free disk for a new instance) seems not be calculated
  correctly when instance is in raw (images_type=raw) and preallocate_space option is not set.
  This may lead  placement/scheduler to take wrong decision regarding space availabilty on hosts.

  when total amount of over_committed_disk_size is evaluated on a host, it seems that in 
  raw disk type case it is always set to 0.

  
  Steps to reproduce

  ===========
  on a master devstack:

  . devstack/openrc admin admin
  $openstack hypervisor show alex-devstack | grep  available_least
  | disk_available_least | 381

  # create an instance with 80GB of disk with qcow2 by default:
  $openstack server create  --flavor m1.large --image cirros-0.4.0-x86_64-disk --nic net-id=private  alex

  # few seconds later we can see disk available is minus by 80, all is fine.
  $ openstack hypervisor show alex-devstack | grep  available_least
  | disk_available_least | 301     

  # delete instance
  $ openstack server delete xxx

  # Now set images_type = raw in [libvirt] section in /etc/nova/nova-cpu.conf
  $ grep images_type /etc/nova/nova-cpu.conf 
  images_type = raw
  # restart compute
  $ sudo service devstack@n-cpu restart

  # respawn the same instance, it will create a instance with raw disk now
  $openstack server create  --flavor m1.large --image cirros-0.4.0-x86_64-disk --nic net-id=private  alex

  # few seconds later we can see disk available is minus by only by 3GB which is not correct:
  openstack hypervisor show alex-devstack | grep  available_least
  | disk_available_least | 378

  # only allocated size use is decreased:
  $ ls -lhs /opt/stack/data/nova/instances/31e46f53-6223-40c3-ad84-0f19d10b52be/disk
  2.6G -rw-r--r-- 1 libvirt-qemu kvm 80G Apr  1 10:00 /opt/stack/data/nova/instances/31e46f53-6223-40c3-ad84-0f19d10b52be/disk

  Expected result
  ===============
  calculation of over_committed_disk_size must be done for raw disk (at least on not preallocated one)

  Actual result
  =============
  over_committed_disk_size is set to 0 in all cases for raw disk.

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


References