min_disk/min_ram set too high for vhds

Bug #1029532 reported by Mark Washenberger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Undecided
Mark Washenberger

Bug Description

In the code, (nova/compute/api.py)

        #disk format of vhd is non-shrinkable
        if orig_image.get('disk_format') == 'vhd':
            min_ram = instance['instance_type']['memory_mb']
            min_disk = instance['instance_type']['root_gb']
        else:
            #set new image values to the original image values
            min_ram = orig_image.get('min_ram')
            min_disk = orig_image.get('min_disk')

There are two problems with this. First, min_ram has nothing to do with the vhd format, and should definitely be coming from the original image.

Secondly, its not clear to me that vhd's aren't shrinkable, or that you're even required to shrink them? Even if you are required to shrink it to fit and can't in a particular case, min_disk is just advisory. There will still be a check during the boot step to ensure you're not doing anything wrong.

My feeling is that, it is better to fail slow in the case where the image is too large than to fail fast incorrectly in the more likely cases where the image is small enough to fit.

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

Changed in nova:
assignee: nobody → Mark Washenberger (markwash)
status: New → In Progress
Revision history for this message
Johannes Erdfelt (johannes.erdfelt) wrote :

AFAICT, there's nothing in the data format of the VHD that prevents it from being shrunk in size, there just aren't any tools that implement it.

The resize down code has to jump through some hoops to support resizing instances down. It basically involves creating a new VDI and then copying the data over.

That said, the xenapi driver only supports resizing a disk down during migrate. During create, it assumes it only ever needs to resize up (in the auto disk config case).

Changed in nova:
status: In Progress → Won't Fix
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.