Inject keypair or others failed when using rbd backend and CONF.force_config_drive is false

Bug #1257674 reported by Haomai Wang
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Daniel Berrange

Bug Description

If you use rbd backend and CONF.force_config_drive option is False, you can't inject keypair, password or metadata to image.

We can see:
 https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L2567
require the image exists 'path' member, but we haven't has 'path' member when rbd backend:
https://github.com/openstack/nova/blob/master/nova/virt/libvirt/imagebackend.py#L462

If you set CONF.force_config_drive true, we will use another way and it will work well.

2013-12-04 13:50:21.146 2782 ERROR nova.compute.manager [req-b7d67222-f459-4fff-8729-2f90db64e5b8 fdbc2a102ba840a790f8485b0660a867 1c2c1941c7fa41e0811b21de2f81a120] [instance: 640251b0-4856-471d-8772-2b84884615f4] Instance failed to spawn
2013-12-04 13:50:21.146 2782 TRACE nova.compute.manager [instance: 640251b0-4856-471d-8772-2b84884615f4] Traceback (most recent call last):
2013-12-04 13:50:21.146 2782 TRACE nova.compute.manager [instance: 640251b0-4856-471d-8772-2b84884615f4] File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 1407, in _spawn
2013-12-04 13:50:21.146 2782 TRACE nova.compute.manager [instance: 640251b0-4856-471d-8772-2b84884615f4] block_device_info)
2013-12-04 13:50:21.146 2782 TRACE nova.compute.manager [instance: 640251b0-4856-471d-8772-2b84884615f4] File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 2074, in spawn
2013-12-04 13:50:21.146 2782 TRACE nova.compute.manager [instance: 640251b0-4856-471d-8772-2b84884615f4] admin_pass=admin_password)
2013-12-04 13:50:21.146 2782 TRACE nova.compute.manager [instance: 640251b0-4856-471d-8772-2b84884615f4] File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 2468, in _create_image
2013-12-04 13:50:21.146 2782 TRACE nova.compute.manager [instance: 640251b0-4856-471d-8772-2b84884615f4] injection_path = image('disk').path
2013-12-04 13:50:21.146 2782 TRACE nova.compute.manager [instance: 640251b0-4856-471d-8772-2b84884615f4] AttributeError: 'Rbd' object has no attribute '

Tags: ceph libvirt rbd
Haomai Wang (haomai)
Changed in nova:
assignee: nobody → Haomai Wang (haomai)
Revision history for this message
Haomai Wang (haomai) wrote :

I think we have no way to inject data to image until upgrade libguestfs to 1.22 or higher. Because libguestfs lower than 1.22 has no interface to deal with "rbd" protocol image.

So maybe we need to raise a exception when detect rbd image and not use configdrive.

Revision history for this message
Josh Durgin (jdurgin) wrote :

Throwing an exception when libvirt_image_type is rbd and any kind of file injection is enabled sounds good to me.

tags: added: ceph rbd
Michael Still (mikal)
tags: added: libvirt
Changed in nova:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Arnaud Abélard (arnaud-abelard) wrote :

From what I see, libguestfs is now 1.24 on 14.04 but I couldn't notice any progress about injection of data (key pairs, network, password, etc.) in rbd volumes with icehouse. What is the status of this bug?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Joe Gordon (<email address hidden>) on branch: master
Review: https://review.openstack.org/67653
Reason: Patch is stalled waiting for the author, looks like this has been abandoned. Feel free to restore.

Revision history for this message
Joe Gordon (jogo) wrote :
Changed in nova:
assignee: Haomai Wang (haomai) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/132020

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.openstack.org/132021

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.openstack.org/132022

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: master
Review: https://review.openstack.org/132023

Changed in nova:
assignee: nobody → Daniel Berrange (berrange)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/132024

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.openstack.org/132020
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=79af02046dab23ddb6399adfa8d9785694925be0
Submitter: Jenkins
Branch: master

commit 79af02046dab23ddb6399adfa8d9785694925be0
Author: Daniel P. Berrange <email address hidden>
Date: Wed Oct 29 17:08:21 2014 +0000

    virt: introduce model for describing local image metadata

    It is not sufficient to just pass a filename into the
    libguestfs APIs. There needs to be various pieces of
    metadata passed in order to support network based images.
    This introduces a simple data model to describe images
    when passing info from virt drivers to the VFS APIs.

    These classes are only intended to contain identifying
    attributes for the various storage backends used as
    images. They are not intended to hold any functional
    logic, as that will remain in the libvirt driver private
    image backend classes. This separates generic description
    of storage backends, from driver specific implementation
    details.

    Related-Bug: #1257674
    Change-Id: I5f86d91aa2bcef2385d5d16022a9bd4ea7b0485e

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/132021
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=0ea510f5560516bdcbf9167be68be58ea1ee3a41
Submitter: Jenkins
Branch: master

commit 0ea510f5560516bdcbf9167be68be58ea1ee3a41
Author: Daniel P. Berrange <email address hidden>
Date: Wed Oct 29 18:10:37 2014 +0000

    virt: convert disk mount API to use nova.virt.image.model

    Convert the nova.virt.disk.mount classes to use the
    nova.virt.image.model classes instead of manually
    passing a filename and image format as parameters.

    Related-Bug: #1257674
    Change-Id: Ibabcf48c95185ba443ef7575590eae6a63e0f8e5

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/132022
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=356e0651a676e3c43983a6f2848a79975f609f34
Submitter: Jenkins
Branch: master

commit 356e0651a676e3c43983a6f2848a79975f609f34
Author: Daniel P. Berrange <email address hidden>
Date: Wed Oct 29 18:54:44 2014 +0000

    virt: convert VFS API to use nova.virt.image.model

    Convert the nova.virt.disk.vfs classes to use the
    nova.virt.image.model classes instead of manually
    passing a filename and image format as parameters.
    This enables the libguestfs impl to now support the
    configuration of RBD images.

    Related-Bug: #1257674
    Change-Id: I41d6af52ffed924d35ac255625488f40f7989a0a

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/132023
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=5453d4b7a10c1a18172d8424004069f4e906e4c5
Submitter: Jenkins
Branch: master

commit 5453d4b7a10c1a18172d8424004069f4e906e4c5
Author: Daniel P. Berrange <email address hidden>
Date: Wed Oct 29 19:57:20 2014 +0000

    virt: convert disk API over to use nova.virt.image.model

    Convert the nova.virt.disk.api methods over to use the
    nova.virt.image.model classes instead of taking a file
    path and use_cow boolean as parameters.

    Related-Bug: #1257674
    Change-Id: I34e2f29e1f068636036226a7745d88640f724d93

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/132024
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=c9ad95448937076a354f56483acef0e8dc33fb05
Submitter: Jenkins
Branch: master

commit c9ad95448937076a354f56483acef0e8dc33fb05
Author: Daniel P. Berrange <email address hidden>
Date: Thu Oct 30 11:08:18 2014 +0000

    libvirt: convert imagebackend to support nova.virt.image.model classes

    Add a new 'get_model' method to nova.virt.libvirt.imagebackend.Image
    class that returns an instance of nova.virt.image.model.Image. This
    allows us to break the assumption that we only inject files into
    plain file based images, enabling support for RBD too.

    Closes-Bug: #1257674
    Change-Id: I4effa2d4d7b4d8da6a703451857e17bcbdb0b5c3

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-1 → 12.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.