availability_zone was not updated on time

Bug #1203250 reported by Guangya Liu (Jay Lau)
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Guangya Liu (Jay Lau)

Bug Description

Step 1) Create an aggregate
root@liugya-ubuntu:~# nova aggregate-create agg1 nova
+----+------+-------------------+-------+---------------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------+-------------------+-------+---------------------------------+
| 1 | agg1 | nova | [] | {u'availability_zone': u'nova'} |
+----+------+-------------------+-------+---------------------------------+
root@liugya-ubuntu:~# nova aggregate-add-host 1 liugya-ubuntu
Aggregate 1 has been successfully updated.
+----+------+-------------------+--------------------+---------------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------+-------------------+--------------------+---------------------------------+
| 1 | agg1 | nova | [u'liugya-ubuntu'] | {u'availability_zone': u'nova'} |
+----+------+-------------------+--------------------+---------------------------------+
root@liugya-ubuntu:~# nova aggregate-list
+----+------+-------------------+
| Id | Name | Availability Zone |
+----+------+-------------------+
| 1 | agg1 | nova |
+----+------+-------------------+

Step 2) Update aggregate
root@liugya-ubuntu:~# nova aggregate-update 1 agg1 nova1
Aggregate 1 has been successfully updated.
+----+------+-------------------+--------------------+----------------------------------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------+-------------------+--------------------+----------------------------------+
| 1 | agg1 | nova1 | [u'liugya-ubuntu'] | {u'availability_zone': u'nova1'} |
+----+------+-------------------+--------------------+----------------------------------+
root@liugya-ubuntu:~# nova aggregate-list
+----+------+-------------------+
| Id | Name | Availability Zone |
+----+------+-------------------+
| 1 | agg1 | nova1 |
+----+------+-------------------+

Step 3) Boot one instance
root@liugya-ubuntu:~# nova boot --image cirros-0.3.1-x86_64-uec --flavor 1 vm2
+--------------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------------+--------------------------------------+
| OS-EXT-STS:task_state | scheduling |
| image | cirros-0.3.1-x86_64-uec |
| OS-EXT-STS:vm_state | building |
| OS-EXT-SRV-ATTR:instance_name | instance-00000002 |
| OS-SRV-USG:launched_at | None |
| flavor | m1.tiny |
| id | 59b66dd5-1484-4471-ba64-fc41d1dfa8b1 |
| security_groups | [{u'name': u'default'}] |
| user_id | 5d988016150c4de0bed7f5b480b0cec8 |
| OS-DCF:diskConfig | MANUAL |
| accessIPv4 | |
| accessIPv6 | |
| progress | 0 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-AZ:availability_zone | nova |
| config_drive | |
| status | BUILD |
| updated | 2013-07-20T03:35:55Z |
| hostId | |
| OS-EXT-SRV-ATTR:host | None |
| OS-SRV-USG:terminated_at | None |
| key_name | None |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| name | vm2 |
| adminPass | 5oxXcm5N6LQK |
| tenant_id | 9215cf095ae844f5aa2e7d8f1f966c1a |
| created | 2013-07-20T03:35:55Z |
| os-extended-volumes:volumes_attached | [] |
| metadata | {} |
root@liugya-ubuntu:~# nova show vm2
+--------------------------------------+----------------------------------------------------------------+
| Property | Value |
+--------------------------------------+----------------------------------------------------------------+
| status | ACTIVE |
| updated | 2013-07-20T03:36:04Z |
| OS-EXT-STS:task_state | None |
| OS-EXT-SRV-ATTR:host | liugya-ubuntu |
| key_name | None |
| image | cirros-0.3.1-x86_64-uec (67d33b7f-cd36-4d8d-8163-4703930f84e4) |
| private network | 10.0.0.3 |
| hostId | 8ca66826661862c21e5cce57d3351767e30685ed53c7e6ae02094563 |
| OS-EXT-STS:vm_state | active |
| OS-EXT-SRV-ATTR:instance_name | instance-00000002 |
| OS-SRV-USG:launched_at | 2013-07-20T03:36:04.000000 |
| OS-EXT-SRV-ATTR:hypervisor_hostname | liugya-ubuntu |
| flavor | m1.tiny (1) |
| id | 59b66dd5-1484-4471-ba64-fc41d1dfa8b1 |
| security_groups | [{u'name': u'default'}] |
| OS-SRV-USG:terminated_at | None |
| user_id | 5d988016150c4de0bed7f5b480b0cec8 |
| name | vm2 |
| created | 2013-07-20T03:35:55Z |
| tenant_id | 9215cf095ae844f5aa2e7d8f1f966c1a |
| OS-DCF:diskConfig | MANUAL |
| metadata | {} |
| os-extended-volumes:volumes_attached | [] |
| accessIPv4 | |
| accessIPv6 | |
| progress | 0 |
| OS-EXT-STS:power_state | 1 |
| OS-EXT-AZ:availability_zone | nova | <<< Still nova, not right, should be nova1
| config_drive | |
+--------------------------------------+----------------------------------------------------------------+
root@liugya-ubuntu:~# nova aggregate-list
+----+------+-------------------+
| Id | Name | Availability Zone |
+----+------+-------------------+
| 1 | agg1 | nova1 |
+----+------+-------------------+

Step 4) Restart nova api, availability_zone update to the latest value of nova1

root@liugya-ubuntu:~# nova show vm2
+--------------------------------------+----------------------------------------------------------------+
| Property | Value |
+--------------------------------------+----------------------------------------------------------------+
| status | ACTIVE |
| updated | 2013-07-20T03:36:04Z |
| OS-EXT-STS:task_state | None |
| OS-EXT-SRV-ATTR:host | liugya-ubuntu |
| key_name | None |
| image | cirros-0.3.1-x86_64-uec (67d33b7f-cd36-4d8d-8163-4703930f84e4) |
| private network | 10.0.0.3 |
| hostId | 8ca66826661862c21e5cce57d3351767e30685ed53c7e6ae02094563 |
| OS-EXT-STS:vm_state | active |
| OS-EXT-SRV-ATTR:instance_name | instance-00000002 |
| OS-SRV-USG:launched_at | 2013-07-20T03:36:04.000000 |
| OS-EXT-SRV-ATTR:hypervisor_hostname | liugya-ubuntu |
| flavor | m1.tiny (1) |
| id | 59b66dd5-1484-4471-ba64-fc41d1dfa8b1 |
| security_groups | [{u'name': u'default'}] |
| OS-SRV-USG:terminated_at | None |
| user_id | 5d988016150c4de0bed7f5b480b0cec8 |
| name | vm2 |
| created | 2013-07-20T03:35:55Z |
| tenant_id | 9215cf095ae844f5aa2e7d8f1f966c1a |
| OS-DCF:diskConfig | MANUAL |
| metadata | {} |
| os-extended-volumes:volumes_attached | [] |
| accessIPv4 | |
| accessIPv6 | |
| progress | 0 |
| OS-EXT-STS:power_state | 1 |
| OS-EXT-AZ:availability_zone | nova1 | <<<<<<<<
| config_drive | |
+--------------------------------------+----------------------------------------------------------------+

Changed in nova:
assignee: nobody → Jay Lau (jay-lau-513)
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/38026

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

Reviewed: https://review.openstack.org/38026
Committed: http://github.com/openstack/nova/commit/43a9ffbaf83c6d7e7cfc5d2eb77d52ee55c7f895
Submitter: Jenkins
Branch: master

commit 43a9ffbaf83c6d7e7cfc5d2eb77d52ee55c7f895
Author: Guangya Liu <email address hidden>
Date: Sat Jul 20 16:23:22 2013 +0800

    Update availability_zone on time if it was changed

    The problem is that when the availability_zones for one host
    aggregation was updated, the VM attribute of availability_zones
    which belong to the host in the availability_zones was
    not updated on time.

    If updated values include availability_zones, then the cache
    which stored availability_zones and host need to be reset.

    Fix bug 1203250

    Change-Id: Ib3f08fbe3c74d5aa101da78faed43b0bc03cb988

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-3 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.