Unshelve instance failed with availability zone which be deleted

Bug #1723880 reported by TingtingYu
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Wishlist
Matt Riedemann

Bug Description

I create an instance with the availability zone named 'test_az' and host named 'compute', and then shelve the instance, then delete the availability zone test_az.
But the instance availability zone is still 'test_az',and unshelve the instance failed with the message "No valid host found for unshelve instance"
[root@controller ~(admin)]$ nova show test3
+--------------------------------------+---------------------------------------------------+
| Property | Value |
+--------------------------------------+---------------------------------------------------+
| OS-DCF:diskConfig | AUTO |
| OS-EXT-AZ:availability_zone | test_az |
| OS-EXT-SRV-ATTR:host | - |
| OS-EXT-SRV-ATTR:hostname | test3 |
| OS-EXT-SRV-ATTR:hypervisor_hostname | - |
| OS-EXT-SRV-ATTR:instance_name | instance-00000004 |
| OS-EXT-SRV-ATTR:kernel_id | |
| OS-EXT-SRV-ATTR:launch_index | 0 |
| OS-EXT-SRV-ATTR:ramdisk_id | |
| OS-EXT-SRV-ATTR:reservation_id | r-3i45u68y |
| OS-EXT-SRV-ATTR:root_device_name | /dev/vda |
| OS-EXT-SRV-ATTR:user_data | - |
| OS-EXT-STS:power_state | 4 |
| OS-EXT-STS:task_state | - |
| OS-EXT-STS:vm_state | shelved_offloaded |
| OS-SRV-USG:launched_at | 2017-10-16T07:05:18.000000 |
| OS-SRV-USG:terminated_at | - |
| accessIPv4 | |
| accessIPv6 | |
| config_drive | |
| created | 2017-10-16T07:05:12Z |
| description | test3 |
| flavor | m1.small (2) |
| hostId | |
| host_status | |
| id | 8cf627b7-fe67-405b-92b1-a42a6c66f8a6 |
| image | centos_7_2 (090d5564-9c64-459e-8d10-4382f1c72488) |
| key_name | - |
| locked | False |
| metadata | {} |
| name | test3 |
| os-extended-volumes:volumes_attached | [] |
| security_groups | default |
| status | SHELVED_OFFLOADED |
| tenant_id | 764169e694474ba0a40030e6c8531704 |
| test network | 192.168.0.5 |
| updated | 2017-10-16T07:07:33Z |
| user_id | 2ccb44e4ce2e42d5b805b898f2c10243 |
+--------------------------------------+---------------------------------------------------+

Revision history for this message
Matt Riedemann (mriedem) wrote :

Hmm, sounds legitimate. The question would be what we should do about this. Should a user expect that if they created an instance in a specific AZ and shelve offload it, that when unshelving it the instance will go back into that same AZ? We don't allow overriding an AZ on unshelve, so we'd have to use what was in the original request spec and if that AZ is now gone, do we just ignore the AZ - some might consider that an error too.

This probably wouldn't happen in a normal production stable cloud since the AZs shouldn't be changing like this without at least migrating the instances out of those AZs first.

tags: added: shelve
Changed in nova:
status: New → Confirmed
Matt Riedemann (mriedem)
tags: added: availability-zones
Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
Brin Zhang (zhangbailin) wrote :

Hi, I encountered another similar problem, the operational steps is:
1.Remove the host compute from the nova available zone and the compute host to nova_az, before the instance in the nova available zone, the available domain changed to nova_az.
2.Shelved the instance from the nova available zone(the current instance is in the available zone of nova_az),when the instance vm_state=SHELVED_OFFLOAD.The available zone of the instance has become nova instead of nova_az.
3.Unshelved the instance failed,The log printed is also "No valid host found for unshelve instance".

Revision history for this message
Matt Riedemann (mriedem) wrote :
Changed in nova:
importance: Undecided → Low
Brin Zhang (zhangbailin)
Changed in nova:
assignee: nobody → Brin Zhang (zhangbailin)
Changed in nova:
status: Confirmed → In Progress
Matt Riedemann (mriedem)
Changed in nova:
importance: Low → Wishlist
Changed in nova:
assignee: Brin Zhang (zhangbailin) → Matt Riedemann (mriedem)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/663851
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=27b6c18c666389ee68935f28cf340b7673879d6f
Submitter: Zuul
Branch: master

commit 27b6c18c666389ee68935f28cf340b7673879d6f
Author: zhangbailin <email address hidden>
Date: Fri Jun 7 15:11:29 2019 +0800

    Specify availability_zone to unshelve

    This adds support, in a new microversion, for specifying an availability
    zone to the unshelve server action when the server is shelved offloaded.

    Note that the functional test changes are due to those tests using the
    "latest" microversion where an empty dict is not allowed for unshelve
    with 2.77 so the value is changed from an empty dict to None.

    Implements: blueprint support-specifying-az-when-restore-shelved-server
    Closes-Bug: #1723880

    Change-Id: I4b13483eef42bed91d69eabf1f30762d6866f957

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 20.0.0.0rc1

This issue was fixed in the openstack/nova 20.0.0.0rc1 release candidate.

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.