It is impossible to boot instance from flavor with ephemeral disk when use_cow_images is set to 0

Bug #1614486 reported by Dmitry Belyaninov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Status tracked in 10.0.x
10.0.x
Fix Committed
Medium
Timofey Durakov
9.x
Fix Released
Medium
Timofey Durakov

Bug Description

Detailed bug description:
During the verification of #1589490 the following error was raised:

Steps to reproduce:

deploy cluster 9.1
  1 controller
  1 compute

check:
root@node-2:~# ll /var/lib/nova/instances/
total 0
drwxr-xr-x 2 nova nova 6 Aug 17 12:52 ./
drwxr-xr-x 10 nova nova 105 Aug 18 10:17 ../

on compute:
set use_cow_images=0 value in nova config
service nova-compute restart

create flavor:
  nova flavor-create --ephemeral 1 'test_fl' 'auto' 1024 5 1
boot instance:
  nova boot new --image [image_id] --nic net-id=[internal_net_id] --flavor [test_flavor_id]

check:
root@node-2:~# ll /var/lib/nova/instances/_base/
total 33080
drwxr-xr-x 2 nova nova 53 Aug 18 11:04 ./
drwxr-xr-x 4 nova nova 30 Aug 18 11:04 ../
-rw-r--r-- 1 nova nova 51397120 Aug 18 11:04 724905800dd5458c4bc6a213b009e2234e97868f

Expected results:
boot passed
Actual result:
boot failed
Reproducibility:
100%
Workaround:
boot any instance with use_cow_images=True before
Impact:
 <put your information here>
Description of the environment:
snapshot #151

Additional information:
nova-conductor error:
9-4004-bf7a-ff8d0c5582d6] return cctxt.call(ctxt, 'deallocate_for_instance', **kwargs)
2016-08-18 11:05:05.645 13310 ERROR nova.conductor.manager [instance: 85db4722-bdd9-4004-bf7a-ff8d0c5582d6] File "/usr/lib/pytho
2016-08-18 11:04:05 ERR nova.scheduler.utils [req-f6fdb0ac-32c3-4aac-a09d-dc78428f979a 3af9b67e1c9f45d99c28295a9584a074 11090423f8fb45b1b249b799ba34ec22 - - -] [instance: 85db4722-bdd9-4004-bf7a-ff8d0c5582d6] Error from last host: node-2.test.domain.local (node node-2.test.domain.local): [u'Traceback (most recent call last):\n', u' File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 1926, in _do_build_and_run_instance\n filter_properties)\n', u' File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2116, in _build_and_run_instance\n instance_uuid=instance.uuid, reason=six.text_type(e))\n', u'RescheduledException: Build of instance 85db4722-bdd9-4004-bf7a-ff8d0c5582d6 was re-scheduled: No disk at /var/lib/nova/instances/_base/ephemeral_1_0706d66\n']

Changed in mos:
status: New → Confirmed
Revision history for this message
Timofey Durakov (tdurakov) wrote :
Changed in mos:
importance: Undecided → High
Changed in mos:
assignee: nobody → Timofey Durakov (tdurakov)
Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

Downgrading importance to Medium, as use_cow_images = 0 is neither default, nor recommended way to work with disk images.

tags: added: area-nova
summary: - It is impossible to boot instance from flavor with ephemeral disk
+ It is impossible to boot instance from flavor with ephemeral disk when
+ use_cow_images is set to 0
Revision history for this message
Timofey Durakov (tdurakov) wrote :

potential fix in upstream https://review.openstack.org/#/c/355415

Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

Too late to fix this in 9.1, moving to 9.2.

Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

Merged to stable/mitaka - https://review.openstack.org/#/c/368216/ - we'll merge it to the downstream branch with the next sync from upstream

Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :
Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

Fixed in 10.0:

rpodolyaka@rpodolyaka-pc:~/src/nova$ git log mirantis/10.0/newton --grep=I46b5658efafe558dd6b28c9910fb8fde830adec0
commit d0775c50d0c2bd50a62ccd49ea7063948af6c3b3
Author: Jens Rosenboom <email address hidden>
Date: Mon Aug 15 13:16:58 2016 +0200

    Fix resizing in imagebackend.cache()

    The Flat and Lvm backends do not create a 'base image' (the file in the
    image cache) when creating an ephemeral or swap disk. However, cache()
    expects it to exist when checking if a resize is required.

    This change ignores the resize check if the backing file doesn't exist.
    This happens to be ok, because ephemeral and swap disks are always
    created with the correct target size anyway, and therefore never need
    to be resized.

    Closes-Bug: 1608934
    Co-Authored-By: Matthew Booth <email address hidden>
    Change-Id: I46b5658efafe558dd6b28c9910fb8fde830adec0

tags: added: on-verification
Revision history for this message
Ekaterina Shutova (eshutova) wrote :

Verified on snapshot #495.

Instance booted successfully:
root@node-1:~# nova list
+--------------------------------------+------+--------+------------+-------------+--------------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------+--------+------------+-------------+--------------------------------+
| cb532fb3-fd7b-4fb7-a1aa-d82040a140a6 | new | ACTIVE | - | Running | admin_internal_net=10.109.24.3 |
+--------------------------------------+------+--------+------------+-------------+--------------------------------+

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.