Bug 1838669

Summary: [OSP 15z3]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 EOL 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, stchen, vromanso
Target Milestone: ---Keywords: Patch, Triaged, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-nova-19.2.1-0.20200709100426.b5159b4.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1838668
: 1838671 (view as bug list) Environment:
Last Closed: 2020-09-30 19:55:13 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, 1838668    
Bug Blocks: 1838671    

Description Lee Yarwood 2020-05-21 14:29:02 UTC
+++ This bug was initially created as a clone of Bug #1838668 +++

+++ 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 1 stchen 2020-09-30 19:55:13 UTC
Closing EOL, OSP 15 has been retired as of Sept 19, 2020