xenapi: resize operation could be faster

Bug #1221332 reported by John Garbutt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Sahid Orentino

Bug Description

There are a few small performance issues that can easily be fixed.

First a regression:
* on resize down we now call resize2fs twice, once to get the minimum file system size. There is no need to call it twice, just handle the error case correctly

The other issue:
* resize_disk uses copy, we could consider using clone (or snapshot) to save time, assuming that does not slow down the other steps
* consider using zerofree to help reduce the filesystem size further, after shrinking the filesystem, before the sparse copy
* while the above will take time, it should reduce the amount of data copied over the network

Tags: xenserver
Changed in nova:
assignee: nobody → sahid (sahid-ferdjaoui)
Revision history for this message
Sahid Orentino (sahid-ferdjaoui) wrote :

In the first point, I'm thinking about the kind of exception we have to raise:
     exception.ResizeError or processutils.ProcessExecutionError ?

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

We already raise an exception here:
https://github.com/openstack/nova/blob/master/nova/virt/xenapi/vm_utils.py#L2069

We can just skip the min_blocks check, then deal with the particular return value from resize2fs that happens when the filesystem minimum size is too big.

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

Changed in nova:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/46531
Committed: http://github.com/openstack/nova/commit/f246c3067b9608700dd29ee3828e094a9f0bc097
Submitter: Jenkins
Branch: master

commit f246c3067b9608700dd29ee3828e094a9f0bc097
Author: Sahid Orentino Ferdjaoui <email address hidden>
Date: Fri Sep 13 16:16:42 2013 +0000

    xenapi: Resize operations could be faster

     * Improves the code by using only one time resize2fs during the resize.
     * Removes the not used method: "_get_min_sectors".
     * Uses a VDI clone instead of copy in resize_disk's method.
     * Review of some test cases to accept the new behavior
       without _get_min_sectors.

    Closes-Bug: 1221332
    Change-Id: I40a1d7d467353ba904689d128de7f89d785b4052

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