Bug 1838668

Summary: [OSP 16.1]Error creating snapshot from instance when vm is paused and instance is booted from volume
Product: Red Hat OpenStack Reporter: Lee Yarwood <lyarwood>
Component: openstack-novaAssignee: Lee Yarwood <lyarwood>
Status: CLOSED ERRATA QA Contact: OSP DFG:Compute <osp-dfg-compute>
Severity: medium Docs Contact:
Priority: medium    
Version: 13.0 (Queens)CC: dasmith, dwojewod, eglynn, irichart, jhakimra, kchamart, ltamagno, nova-maint, sbauza, sgordon, smooney, vromanso
Target Milestone: z2Keywords: Triaged, ZStream
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-nova-20.3.1-0.20200708153424.5e36e91.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1835292
: 1838669 (view as bug list) Environment:
Last Closed: 2020-10-28 15:37:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1835292    
Bug Blocks: 1838669, 1838671    

Description Lee Yarwood 2020-05-21 14:27:03 UTC
+++ This bug was initially created as a clone of Bug #1835292 +++

Description of problem:

We want to create nova snapshot from instance. This instance has only one disk booting from cinder volume. 
If we try to create snapshot from running instance, there is not problem. Problem appears when we want snapshot from instance in paused mode

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

Red Hat Enterprise Linux Server release 7.8 (Maipo)

Red Hat OpenStack Platform release 13.0.11 (Queens)

How reproducible:

Create instance from volume (vda disk as root disk)
Pause VM
Create snapshot from instance paused


Steps to Reproduce:
1.
2.
3.
openstack server create --flavor n1.tiny --nic net-id=net1 --volume Centos vm1


(overcloud) [stack@undercloud-0 ~]$ openstack server show vm1
+-------------------------------------+----------------------------------------------------------+
| Field                               | Value                                                    |
+-------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig                   | MANUAL                                                   |
| OS-EXT-AZ:availability_zone         | nova                                                     |
| OS-EXT-SRV-ATTR:host                | compute-0.redhat.local                                   |
| OS-EXT-SRV-ATTR:hypervisor_hostname | compute-0.redhat.local                                   |
| OS-EXT-SRV-ATTR:instance_name       | instance-0000000e                                        |
| OS-EXT-STS:power_state              | Running                                                  |
| OS-EXT-STS:task_state               | None                                                     |
| OS-EXT-STS:vm_state                 | active                                                   |
| OS-SRV-USG:launched_at              | 2020-05-13T13:26:57.000000                               |
| OS-SRV-USG:terminated_at            | None                                                     |
| accessIPv4                          |                                                          |
| accessIPv6                          |                                                          |
| addresses                           | net1=20.0.1.9                                            |
| config_drive                        |                                                          |
| created                             | 2020-05-13T13:26:09Z                                     |
| flavor                              | n1.tiny (52afe22e-fcbb-4844-ab06-27d7eef9cc18)           |
| hostId                              | 27413a59a2eb57e6f2d85bfb910421917c32252a1f63b130a477743b |
| id                                  | 37fbe1ff-d260-4f50-adcc-41f82b00b103                     |
| image                               |                                                          |
| key_name                            | None                                                     |
| name                                | vm1                                                      |
| progress                            | 0                                                        |
| project_id                          | 878743a4cce84671ac45777dca8ca163                         |
| properties                          |                                                          |
| security_groups                     | name='default'                                           |
| status                              | ACTIVE                                                   |
| updated                             | 2020-05-13T13:37:11Z                                     |
| user_id                             | 800e469f62fc4bd9ae23f33ed3f7f61b                         |
| volumes_attached                    | id='93ee3953-e9f9-4e9e-aa66-2c915517061c'                |
+-------------------------------------+----------------------------------------------------------+

###### VM RUNNING ######################


(overcloud) [stack@undercloud-0 ~]$ nova image-create --poll vm1 vm1_snapshot_running

Server snapshotting... 100% complete
Finished
(overcloud) [stack@undercloud-0 ~]$ openstack volume snapshot list
+--------------------------------------+-----------------------------------+----------------------+-----------+------+
| ID                                   | Name                              | Description          | Status    | Size |
+--------------------------------------+-----------------------------------+----------------------+-----------+------+
| 27c99239-56d5-425f-935f-396eab9c2a7b | snapshot for vm1_snapshot_running | Volumen desde Imagen | available |   10 |
+--------------------------------------+-----------------------------------+----------------------+-----------+------+


###### VM PAUSED ######################



(overcloud) [stack@undercloud-0 ~]$ nova pause vm1
(overcloud) [stack@undercloud-0 ~]$ openstack server show vm1
+-------------------------------------+----------------------------------------------------------+
| Field                               | Value                                                    |
+-------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig                   | MANUAL                                                   |
| OS-EXT-AZ:availability_zone         | nova                                                     |
| OS-EXT-SRV-ATTR:host                | compute-0.redhat.local                                   |
| OS-EXT-SRV-ATTR:hypervisor_hostname | compute-0.redhat.local                                   |
| OS-EXT-SRV-ATTR:instance_name       | instance-0000000e                                        |
| OS-EXT-STS:power_state              | Paused                                                   |
| OS-EXT-STS:task_state               | None                                                     |
| OS-EXT-STS:vm_state                 | paused                                                   |
| OS-SRV-USG:launched_at              | 2020-05-13T13:26:57.000000                               |
| OS-SRV-USG:terminated_at            | None                                                     |
| accessIPv4                          |                                                          |
| accessIPv6                          |                                                          |
| addresses                           | net1=20.0.1.9                                            |
| config_drive                        |                                                          |
| created                             | 2020-05-13T13:26:09Z                                     |
| flavor                              | n1.tiny (52afe22e-fcbb-4844-ab06-27d7eef9cc18)           |
| hostId                              | 27413a59a2eb57e6f2d85bfb910421917c32252a1f63b130a477743b |
| id                                  | 37fbe1ff-d260-4f50-adcc-41f82b00b103                     |
| image                               |                                                          |
| key_name                            | None                                                     |
| name                                | vm1                                                      |
| project_id                          | 878743a4cce84671ac45777dca8ca163                         |
| properties                          |                                                          |
| security_groups                     | name='default'                                           |
| status                              | PAUSED                                                   |
| updated                             | 2020-05-13T13:52:32Z                                     |
| user_id                             | 800e469f62fc4bd9ae23f33ed3f7f61b                         |
| volumes_attached                    | id='93ee3953-e9f9-4e9e-aa66-2c915517061c'                |
+-------------------------------------+----------------------------------------------------------+
(overcloud) [stack@undercloud-0 ~]$ nova image-create --poll vm1 vm1_snapshot_paused

ERROR (Conflict): Cannot 'createImage' instance 37fbe1ff-d260-4f50-adcc-41f82b00b103 while it is in vm_state paused (HTTP 409) (Request-ID: req-f19ad7bd-5018-46eb-a6d0-7e6a2264a8bd)


Actual results:

ERROR (Conflict): Cannot 'createImage' instance 37fbe1ff-d260-4f50-adcc-41f82b00b103 while it is in vm_state paused (HTTP 409) (Request-ID: req-f19ad7bd-5018-46eb-a6d0-7e6a2264a8bd)
(overcloud) [stack@undercloud-0 ~]$ 


Expected results:

Server snapshotting... 100% complete
Finished

Additional info:

nova.api log

2020-05-13 13:53:12.768 20 INFO nova.api.openstack.wsgi [req-f19ad7bd-5018-46eb-a6d0-7e6a2264a8bd 800e469f62fc4bd9ae23f33ed3f7f61b 878743a4cce84671ac45777dca8ca163 - default default] HTTP exception thrown: Cannot 'createImage' instance 37fbe1ff-d260-4f50-adcc-41f82b00b103 while it is in vm_state paused
2020-05-13 13:53:12.769 20 INFO nova.api.openstack.requestlog [req-f19ad7bd-5018-46eb-a6d0-7e6a2264a8bd 800e469f62fc4bd9ae23f33ed3f7f61b 878743a4cce84671ac45777dca8ca163 - default default] 172.17.1.21 "POST /v2.1/servers/37fbe1ff-d260-4f50-adcc-41f82b00b103/action" status: 409 len: 149 microversion: 2.60 time: 0.188771

~~~
virsh dumpxml 37fbe1ff-d260-4f50-adcc-41f82b00b103 

    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/sda'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <serial>93ee3953-e9f9-4e9e-aa66-2c915517061c</serial>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>

~~~

Comment 7 errata-xmlrpc 2020-10-28 15:37:32 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 (Red Hat OpenStack Platform 16.1 bug fix and enhancement 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/RHEA-2020:4284