The value of migration.dest_compute is incorrect after resize_revert operation successfully

Bug #1625462 reported by Charlotte Han
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Charlotte Han

Bug Description

I have two host: tecs-controller-node and tecs-OpenStack-Nova.

1. I did migrate action, then instance's state is as follow:
+--------------------------------------+----------+---------------+------------+-------------+--------------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+----------+---------------+------------+-------------+--------------------------------+
| ea40a5f7-d92b-4ad6-94c0-a18f2465519e | hanrong1 | VERIFY_RESIZE | - | Running | public=172.24.4.2, 2001:db8::8 |
+--------------------------------------+----------+---------------+------------+-------------+--------------------------------+

2. I did look at migrations' table for instance source_node and dest_node.

mysql> select * from migrations where instance_uuid='ea40a5f7-d92b-4ad6-94c0-a18f2465519e';
+---------------------+---------------------+------------+----+----------------------+---------------------+--------------+----------+--------------------------------------+----------------------+----------------------+----------------------+---------------------+---------+----------------+--------+--------------+------------------+------------------+------------+----------------+----------------+
| created_at | updated_at | deleted_at | id | source_compute | dest_compute | dest_host | status | instance_uuid | old_instance_type_id | new_instance_type_id | source_node | dest_node | deleted | migration_type | hidden | memory_total | memory_processed | memory_remaining | disk_total | disk_processed | disk_remaining |
+---------------------+---------------------+------------+----+----------------------+---------------------+--------------+----------+--------------------------------------+----------------------+----------------------+----------------------+---------------------+---------+----------------+--------+--------------+------------------+------------------+------------+----------------+----------------+
| 2016-09-20 02:38:24 | 2016-09-20 02:38:58 | NULL | 1 | tecs-controller-node | tecs-OpenStack-Nova | 192.168.1.60 | finished | ea40a5f7-d92b-4ad6-94c0-a18f2465519e | 6 | 6 | tecs-controller-node | tecs-OpenStack-Nova | 0 | migration | 0 | NULL | NULL | NULL | NULL | NULL | NULL |
+---------------------+---------------------+------------+----+----------------------+---------------------+--------------+----------+--------------------------------------+----------------------+----------------------+----------------------+---------------------+---------+----------------+--------+--------------+------------------+------------------+------------+----------------+----------------+

source_compute: tecs-controller-node
source_node: tecs-controller-node
dest_compute:tecs-OpenStack-Nova
dest_node: tecs-OpenStack-Nova

3. I did resize-revert action
stack@tecs-controller-node:~$ nova resize-revert hanrong1
stack@tecs-controller-node:~$ nova list
+--------------------------------------+----------+---------------+------------------+-------------+--------------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+----------+---------------+------------------+-------------+--------------------------------+
| ea40a5f7-d92b-4ad6-94c0-a18f2465519e | hanrong1 | REVERT_RESIZE | resize_reverting | Running | public=172.24.4.2, 2001:db8::8 |
+--------------------------------------+----------+---------------+------------------+-------------+--------------------------------+
stack@tecs-controller-node:~$ nova list
+--------------------------------------+----------+--------+------------+-------------+--------------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+----------+--------+------------+-------------+--------------------------------+
| ea40a5f7-d92b-4ad6-94c0-a18f2465519e | hanrong1 | ACTIVE | - | Running | public=172.24.4.2, 2001:db8::8 |
+--------------------------------------+----------+--------+------------+-------------+--------------------------------+

4. I did look at migrations' table for instance source_node and dest_node.
mysql> select * from migrations where instance_uuid='ea40a5f7-d92b-4ad6-94c0-a18f2465519e';
+---------------------+---------------------+------------+----+----------------------+----------------------+--------------+----------+--------------------------------------+----------------------+----------------------+----------------------+---------------------+---------+----------------+--------+--------------+------------------+------------------+------------+----------------+----------------+
| created_at | updated_at | deleted_at | id | source_compute | dest_compute | dest_host | status | instance_uuid | old_instance_type_id | new_instance_type_id | source_node | dest_node | deleted | migration_type | hidden | memory_total | memory_processed | memory_remaining | disk_total | disk_processed | disk_remaining |
+---------------------+---------------------+------------+----+----------------------+----------------------+--------------+----------+--------------------------------------+----------------------+----------------------+----------------------+---------------------+---------+----------------+--------+--------------+------------------+------------------+------------+----------------+----------------+
| 2016-09-20 02:38:24 | 2016-09-20 03:52:01 | NULL | 1 | tecs-controller-node | tecs-controller-node | 192.168.1.60 | reverted | ea40a5f7-d92b-4ad6-94c0-a18f2465519e | 6 | 6 | tecs-controller-node | tecs-OpenStack-Nova | 0 | migration | 0 | NULL | NULL | NULL | NULL | NULL | NULL |
+---------------------+---------------------+------------+----+----------------------+----------------------+--------------+----------+--------------------------------------+----------------------+----------------------+----------------------+---------------------+---------+----------------+--------+--------------+------------------+------------------+------------+----------------+----------------+

source_compute: tecs-controller-node
source_node: tecs-controller-node
dest_compute:tecs-controller-node
dest_node: tecs-OpenStack-Nova

The value of the dest_compute is not incorrect, it should be "tecs-OpenStack-Nova" after
finish_revert_resize operation.

Expected result
===============

source_compute: tecs-controller-node
source_node: tecs-controller-node
dest_compute:tecs-OpenStack-Nova
dest_node: tecs-controller-node

Environment
===========
1. git log -1
commit c6a07f5f0cbd978cc2a23214ddf4ecd520ce8335
Merge: 14d816e 09627f2
Author: Jenkins <email address hidden>
Date: Wed Sep 7 22:36:12 2016 +0000

    Merge "[placement] Allow inventory to violate allo

2. Which hypervisor did you use?
libvirt + kvm

Tags: resize migrate
Rajesh Tailor (ratailor)
Changed in nova:
assignee: nobody → Rajesh Tailor (ratailor)
Charlotte Han (hanrong)
Changed in nova:
assignee: Rajesh Tailor (ratailor) → Charlotte Han (hanrong)
Revision history for this message
Charlotte Han (hanrong) wrote :

sorry, Rajesh Tailor

I had sumbmited a patch set.

https://review.openstack.org/#/c/335270/

Matt Riedemann (mriedem)
Changed in nova:
status: New → In Progress
tags: added: migrate resize
Revision history for this message
Alex Xu (xuhj) wrote :

The API of os-migrations is also used by admin-user to query the history. When we revert the resize, the migration object's dest_compute shouldn't be changed, otherwise the history of migrations will changed.

I prefer to keep the dest_compute/node as original one.

Revision history for this message
Charlotte Han (hanrong) wrote :

I agree with your point.

I will modify patch code.

Charlotte Han (hanrong)
description: updated
summary: - The value of migration.dest_node is incorrect after finish_revert_resize
- successfully
+ The value of migration.dest_compute is incorrect after
+ finish_revert_resize successfully
Charlotte Han (hanrong)
Changed in nova:
importance: Undecided → Low
Charlotte Han (hanrong)
description: updated
Charlotte Han (hanrong)
summary: - The value of migration.dest_compute is incorrect after
- finish_revert_resize successfully
+ The value of migration.dest_compute is incorrect after resize_revert
+ operation successfully
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/335270
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b816e3cc33ad37c4b4850e05336fd3ed7ac9e197
Submitter: Jenkins
Branch: master

commit b816e3cc33ad37c4b4850e05336fd3ed7ac9e197
Author: zte-hanrong <email address hidden>
Date: Wed Jun 29 08:53:53 2016 +0800

    migration.source_compute should be unchanged after finish_revert_resize.

    The field of dest_compute in migration table represent destination host
    name during a migration. The value of migration.dest_compute has been
    changed to migration's source host name after resize-revert operation.
    That would lead to history records of migrations are not accurate.
    This change modifies this problem.

    Close-Bug:#1625462
    Change-Id: Ie616045c40ea4a18977c18df9f5624efa4ba7e6a

Charlotte Han (hanrong)
Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
status: Fix Committed → Fix Released
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.