xenapi: ImageTooLarge for instances with 0 disk size
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Rick Harris |
Bug Description
Create two flavors:
nova-manage flavor create --name=m1.nodisk --memory=512 --cpu=1 --root_gb=0 \
--flavor=7 --swap=0 --rxtx_factor=1.0 --is_public=true
nova-manage flavor create --name=m1.onegig --memory=512 --cpu=1 --root_gb=1 \
--flavor=8 --swap=0 --rxtx_factor=1.0 --is_public=true
Upload an image:
glance image-create --name growbug \
--copy-from=https:/
--container-
Wait until it is active, get its id:
IMAGEID=$(glance image-list | grep bugimage | sed -e 's/^| //g' -e 's/ |.*$//g')
Boot it up:
nova boot --image $IMAGEID --flavor 7 growinstance
The instance state will be error:
stack@DevStackO
| 200fd365-
And you see the following in the n-cpu log:
Failed to spawn, rolling back
Traceback (most recent call last):
File "/opt/stack/
vdis = create_
File "/opt/stack/
rv = f(*args, **kwargs)
File "/opt/stack/
block_
File "/opt/stack/
block_
File "/opt/stack/
context, session, instance, name_label, image, image_type)
File "/opt/stack/
image_id, image_type)
File "/opt/stack/
image_id, image_type)
File "/opt/stack/
vdis = _fetch_
File "/opt/stack/
_check_
File "/opt/stack/
raise exception.
ImageTooLarge: Image is larger than instance type allows
Changed in nova: | |
status: | Incomplete → New |
Changed in nova: | |
status: | New → Triaged |
Changed in nova: | |
assignee: | nobody → Rick Harris (rconradharris) |
status: | Triaged → In Progress |
Changed in nova: | |
milestone: | none → havana-1 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | havana-1 → 2013.2 |
...
Now, start an instance with a non-zero flavor: SDomU:~ /devstack$ nova flavor-list | grep m1.onegig
stack@DevStackO
| 8 | m1.onegig | 512 | 1 | 0 | | 1 | 1.0 | True | {} |
Start it:
nova boot --image $IMAGEID --flavor 8 nonzeroinstance
The instance will be booted:
stack@DevStackO SDomU:~ /devstack$ nova list | grep nonzeroinstance 8026-4c6f- a577-3866206606 c1 | nonzeroinstance | ACTIVE | private=10.0.0.5 |
| afda8249-
Now destroy the non-zero:
nova delete afda8249- 8026-4c6f- a577-3866206606 c1
And try to launch an instance with auto-disk size:
stack@DevStackO SDomU:~ /devstack$ nova flavor-list | grep m1.nodisk
| 7 | m1.nodisk | 512 | 0 | 0 | | 1 | 1.0 | True | {} |
nova boot --image $IMAGEID --flavor 7 growinstance
That will fail in a different way:
Failed to spawn, rolling back nova/nova/ virt/xenapi/ vmops.py" , line 456, in spawn disks_step( undo_mgr, vm_ref, vdis, disk_image_type) nova/nova/ virt/xenapi/ vmops.py" , line 143, in inner nova/nova/ virt/xenapi/ vmops.py" , line 388, in attach_disks_step nova/nova/ virt/xenapi/ vmops.py" , line 568, in _attach_disks type['root_ gb']) nova/nova/ virt/xenapi/ vm_utils. py", line 769, in auto_configure_disk part_and_ fs(dev, start, old_sectors, new_sectors) nova/nova/ virt/xenapi/ vm_utils. py", line 2032, in _resize_part_and_fs as_root= True) nova/nova/ utils.py" , line 243, in execute nError: Unexpected error while running command. rootwrap. conf resize2fs /dev/xvdb1 -16065s 2011)\n/ sbin/resize2fs: invalid option -- '1'\nUsage: /sbin/resize2fs [-d debug_flags] [-f] [-F] [-M] [-P] [-p] device [new_size]\n\n"
Traceback (most recent call last):
File "/opt/stack/
attach_
File "/opt/stack/
rv = f(*args, **kwargs)
File "/opt/stack/
injected_files)
File "/opt/stack/
instance_
File "/opt/stack/
_resize_
File "/opt/stack/
run_
File "/opt/stack/
cmd=' '.join(cmd))
ProcessExecutio
Command: sudo nova-rootwrap /etc/nova/
Exit code: 1
Stdout: ''
Stderr: "resize2fs 1.42 (29-Nov-