Booting m1.tiny instance causes 'ImageTooLarge' exception

Bug #827373 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Josh Kearney

Bug Description

Using nova trunk bzr revision 1440:

When booting an m1.tiny instance via the EC2 API I'm getting the following exception:

(nova): TRACE: Traceback (most recent call last):
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc/amqp.py", line 230, in _process_data
(nova): TRACE: rval = node_func(context=ctxt, **node_args)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/exception.py", line 98, in wrapped
(nova): TRACE: return f(*args, **kw)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/compute/manager.py", line 452, in run_instance
(nova): TRACE: self._run_instance(context, instance_id, **kwargs)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/compute/manager.py", line 381, in _run_instance
(nova): TRACE: _check_image_size()
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/compute/manager.py", line 373, in _check_image_size
(nova): TRACE: raise exception.ImageTooLarge()
(nova): TRACE: ImageTooLarge: Image is larger than instance type allows
(nova): TRACE:

----

I think we may have a math error in the _check_image_size() function of the compute manager. 'local_gb' for m1.tiny is set to 0 and the function does the following to determine the allowed image size:

            allowed_size_gb = instance_type['local_gb']
            allowed_size_bytes = allowed_size_gb * 1024 * 1024 * 1024

Related branches

Revision history for this message
Dan Prince (dan-prince) wrote :

Perhaps the adding a check to the _check_image_size function so that if 'local_gb' is zero we log it makes sense.

Also, Should m1.tiny have its local_gb set to 1 in the instance_types table?

Dan Prince (dan-prince)
Changed in nova:
importance: Undecided → High
Josh Kearney (jk0)
Changed in nova:
status: New → In Progress
assignee: nobody → Josh Kearney (jk0)
Revision history for this message
Vish Ishaya (vishvananda) wrote : Re: [Bug 827373] Re: Booting m1.tiny instance causes 'ImageTooLarge' exception

I think this might be a difference between how xs and libvirt handle instance construction. In libvirt we scale the root drive up to 10G for everything but tiny, and local gb is a second empty drive that is attached to the instance. Sounds like it is different in xenserver?

Vish

Revision history for this message
Josh Kearney (jk0) wrote :

Yeah, in XenServer local_gb is used as the size of the root partition. I just added a fix to allow it to be 0.

Revision history for this message
Vish Ishaya (vishvananda) wrote :

Hmm. It seems like we need to align these. I don't like different size instances based on the hypervisor.

Vish

On Aug 16, 2011, at 11:38 AM, Josh Kearney wrote:

> Yeah, in XenServer local_gb is used as the size of the root partition. I
> just added a fix to allow it to be 0.
>
> ** Branch linked: lp:~jk0/nova/lp827373
>
> --
> You received this bug notification because you are a member of Nova Bug
> Team, which is subscribed to OpenStack Compute (nova).
> https://bugs.launchpad.net/bugs/827373
>
> Title:
> Booting m1.tiny instance causes 'ImageTooLarge' exception
>
> Status in OpenStack Compute (Nova):
> In Progress
>
> Bug description:
> Using nova trunk bzr revision 1440:
>
> When booting an m1.tiny instance via the EC2 API I'm getting the
> following exception:
>
> (nova): TRACE: Traceback (most recent call last):
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc/amqp.py", line 230, in _process_data
> (nova): TRACE: rval = node_func(context=ctxt, **node_args)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/exception.py", line 98, in wrapped
> (nova): TRACE: return f(*args, **kw)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/compute/manager.py", line 452, in run_instance
> (nova): TRACE: self._run_instance(context, instance_id, **kwargs)
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/compute/manager.py", line 381, in _run_instance
> (nova): TRACE: _check_image_size()
> (nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/compute/manager.py", line 373, in _check_image_size
> (nova): TRACE: raise exception.ImageTooLarge()
> (nova): TRACE: ImageTooLarge: Image is larger than instance type allows
> (nova): TRACE:
>
> ----
>
> I think we may have a math error in the _check_image_size() function
> of the compute manager. 'local_gb' for m1.tiny is set to 0 and the
> function does the following to determine the allowed image size:
>
> allowed_size_gb = instance_type['local_gb']
> allowed_size_bytes = allowed_size_gb * 1024 * 1024 * 1024
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/nova/+bug/827373/+subscriptions

Revision history for this message
Josh Kearney (jk0) wrote :

I agree. Until today I always just assumed they were used for the same thing.

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
Josh Kearney (jk0) wrote :
Thierry Carrez (ttx)
Changed in nova:
milestone: none → diablo-4
Thierry Carrez (ttx)
Changed in nova:
milestone: diablo-4 → 2011.3
status: Fix Committed → Fix Released
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.