instance path wrongfully trimmed during cold migration

Bug #1716862 reported by Claudiu Belu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
compute-hyperv
Fix Released
Undecided
Unassigned

Bug Description

During cold migration, the following happens:

1. source node stops the VMs, moves its file to a _revert path (\some\path\to\instance_000000be_revert), destroys the VM, and returns the _revert path as disk_info.
2. the destination node gets the disk_info. If it was configured not to move the VM storage (multiple CSVs cluster scenario), it will copy the files from the _revert path to a path without the ending _revert (\some\path\to\instance_000000be).

The issue is that string.rstrip function behaves in an unexpected way:

>>> "instance-000000be_revert".rstrip('_revert')
'instance-000000b'

This can lead to various errors.

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

Reviewed: https://review.openstack.org/503562
Committed: https://git.openstack.org/cgit/openstack/compute-hyperv/commit/?id=e00240f5d7e2d8e385b8c0d6ea18ed9eddd6e5d1
Submitter: Jenkins
Branch: master

commit e00240f5d7e2d8e385b8c0d6ea18ed9eddd6e5d1
Author: Claudiu Belu <email address hidden>
Date: Wed Sep 13 11:31:12 2017 +0300

    Fixes cold migration path trimming issue

    During cold migration, the following steps happen:

    1. The source node will stop the VM, copy the VM files to a _revert path,
    destroy the VM, and return the _revert path as disk_info.
    2. The destination node will get that disk_info, and if it was configured
    not to move the storage (multiple CSVs cluster scenario), it will just
    copy the files to a path without the ending _revert.

    The issue is that rstrip can strip more characters than desired. It will
    remove all characters contained by "_revert" from the given path's ending.
    For example:

    "instance_000000be_revert".rstrip("_revert") => "instance_000000b"

    Change-Id: I784835800a961be4ba755a4d51edbc931eccdc57
    Closes-Bug: #1716862

Changed in compute-hyperv:
status: New → Fix Released
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/504362

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

Reviewed: https://review.openstack.org/504362
Committed: https://git.openstack.org/cgit/openstack/compute-hyperv/commit/?id=4672aa051da6be9f4ff57457b59ff75ce344ce17
Submitter: Jenkins
Branch: stable/pike

commit 4672aa051da6be9f4ff57457b59ff75ce344ce17
Author: Claudiu Belu <email address hidden>
Date: Wed Sep 13 11:31:12 2017 +0300

    Fixes cold migration path trimming issue

    During cold migration, the following steps happen:

    1. The source node will stop the VM, copy the VM files to a _revert path,
    destroy the VM, and return the _revert path as disk_info.
    2. The destination node will get that disk_info, and if it was configured
    not to move the storage (multiple CSVs cluster scenario), it will just
    copy the files to a path without the ending _revert.

    The issue is that rstrip can strip more characters than desired. It will
    remove all characters contained by "_revert" from the given path's ending.
    For example:

    "instance_000000be_revert".rstrip("_revert") => "instance_000000b"

    Change-Id: I784835800a961be4ba755a4d51edbc931eccdc57
    Closes-Bug: #1716862
    (cherry picked from commit e00240f5d7e2d8e385b8c0d6ea18ed9eddd6e5d1)

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.