Nova Image Resize Generating Errors

Bug #1730892 reported by Xuanzhou Perry Dong on 2017-11-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Low
Xuanzhou Perry Dong

Bug Description

Description
===========
When flavor disk size is larger than the image size, Nova will try to increase the image disk size to match the flavor disk size. In the process, it will call resize2fs to resize the image disk file system as will for raw-format, but this will generate an error since resize2fs should be executed on a partition block device instead of the whole block device (which includes boot sector, partition table, etc).

Steps to Reproduce
==================

1. Set the following configuration for nova-compute:
use_cow_images = False
force_raw_images = True

2. nova boot --image cirros-0.3.5-x86_64-disk --nic net-id=6f0df6a5-8848-427b-8222-7b69d5602fe4 --flavor m1.tiny test_vm

The following error log are generated:

Nov 08 14:42:51 devstack01 nova-compute[10609]: DEBUG nova.virt.disk.api [None req-771fa44d-46ce-4486-9ed7-7a89ddb735ed demo admin] Unable to determine label for image <LocalFileImage:{'path': '/opt/stack/data/nova/instances/73b49be7-0b5f-4a9d-a187-bbbf7fd59961/disk', 'format': 'raw'}> with error Unexpected error while running command.
Nov 08 14:42:51 devstack01 nova-compute[10609]: Command: e2label /opt/stack/data/nova/instances/73b49be7-0b5f-4a9d-a187-bbbf7fd59961/disk
Nov 08 14:42:51 devstack01 nova-compute[10609]: Exit code: 1
Nov 08 14:42:51 devstack01 nova-compute[10609]: Stdout: u''
Nov 08 14:42:51 devstack01 nova-compute[10609]: Stderr: u"e2label: Bad magic number in super-block while trying to open /opt/stack/data/nova/instances/73b49be7-0b5f-4a9d-a187-bbbf7fd59961/disk\nCouldn't find valid filesystem superblock.\n". Cannot resize. {{(pid=10609) is_image_extendable /opt/stack/nova/nova/virt/disk/api.py:254}}

Expected Result
===============
Wrong command should not be executed and no error logs should be generated.

Actual Result
=============
Error logs are generated:

Environment
===========
1. Openstack Nova
stack@devstack01:/opt/stack/nova$ git log -1
commit 232458ae4e83e8b218397e42435baa9f1d025b68
Merge: 650c9f3 9d400c3
Author: Jenkins <email address hidden>
Date: Tue Oct 10 06:27:52 2017 +0000

    Merge "rp: Move RP._get|set_aggregates() to module scope"

2. Hypervisor
Libvirt + QEMU
stack@devstack01:/opt/stack/nova$ dpkg -l | grep libvirt
ii libvirt-bin 3.6.0-1ubuntu5~cloud0 amd64 programs for the libvirt library
ii libvirt-clients 3.6.0-1ubuntu5~cloud0 amd64 Programs for the libvirt library
ii libvirt-daemon 3.6.0-1ubuntu5~cloud0 amd64 Virtualization daemon
ii libvirt-daemon-system 3.6.0-1ubuntu5~cloud0 amd64 Libvirt daemon configuration files
ii libvirt-dev:amd64 3.6.0-1ubuntu5~cloud0 amd64 development files for the libvirt library
ii libvirt0:amd64 3.6.0-1ubuntu5~cloud0 amd64 library for interfacing with different virtualization systems
stack@devstack01:/opt/stack/nova$ dpkg -l | grep qemu
ii ipxe-qemu 1.0.0+git-20150424.a25a16d-1ubuntu1 all PXE boot firmware - ROM images for qemu
ii qemu-block-extra:amd64 1:2.10+dfsg-0ubuntu3~cloud0 amd64 extra block backend modules for qemu-system and qemu-utils
ii qemu-kvm 1:2.10+dfsg-0ubuntu1~cloud0 amd64 QEMU Full virtualization
ii qemu-slof 20151103+dfsg-1ubuntu1 all Slimline Open Firmware -- QEMU PowerPC version
ii qemu-system 1:2.10+dfsg-0ubuntu3~cloud0 amd64 QEMU full system emulation binaries
ii qemu-system-arm 1:2.10+dfsg-0ubuntu1~cloud0 amd64 QEMU full system emulation binaries (arm)
ii qemu-system-common 1:2.10+dfsg-0ubuntu3~cloud0 amd64 QEMU full system emulation binaries (common files)
ii qemu-system-mips 1:2.10+dfsg-0ubuntu1~cloud0 amd64 QEMU full system emulation binaries (mips)
ii qemu-system-misc 1:2.10+dfsg-0ubuntu1~cloud0 amd64 QEMU full system emulation binaries (miscellaneous)
ii qemu-system-ppc 1:2.10+dfsg-0ubuntu1~cloud0 amd64 QEMU full system emulation binaries (ppc)
ii qemu-system-s390x 1:2.10+dfsg-0ubuntu1~cloud0 amd64 QEMU full system emulation binaries (s390x)
ii qemu-system-sparc 1:2.10+dfsg-0ubuntu1~cloud0 amd64 QEMU full system emulation binaries (sparc)
ii qemu-system-x86 1:2.10+dfsg-0ubuntu1~cloud0 amd64 QEMU full system emulation binaries (x86)
ii qemu-utils 1:2.10+dfsg-0ubuntu3~cloud0 amd64 QEMU utilities
stack@devstack01:/opt/stack/nova$

3. Networking type
Neutron with Openvswitch

I will try to push a change for this.

Changed in nova:
assignee: nobody → Xuanzhou Perry Dong (oss-xzdong)
importance: Undecided → Low
Changed in nova:
status: New → In Progress
Changed in nova:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers