Suspending an instance fails when using vnic_type=direct

Bug #1406486 reported by Itzik Brown
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Moshe Levi
Juno
Fix Released
Undecided
Unassigned

Bug Description

When launching an instance with a pre-created port with binding:vnic_type='direct' and suspending the instance
fails with error 'NoneType' object has no attribute 'encode'

Nova compute log:
http://paste.openstack.org/show/155141/

Version
======
openstack-nova-common-2014.2.1-3.el7ost.noarch
openstack-nova-compute-2014.2.1-3.el7ost.noarch
python-novaclient-2.20.0-1.el7ost.noarch
python-nova-2014.2.1-3.el7ost.noarch

How to Reproduce
===============
# neutron port-create tenant1-net1 --binding:vnic-type direct
# nova boot --flavor m1.small --image rhel7 --nic port-id=<port-id> vm1
# nova suspend <vm-id>
# nova show <vm-id>

Madhurya (madhurya-jesu)
Changed in nova:
assignee: nobody → Madhurya (madhurya-jesu)
status: New → In Progress
status: In Progress → New
Madhurya (madhurya-jesu)
Changed in nova:
assignee: Madhurya (madhurya-jesu) → nobody
Changed in nova:
assignee: nobody → gundarapu kalyan reddy (gundarapu-reddy)
Changed in nova:
assignee: gundarapu kalyan reddy (gundarapu-reddy) → nobody
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/148096

Changed in nova:
assignee: nobody → Moshe Levi (moshele)
status: New → In Progress
tags: added: pic-passthrough
Moshe Levi (moshele)
tags: added: pci-passthrough
removed: pic-passthrough
Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
Matt Riedemann (mriedem) wrote :

The glanceclient change isn't in a released version of python-glanceclient yet and to fix this on the nova side I guess we'd have to release glanceclient, bump the minimum version in global-requirements, and then make that the min in nova via the automatic requirements update sync, and doesn't help anyone on an older client until then - and makes everyone move up, which is gross.

Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 6f002d26f28998c99d9922fdd49b0805c44ff22f
Author: Moshe Levi <email address hidden>
Date: Sun Jan 18 11:40:30 2015 +0200

    Fix detach_sriov_ports to get context to be able to get image metadata

    The previous implementation took the context using
    get_admin_context() which return context with admin flag set,
    but all the other attributes are None.
    This is not sufficient to get image metadata,
    it is need context with elevated permission.
    The change here is to update API to pass the context to suspend so
    it will be able to pass it to detach_sriov_ports.
    Also update the snapshot method to pass context to detach_sriov_ports

    Closes-Bug:#1406486

    Change-Id: I4757a7646d7bee66db03c5d2410de7378c039d41

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/164713

tags: added: juno-backport-potential
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-3 → 2015.1.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/juno)

Reviewed: https://review.openstack.org/164713
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6cc2dc834663ba7792f1b8c0945b81dc248b4783
Submitter: Jenkins
Branch: stable/juno

commit 6cc2dc834663ba7792f1b8c0945b81dc248b4783
Author: Moshe Levi <email address hidden>
Date: Sun Jan 18 11:40:30 2015 +0200

    Fix detach_sriov_ports to get context to be able to get image metadata

    The previous implementation took the context using
    get_admin_context() which return context with admin flag set,
    but all the other attributes are None.
    This is not sufficient to get image metadata,
    it is need context with elevated permission.
    The change here is to update API to pass the context to suspend so
    it will be able to pass it to detach_sriov_ports.
    Also update the snapshot method to pass context to detach_sriov_ports

    (cherry picked from commit 6f002d26f28998c99d9922fdd49b0805c44ff22f)

    Closes-Bug:#1406486
    Change-Id: I4757a7646d7bee66db03c5d2410de7378c039d41

tags: added: in-stable-juno
Ian Cordasco (icordasc)
no longer affects: python-glanceclient
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.