← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1790221] [NEW] shelved offloaded server still shows old AZ while shelved

 

Public bug reported:

When a server is shelved (and offloaded from the compute host), the
instance.host and instance.node values are cleared because it's no
longer on any host:

https://github.com/openstack/nova/blob/bb14337c30df0c17bc1dadc00d5a5500ae2dc4b7/nova/compute/manager.py#L5007

However, the instance.availability_zone is not cleared, so we still see
the old host AZ on the instance from the API.

Recreate steps:

1. create an AZ and put a host in it (this is single-node devstack
created from master today):

stack@stein:~$ openstack aggregate add host DC1 stein
+-------------------+--------------------------------+
| Field             | Value                          |
+-------------------+--------------------------------+
| availability_zone | DC1                            |
| created_at        | 2018-08-31T21:01:06.000000     |
| deleted           | False                          |
| deleted_at        | None                           |
| hosts             | [u'stein']                     |
| id                | 1                              |
| metadata          | {u'availability_zone': u'DC1'} |
| name              | DC1                            |
| updated_at        | None                           |
+-------------------+--------------------------------+


2. Create a server - in this case there is only 1 host and it's in an AZ so that's what shows up for the server output:

stack@stein:~$ openstack server create --flavor m1.tiny --image
cirros-0.3.5-x86_64-disk --wait test-shelve-az

+-------------------------------------+-----------------------------------------------------------------+
| Field                               | Value                                                           |
+-------------------------------------+-----------------------------------------------------------------+
| OS-DCF:diskConfig                   | MANUAL                                                          |
| OS-EXT-AZ:availability_zone         | DC1                                                             |
| OS-EXT-SRV-ATTR:host                | stein                                                           |
| OS-EXT-SRV-ATTR:hypervisor_hostname | stein                                                           |
| OS-EXT-SRV-ATTR:instance_name       | instance-00000002                                               |
| OS-EXT-STS:power_state              | Running                                                         |
| OS-EXT-STS:task_state               | None                                                            |
| OS-EXT-STS:vm_state                 | active                                                          |
| OS-SRV-USG:launched_at              | 2018-08-31T21:05:51.000000                                      |
| OS-SRV-USG:terminated_at            | None                                                            |
| accessIPv4                          |                                                                 |
| accessIPv6                          |                                                                 |
| addresses                           | private=fdde:1239:d41d:0:f816:3eff:fe72:1e68, 10.0.0.9          |
| adminPass                           | HSetKiH8g336                                                    |
| config_drive                        |                                                                 |
| created                             | 2018-08-31T21:05:44Z                                            |
| flavor                              | m1.tiny (1)                                                     |
| hostId                              | 50c671bf8b1d64ad108a3d9ee3bfa53efcbdffd15d93060a33c1452c        |
| id                                  | 1fee3708-d2b1-4a76-b392-fa255ba426f6                            |
| image                               | cirros-0.3.5-x86_64-disk (94295199-2883-4314-a66b-ac854f62c02f) |
| key_name                            | None                                                            |
| name                                | test-shelve-az                                                  |
| progress                            | 0                                                               |
| project_id                          | 567c6a1c89f04c2985c3a8dc48a3aa5d                                |
| properties                          |                                                                 |
| security_groups                     | name='default'                                                  |
| status                              | ACTIVE                                                          |
| updated                             | 2018-08-31T21:05:51Z                                            |
| user_id                             | 71835b0bbc6c4baabbf666e44be7af25                                |
| volumes_attached                    |                                                                 |
+-------------------------------------+-----------------------------------------------------------------+


3. shelve (offload) the server and verify the host and hypervisor_hostname are no longer set for the instance but the AZ still is:

stack@stein:~$ openstack server shelve test-shelve-az
stack@stein:~$ openstack server show test-shelve-az
+-------------------------------------+-----------------------------------------------------------------+
| Field                               | Value                                                           |
+-------------------------------------+-----------------------------------------------------------------+
| OS-DCF:diskConfig                   | MANUAL                                                          |
| OS-EXT-AZ:availability_zone         | DC1                                                             |
| OS-EXT-SRV-ATTR:host                | None                                                            |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None                                                            |
| OS-EXT-SRV-ATTR:instance_name       | instance-00000002                                               |
| OS-EXT-STS:power_state              | Shutdown                                                        |
| OS-EXT-STS:task_state               | None                                                            |
| OS-EXT-STS:vm_state                 | shelved_offloaded                                               |
| OS-SRV-USG:launched_at              | 2018-08-31T21:05:51.000000                                      |
| OS-SRV-USG:terminated_at            | None                                                            |
| accessIPv4                          |                                                                 |
| accessIPv6                          |                                                                 |
| addresses                           | private=fdde:1239:d41d:0:f816:3eff:fe72:1e68, 10.0.0.9          |
| config_drive                        |                                                                 |
| created                             | 2018-08-31T21:05:44Z                                            |
| flavor                              | m1.tiny (1)                                                     |
| hostId                              |                                                                 |
| id                                  | 1fee3708-d2b1-4a76-b392-fa255ba426f6                            |
| image                               | cirros-0.3.5-x86_64-disk (94295199-2883-4314-a66b-ac854f62c02f) |
| key_name                            | None                                                            |
| name                                | test-shelve-az                                                  |
| project_id                          | 567c6a1c89f04c2985c3a8dc48a3aa5d                                |
| properties                          |                                                                 |
| security_groups                     | name='default'                                                  |
| status                              | SHELVED_OFFLOADED                                               |
| updated                             | 2018-08-31T21:06:31Z                                            |
| user_id                             | 71835b0bbc6c4baabbf666e44be7af25                                |
| volumes_attached                    |                                                                 |
+-------------------------------------+-----------------------------------------------------------------+

** Affects: nova
     Importance: Low
         Status: Triaged


** Tags: shelve

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1790221

Title:
  shelved offloaded server still shows old AZ while shelved

Status in OpenStack Compute (nova):
  Triaged

Bug description:
  When a server is shelved (and offloaded from the compute host), the
  instance.host and instance.node values are cleared because it's no
  longer on any host:

  https://github.com/openstack/nova/blob/bb14337c30df0c17bc1dadc00d5a5500ae2dc4b7/nova/compute/manager.py#L5007

  However, the instance.availability_zone is not cleared, so we still
  see the old host AZ on the instance from the API.

  Recreate steps:

  1. create an AZ and put a host in it (this is single-node devstack
  created from master today):

  stack@stein:~$ openstack aggregate add host DC1 stein
  +-------------------+--------------------------------+
  | Field             | Value                          |
  +-------------------+--------------------------------+
  | availability_zone | DC1                            |
  | created_at        | 2018-08-31T21:01:06.000000     |
  | deleted           | False                          |
  | deleted_at        | None                           |
  | hosts             | [u'stein']                     |
  | id                | 1                              |
  | metadata          | {u'availability_zone': u'DC1'} |
  | name              | DC1                            |
  | updated_at        | None                           |
  +-------------------+--------------------------------+

  
  2. Create a server - in this case there is only 1 host and it's in an AZ so that's what shows up for the server output:

  stack@stein:~$ openstack server create --flavor m1.tiny --image
  cirros-0.3.5-x86_64-disk --wait test-shelve-az

  +-------------------------------------+-----------------------------------------------------------------+
  | Field                               | Value                                                           |
  +-------------------------------------+-----------------------------------------------------------------+
  | OS-DCF:diskConfig                   | MANUAL                                                          |
  | OS-EXT-AZ:availability_zone         | DC1                                                             |
  | OS-EXT-SRV-ATTR:host                | stein                                                           |
  | OS-EXT-SRV-ATTR:hypervisor_hostname | stein                                                           |
  | OS-EXT-SRV-ATTR:instance_name       | instance-00000002                                               |
  | OS-EXT-STS:power_state              | Running                                                         |
  | OS-EXT-STS:task_state               | None                                                            |
  | OS-EXT-STS:vm_state                 | active                                                          |
  | OS-SRV-USG:launched_at              | 2018-08-31T21:05:51.000000                                      |
  | OS-SRV-USG:terminated_at            | None                                                            |
  | accessIPv4                          |                                                                 |
  | accessIPv6                          |                                                                 |
  | addresses                           | private=fdde:1239:d41d:0:f816:3eff:fe72:1e68, 10.0.0.9          |
  | adminPass                           | HSetKiH8g336                                                    |
  | config_drive                        |                                                                 |
  | created                             | 2018-08-31T21:05:44Z                                            |
  | flavor                              | m1.tiny (1)                                                     |
  | hostId                              | 50c671bf8b1d64ad108a3d9ee3bfa53efcbdffd15d93060a33c1452c        |
  | id                                  | 1fee3708-d2b1-4a76-b392-fa255ba426f6                            |
  | image                               | cirros-0.3.5-x86_64-disk (94295199-2883-4314-a66b-ac854f62c02f) |
  | key_name                            | None                                                            |
  | name                                | test-shelve-az                                                  |
  | progress                            | 0                                                               |
  | project_id                          | 567c6a1c89f04c2985c3a8dc48a3aa5d                                |
  | properties                          |                                                                 |
  | security_groups                     | name='default'                                                  |
  | status                              | ACTIVE                                                          |
  | updated                             | 2018-08-31T21:05:51Z                                            |
  | user_id                             | 71835b0bbc6c4baabbf666e44be7af25                                |
  | volumes_attached                    |                                                                 |
  +-------------------------------------+-----------------------------------------------------------------+

  
  3. shelve (offload) the server and verify the host and hypervisor_hostname are no longer set for the instance but the AZ still is:

  stack@stein:~$ openstack server shelve test-shelve-az
  stack@stein:~$ openstack server show test-shelve-az
  +-------------------------------------+-----------------------------------------------------------------+
  | Field                               | Value                                                           |
  +-------------------------------------+-----------------------------------------------------------------+
  | OS-DCF:diskConfig                   | MANUAL                                                          |
  | OS-EXT-AZ:availability_zone         | DC1                                                             |
  | OS-EXT-SRV-ATTR:host                | None                                                            |
  | OS-EXT-SRV-ATTR:hypervisor_hostname | None                                                            |
  | OS-EXT-SRV-ATTR:instance_name       | instance-00000002                                               |
  | OS-EXT-STS:power_state              | Shutdown                                                        |
  | OS-EXT-STS:task_state               | None                                                            |
  | OS-EXT-STS:vm_state                 | shelved_offloaded                                               |
  | OS-SRV-USG:launched_at              | 2018-08-31T21:05:51.000000                                      |
  | OS-SRV-USG:terminated_at            | None                                                            |
  | accessIPv4                          |                                                                 |
  | accessIPv6                          |                                                                 |
  | addresses                           | private=fdde:1239:d41d:0:f816:3eff:fe72:1e68, 10.0.0.9          |
  | config_drive                        |                                                                 |
  | created                             | 2018-08-31T21:05:44Z                                            |
  | flavor                              | m1.tiny (1)                                                     |
  | hostId                              |                                                                 |
  | id                                  | 1fee3708-d2b1-4a76-b392-fa255ba426f6                            |
  | image                               | cirros-0.3.5-x86_64-disk (94295199-2883-4314-a66b-ac854f62c02f) |
  | key_name                            | None                                                            |
  | name                                | test-shelve-az                                                  |
  | project_id                          | 567c6a1c89f04c2985c3a8dc48a3aa5d                                |
  | properties                          |                                                                 |
  | security_groups                     | name='default'                                                  |
  | status                              | SHELVED_OFFLOADED                                               |
  | updated                             | 2018-08-31T21:06:31Z                                            |
  | user_id                             | 71835b0bbc6c4baabbf666e44be7af25                                |
  | volumes_attached                    |                                                                 |
  +-------------------------------------+-----------------------------------------------------------------+

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1790221/+subscriptions


Follow ups