[Openstack] File injection and disk resize not working

Pádraig Brady P at draigBrady.com
Wed Apr 25 15:26:27 UTC 2012


On 04/25/2012 01:13 PM, Alvaro Lopez wrote:
> Dear.
> 
> I've run into troubles with the resize of partitions and file injection;
> using libvirt and raw images.
> 
> According to https://bugs.launchpad.net/nova/+bug/929005 file injection
> into images only works in the following situations:
>   1.- whole disk image -> inject to partition 1.
>   2.- separate kernel and ramdisk -> inject without partitions.
> 
> In situation 1 (i.e. using whole disk images, with one partition
> inside) the file injection works fine, the disk is resized to the
> actual size, but the partition is not extended. This is because the
> 'extend' function in 'nova/virt/disk/api.py' executes 'qemu-img',
> 'e2fsck' and 'resize2fs' in a row, assuming that there are no
> partitions at all.
> 
> In situation 2 (i.e. using whole disk images) if there is no kernel
> and ramdisk (but the file is a self-contained disk with an appropriate
> kernel) file injection does not work, but the resize works fine (since
> there are no partitions and the fsck and resize work as expected).
> 
> Shouldn't the file injection be extended so as to make it work in any
> situation? That is, add injection without partitions and without
> kernel/ramdisk.

That should be mostly handled with:
https://review.openstack.org/#/c/6668/

> Shouldn't the resize of disk take into account that it might be a disk
> with a (single) partition inside? This would imply dealing with the
> partitions (that is, delete and recreate them to the appropiate size).

Well that would be tricky to do generally, given that
the internal partition structure could be arbitrarily complicated.

cheers,
Pádraig.




More information about the Openstack mailing list