Bug 1327237

Summary: Instance metadata is lost after evacuate is executed [OSP 7]
Product: Red Hat OpenStack Reporter: Pratik Pravin Bandarkar <pbandark>
Component: openstack-novaAssignee: Kashyap Chamarthy <kchamart>
Status: CLOSED ERRATA QA Contact: Prasanth Anbalagan <panbalag>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.0 (Kilo)CC: berrange, dasmith, eglynn, jschluet, kchamart, mburns, sbauza, sferdjao, sgordon, srevivo, vaggarwa, vromanso
Target Milestone: ---Keywords: ZStream
Target Release: 7.0 (Kilo)   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-nova-2015.1.3-17.el7ost Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1328524 1333132 (view as bug list) Environment:
Last Closed: 2016-06-01 12:27:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1328524, 1333132    

Description Pratik Pravin Bandarkar 2016-04-14 14:30:02 UTC
Description of problem:
when we boot a instance with image , and the image has metadata, eg. hw_qemu_guest_agent=yes.that means the instance enable qemu-guest-agent,but the qemu-guest-agent was disappeared after the instance evacuated.



Version-Release number of selected component (if applicable):
RHOS7

How reproducible:
100%

Steps to Reproduce:
[root@dhcp9-5 ~(keystone_admin)]# glance image-update cirros_local --property hw_qemu_guest_agent=yes
+--------------------------------+--------------------------------------+
| Property                       | Value                                |
+--------------------------------+--------------------------------------+
| Property 'hw_qemu_guest_agent' | yes                                  |
| checksum                       | 45e88c29a92d9ee5fe3654f230b63358     |
| container_format               | bare                                 |
| created_at                     | 2016-03-03T12:57:04.000000           |
| deleted                        | False                                |
| deleted_at                     | None                                 |
| disk_format                    | qcow2                                |
| id                             | fadf6efd-4b3f-448d-83dd-64a9456bf5a0 |
| is_public                      | False                                |
| min_disk                       | 0                                    |
| min_ram                        | 0                                    |
| name                           | cirros_local                         |
| owner                          | 15de48be19454167985b555a0339e6a1     |
| protected                      | False                                |
| size                           | 19005440                             |
| status                         | active                               |
| updated_at                     | 2016-04-14T12:51:16.000000           |
| virtual_size                   | None                                 |
+--------------------------------+--------------------------------------+

[root@dhcp9-5 instances(keystone_admin)]#  nova boot --flavor f39bf420-d778-41f4-b165-20b6c19fd8b3 --image cirros_local   --nic net-id=c230dc2e-0dd2-40b6-9d89-d49e77d822c1 pbandark
^[[1;5A+--------------------------------------+-----------------------------------------------------+
| Property                             | Value                                               |
+--------------------------------------+-----------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                              |
| OS-EXT-AZ:availability_zone          |                                                     |
| OS-EXT-SRV-ATTR:host                 | -                                                   |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | -                                                   |
| OS-EXT-SRV-ATTR:instance_name        | instance-00000049                                   |
| OS-EXT-STS:power_state               | 0                                                   |
| OS-EXT-STS:task_state                | scheduling                                          |
| OS-EXT-STS:vm_state                  | building                                            |
| OS-SRV-USG:launched_at               | -                                                   |
| OS-SRV-USG:terminated_at             | -                                                   |
| accessIPv4                           |                                                     |
| accessIPv6                           |                                                     |
| adminPass                            | s8uRbUMnzTjz                                        |
| config_drive                         |                                                     |
| created                              | 2016-04-14T14:09:01Z                                |
| flavor                               | m1.small (f39bf420-d778-41f4-b165-20b6c19fd8b3)     |
| hostId                               |                                                     |
| id                                   | 437d1216-9af8-4709-a710-6350623ddd27                |
| image                                | cirros_local (fadf6efd-4b3f-448d-83dd-64a9456bf5a0) |
| key_name                             | -                                                   |
| metadata                             | {}                                                  |
| name                                 | pbandark                                            |
| os-extended-volumes:volumes_attached | []                                                  |
| progress                             | 0                                                   |
| security_groups                      | default                                             |
| status                               | BUILD                                               |
| tenant_id                            | 15de48be19454167985b555a0339e6a1                    |
| updated                              | 2016-04-14T14:09:01Z                                |
| user_id                              | 4f111e1c3cfe45d0b4407c844537a9f1                    |
+--------------------------------------+-----------------------------------------------------+

[root@dhcp9-5 instances(keystone_admin)]# virsh list
 Id    Name                           State
----------------------------------------------------
 10    instance-00000049              running

[root@dhcp9-5 instances(keystone_admin)]# virsh dumpxml 10
<domain type='qemu' id='10'>
  <name>instance-00000049</name>
  <uuid>437d1216-9af8-4709-a710-6350623ddd27</uuid>
  <metadata>
    <nova:instance xmlns:nova="http://openstack.org/xmlns/libvirt/nova/1.0">
      <nova:package version="2015.1.0-16.el7ost"/>
      <nova:name>pbandark</nova:name>
      <nova:creationTime>2016-04-14 14:10:03</nova:creationTime>

[...]

    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/org.qemu.guest_agent.0.instance-00000049.sock'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>

_____________

[root@dhcp9-5 instances(keystone_admin)]# nova host-evacuate dhcp9-5.gsslab.pnq.redhat.com --target_host dhcp10-41.gsslab.pnq.redhat.com --on-shared-storage
+--------------------------------------+-------------------+---------------+
| Server UUID                          | Evacuate Accepted | Error Message |
+--------------------------------------+-------------------+---------------+
| 437d1216-9af8-4709-a710-6350623ddd27 | True              |               |
+--------------------------------------+-------------------+---------------+

[root@dhcp10-41 ~]# virsh list
 Id    Name                           State
----------------------------------------------------
 20    instance-00000048              running
 21    instance-00000049              running <===

[root@dhcp10-41 ~]# virsh dumpxml 21
<domain type='qemu' id='21'>
  <name>instance-00000049</name>
  <uuid>437d1216-9af8-4709-a710-6350623ddd27</uuid>
  <metadata>
    <nova:instance xmlns:nova="http://openstack.org/xmlns/libvirt/nova/1.0">
      <nova:package version="2015.1.2-13.el7ost"/>
[...]

[root@dhcp10-41 ~]# virsh dumpxml 21 |grep -i agen
[root@dhcp10-41 ~]# 


Actual results:
- Instance metadata is lost after evacuate is executed

Expected results:
- Instance metadata should be persistent after evacuate is executed

Additional info:
upstream bz: https://bugs.launchpad.net/nova/+bug/1562681

Comment 3 Kashyap Chamarthy 2016-05-03 08:36:09 UTC
Upstream fix is merged: https://review.openstack.org/#/c/309440/ -- compute: Retain instance metadata for 'evacuate' on shared storage

Comment 13 errata-xmlrpc 2016-06-01 12:27:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1198