Hyper-V: Attribute error when trying to spawn instance from vhd image

Bug #1421272 reported by Adelina Tuvenie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Adelina Tuvenie

Bug Description

When trying to boot an instance from a vhd image we get:

AttributeError: 'NoneType' object has no attribute "root_gb"

This happens when we try to get the root disk size from the old flavor. Since on creation there is no old flavor, instance.get_flavor will return None and thus the AttributeError when trying to return the root_gb.

Tags: hyper-v
Changed in nova:
assignee: nobody → Adelina Tuvenie (atuvenie)
description: updated
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
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/156154

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit bbd4b5f372d1241f8f817e5aafbbd1aee2b385cd
Author: Adelina Tuvenie <email address hidden>
Date: Thu Feb 12 09:07:57 2015 -0800

    Fixes Attribute Error when trying to spawn instance from vhd on HyperV

    When trying to boot an instance from a vhd image we get a AttributeError.
    This happens when we try to get the root disk size from the old flavor.
    Since on creation there is no old flavor, instance.get_flavor() will return
    None and thus the AttributeError when trying to return te root_gb.

    This patch fixes this problem by checking if the return value from
    instance.get_flavor() is None, in which case it returns
    instance.root_gb.

    Change-Id: Ief16679a6b80f6f8b9246ea6a50773e40824bb7f
    Closes-Bug: 1421272

Changed in nova:
status: In Progress → Fix Committed
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
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.