in libvirt, local_gb is used incorrectly

Bug #851301 reported by Scott Moser
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Mandell

Bug Description

when an instance is launched,
nova/compute/manager.py: _run_instance() checks the size of the instance to run against the instance-type to see if it will fit.

In libvirt, what it really does is check the size of the image against the size of the ephemeral disk (local_gb). If local_gb == 0 (m1.tiny), then this check will let *anything* through.

nova/virt/libvirt/connection.py is consistent in its non-checking of any size for m1.tiny, but worse, it does it explicitly based on name == 'm1.tiny'.

Comments like the following in manager.py indicate that 'local_gb' is actually supposed to be the size of the root disk, which seems to make more sense:
             # NOTE(jk0): Since libvirt uses local_gb as a secondary drive, we
            # need to handle potential situations where local_gb is 0. This is
            # the default for m1.tiny.

The result of this is that in libvirt:
 * the root disk size is actually determined by the flag 'minimum_root_size' which defaults to 10GB.
 * [not verified with test] any image size can be run on an m1.tiny, the image will be neither resized up or down
 * [not verified with test] for all other types (where local_gb != 0) the image size is checked against 'local_gb', not against the size

libvirt needs to start using local_gb in an instance_type size to be the root disk, rather than ephemeral0.

Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
Mandell (mdegerne)
Changed in nova:
assignee: nobody → Mandell (mdegerne)
status: Confirmed → In Progress
Revision history for this message
Pádraig Brady (p-draigbrady) wrote :

This may have been adjusted by "KVM and XEN Disk Management Parity"
https://review.openstack.org/#change,2918

Revision history for this message
Mandell (mdegerne) wrote :

All of the _check_image_size code has been re-done since this bug was submitted. The comments indicate that local_gb=0 is intended to bypass the size check for legacy reasons. The hardcoded "m1.tiny" check is still wrong and needs to be removed.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/3700

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/3700
Committed: http://github.com/openstack/nova/commit/18a9a5921c1d74e1b0b78b29000c11aa9790f3a7
Submitter: Jenkins
Branch: master

commit 18a9a5921c1d74e1b0b78b29000c11aa9790f3a7
Author: Mandell Degerness <email address hidden>
Date: Thu Feb 2 18:46:50 2012 +0000

    Remove hard coded m1.tiny behavior.

    It makes more sense to only care about local_gb.

    Fixes bug # 851301

    Change-Id: I13236020975be8643b227fc2700f2ecefffa5eb7

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-4
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-4 → 2012.1
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.