Bug 1006682

Summary: nova.compute.manager: Instance failed to spawn - NameError: global name '_' is not defined
Product: [Community] RDO Reporter: Gilles Dubreuil <gdubreui>
Component: openstack-novaAssignee: Nikola Dipanov <ndipanov>
Status: CLOSED NOTABUG QA Contact: Ami Jeain <ajeain>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: apevec, eglynn, gdubreui, ndipanov, pbrady, rbryant, xqueralt, yeylon
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-11 11:05:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
/var/log/nova/compute.log excerpt none

Description Gilles Dubreuil 2013-09-11 05:49:48 UTC
Created attachment 796253 [details]
/var/log/nova/compute.log excerpt

Description of problem:
Cannot launch instances from either Horizon GUI or command line.

Version-Release number of selected component:
RDO/Havana3
python-nova-2013.2-0.19.b3.el6.noarch
/usr/lib/python2.6/site-packages/nova/virt/disk/vfs/guestfs.py

Steps to Reproduce:
nova boot --image F19-x86_64 --flavor 2 --key_name key --nic net-id=e08a2e48-c9a4-49fb-aa4c-8db80c997a59 f19-1

Actual results:
The instance will come back with Status:
ERROR

Expected results:
Instance Status:
ACTIVE

Additional info:
Ian Wienand actually troubleshoot that one for me:
https://github.com/openstack/nova/commit/cd9d8e45c6b8a747069d0cec2c1ff0360ebe6d73

Therefore work around is to add following line to /usr/lib/python2.6/site-packages/nova/virt/disk/vfs/guestfs.py 

from nova.openstack.common.gettextutils import _

Comment 1 Xavier Queralt 2013-09-11 07:56:51 UTC
This a weird error, the file in question (nova/virt/disk/vfs/guestfs.py) is already patched in havana-3 and there is no reason for this exception.

How did you install RDO? Did you upgrade from Grizzly or it was a fresh install?

See below the contents of the file in question in the RDO package for F19:

[fedora@rdo1 ~]$ rpm -qa python-nova
python-nova-2013.2-0.19.b3.fc20.noarch

[fedora@rdo1 ~]$ head -n25 /usr/lib/python2.7/site-packages/nova/virt/disk/vfs/guestfs.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4

# Copyright 2012 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

from eventlet import tpool
import guestfs

from nova import exception
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log as logging
from nova.virt.disk.vfs import api as vfs
from nova.virt.libvirt import driver as libvirt_driver

Comment 2 Pádraig Brady 2013-09-11 09:52:19 UTC
Also happens with nova/objects/pci_device.py as per:
http://lists.openstack.org/pipermail/openstack-dev/2013-September/014881.html

Comment 3 Pádraig Brady 2013-09-11 10:07:04 UTC
Note the nova/objects/pci_device.py error, even though the same may be due to some other issue. So if the guestfs error is invalid, we can close this

Comment 4 Alan Pevec 2013-09-11 11:05:43 UTC
From Gilles: "That was due to guestfs.py file copied from previous version"

Comment 5 Gilles Dubreuil 2013-09-11 13:07:41 UTC
Sorry, my previous comment didn't make it through.

Yes the guestfs.py file was overriden with an older version.

My bad!

Thanks