Hyper-V: instance disk resize issues

Bug #1724240 reported by Lucian Petrut
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
compute-hyperv
Fix Released
Undecided
Unassigned

Bug Description

When resizing an instance having one ephemeral disk to a new flavor having the total ephemeral disks size set to 0, the Hyper-V driver will remove the disk without detaching it from the imported VM. For this reason, the instance will fail to start (actually, fail to realize the planned VM, in Hyper-V terms).

Trace: http://paste.openstack.org/show/623825/

At the same time, if the instance has multiple ephemeral disks, those will be ignored, remaining attached.

When resizing from a flavor with no ephemeral storage to a new one that does have ephemeral storage, no ephemeral disk is currently added as there is no explicit ephemeral BDM. This is inconsistent with the Libvirt driver behavior as well as Hyper-V driver behavior prior to the new BDM format addition.

The flavor ephemeral storage is not validated before attempting the migration/resize, thus ending up with error state instances in case of an invalid flavor.

If the new flavor's root disk size is smaller than the current one and the instance was booted from a volume, the resize will wrongfully be rejected.

The above mentioned behavior is caused by the following method:
https://github.com/openstack/compute-hyperv/blob/0c673d5c5c980a2d9c4f7a33d475324cd6fe85dc/compute_hyperv/nova/migrationops.py#L372-L415

summary: - Hyper-V: resize issues when having ephemerals
+ Hyper-V: instance disk resize issues
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to compute-hyperv (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/529046

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

Reviewed: https://review.openstack.org/526091
Committed: https://git.openstack.org/cgit/openstack/compute-hyperv/commit/?id=347877753702a723d98861bbd6726fc28016a0b4
Submitter: Zuul
Branch: master

commit 347877753702a723d98861bbd6726fc28016a0b4
Author: Lucian Petrut <email address hidden>
Date: Mon Dec 4 18:53:01 2017 +0200

    Fix instance disk resize issues

    This change provides the following instance disk resize fixes:

    - removed ephemeral disks are detached during the resize process,
    currently this step is skipped, for which reason the planned vms
    cannot be *realized*.

    - when resizing from a flavor with no ephemeral storage to a new
    one that does have ephemeral storage, no ephemeral disk is currently
    added as there is no explicit ephemeral BDM. This is inconsistent
    with the Libvirt driver behavior as well as Hyper-V driver behavior
    prior to the new BDM format addition. This change ensures that we're
    adding an ephemeral disk in such situations.

    - If the new flavor does not provide ephemeral storage, all ephemeral
    disks are removed.

    - We're now validating the new flavor ephemeral storage size before
    performing the resize/migration, thus failing early in case of an
    invalid flavor, also avoiding error state instances.

    - We're no longer erroring out if the new flavor's root disk size
    is smaller than the current one and the instance was booted from a
    volume.

    Closes-Bug: 1724240

    Change-Id: I296afc9bd947021fcca9199f6aca95ab51cd7df9

Changed in compute-hyperv:
status: New → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to compute-hyperv (master)

Reviewed: https://review.openstack.org/529046
Committed: https://git.openstack.org/cgit/openstack/compute-hyperv/commit/?id=aaf41258c5f5d814dfea19f99d08441d6917cf9a
Submitter: Zuul
Branch: master

commit aaf41258c5f5d814dfea19f99d08441d6917cf9a
Author: Lucian Petrut <email address hidden>
Date: Tue Dec 19 13:32:37 2017 +0200

    Add driver methods checking for shared storage

    The driver interface provides public methods that determine if two
    compute nodes use shared storage.

    Although we already use a similar mechanism, we do not implement
    those public driver methods, for which reason the compute manager
    will wrongfully assume that shared storage is never used.

    This is not an issue at the moment, as this mechanism is used by
    the manager only when cleaning up evacuated instances (which we
    do not currently support) and when reverting migrations (in which
    case we already have a copy of the instance files in the 'revert
    dir').

    This will become an issue though if we intend to start cleaning up
    migration files when destroying instances.

    This change adds the above mentioned public driver methods.

    Related-Bug: #1724240

    Change-Id: I790b39672fd8ffe467fc9d93daf7b38b26103d5d

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

Reviewed: https://review.openstack.org/526092
Committed: https://git.openstack.org/cgit/openstack/compute-hyperv/commit/?id=24cc1f3fffd9e9bdc07b15ab6597c87c9669ee3b
Submitter: Zuul
Branch: master

commit 24cc1f3fffd9e9bdc07b15ab6597c87c9669ee3b
Author: Lucian Petrut <email address hidden>
Date: Tue Dec 5 18:26:35 2017 +0200

    Cleanup migration files

    At the moment, if an instance migration/resize fails and is deleted
    while being in error state, the instance revert files are not deleted.

    This change fixes this issue, ensuring that instance migration files
    are cleaned up when an instance is destroyed.

    Closes-Bug: #1724240

    Change-Id: I3752e7d0bd96a7d418563afd997739e88a87914d

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to compute-hyperv (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/558742

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to compute-hyperv (stable/pike)

Reviewed: https://review.openstack.org/558742
Committed: https://git.openstack.org/cgit/openstack/compute-hyperv/commit/?id=8b20b8b5c4a3abdafeee2b026c65d01d3b7471b1
Submitter: Zuul
Branch: stable/pike

commit 8b20b8b5c4a3abdafeee2b026c65d01d3b7471b1
Author: Lucian Petrut <email address hidden>
Date: Tue Dec 5 18:26:35 2017 +0200

    Cleanup migration files

    At the moment, if an instance migration/resize fails and is deleted
    while being in error state, the instance revert files are not deleted.

    This change fixes this issue, ensuring that instance migration files
    are cleaned up when an instance is destroyed.

    (cherry-picked from commit 24cc1f3fffd9e9bdc07b15ab6597c87c9669ee3b)

    Closes-Bug: #1724240

    Change-Id: I3752e7d0bd96a7d418563afd997739e88a87914d

tags: added: in-stable-pike
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.