xenapi: resize to size too small for disk fails badly

Bug #1155066 reported by John Garbutt
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
John Garbutt

Bug Description

Repo Steps:
- Create instance, maybe with 10GB disk
- Use image with auto_disk_config=True
- Fill up 6GB of space, with dd or whatever
- Request resize down to 5GB flavour

Expected:
- request is rejected, disk is too big

Actual:
- request accepted
- image shutdown and marked as error

Tags: xenserver
Revision history for this message
John Garbutt (johngarbutt) wrote :

I am looking at options to fix this, we may need a can_resize call to go down to the driver from the API layer.

Changed in nova:
importance: Undecided → Medium
assignee: nobody → John Garbutt (johngarbutt)
status: New → In Progress
tags: added: xenserver
Revision history for this message
John Garbutt (johngarbutt) wrote :

We could use the openstack agent to report disk usage, as XenServer only reports the size of the VHD, which is more like a "high water mark" of usage.

Revision history for this message
Bob Ball (bob-ball) wrote :

Since the VHDs don't get TRIMmed, isn't the high-water mark the only one we can use when resizing?
Unless an in-guest rsync is used between the old and new VHDs then the space can't be reclaimed as there is no way for the VHD to know which areas can be shrunk, and which have been written.

Revision history for this message
John Garbutt (johngarbutt) wrote :

Related to a problem with 1155068, we should look at the vdi_rec['physical_size'] to determine the max size.

Revision history for this message
John Garbutt (johngarbutt) wrote :

Sorry Bob, yes, I was a bit optimistic at first, and didn't see your comment when I wrote #4, so +1 to your comment.

I think dd of the partition is better than the rsync approach, but willing to be persuaded otherwise.

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Reviewed: https://review.openstack.org/24666
Committed: http://github.com/openstack/nova/commit/72e75dbcea66e6e4e2b0f5a931dcd647b2032ad6
Submitter: Jenkins
Branch: master

commit 72e75dbcea66e6e4e2b0f5a931dcd647b2032ad6
Author: John Garbutt <email address hidden>
Date: Thu Mar 14 15:41:47 2013 +0000

    xenapi: ensure vdi is not too big when resizing down

    Fix for bug 1155066

    This change adds some rollback into the resize disk down
    code within xenapi, and reports a better error message
    when the disk is too big to resize down.

    On a successful rollback, the user is notified of the error
    by the instance actions, rather than leaving
    the server in the error state.

    The user is then able to free up some disk space such that
    the resize can work correctly.

    Change-Id: Ibad568ab3cfb9caaf4fe002572c8cda973d501a7

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