ARM64 disk images bigger than expected

Bug #1918461 reported by Carlos Goncalves
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
New
Undecided
Unassigned

Bug Description

Aarch64 images built by DIB are larger than expected (--image-size size -- image size in GB for the created image). For example, DIB outputs ~3.5 GB image when the desired image size is 3 GB.

An amphora image was created via Octavia's diskimage-crete.sh tool, a wrapper to DIB's disk-image-create tool:

  $ ./diskimage-create.sh -x -f -i centos-minimal -d 8 -a aarch64 -s 3

Full build log: https://cgoncalves.pt/trash/openstack/octavia/3d10a38e-c0f2-445e-a5d6-5be79c0521e8.txt

  $ qemu-img info amphora-x64-haproxy.qcow2
  image: amphora-x64-haproxy.qcow2
  file format: qcow2
  virtual size: 3.51 GiB (3771727872 bytes)
  disk size: 410 MiB
  cluster_size: 65536
  Format specific information:
      compat: 1.1
      compression type: zlib
      lazy refcounts: false
      refcount bits: 16
      corrupt: false

Nova flavor set with 3GB disk:

[stack@ampere-hr350a-08 diskimage-create]$ openstack flavor create --id 9ad09cde-b703-43e0-988a-86585831f28b --disk 3 --vcpus 1 --ram 1024 --property "hw_rng:allowed='True'" m1.amphora
+----------------------------+--------------------------------------+
| Field | Value |
+----------------------------+--------------------------------------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 3 |
| id | 9ad09cde-b703-43e0-988a-86585831f28b |
| name | m1.amphora |
| os-flavor-access:is_public | True |
| properties | hw_rng:allowed=''True'' |
| ram | 1024 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 1 |
+----------------------------+--------------------------------------+

Nova fails to create the VMs:

nova.exception.FlavorDiskSmallerThanImage: Flavor's disk is too small for requested image. Flavor disk is 3221225472 bytes, image is 3771727872 bytes.

Mar 10 12:21:34 ampere-hr350a-08.khw4.lab.eng.bos.redhat.com octavia-worker[140215]: ERROR oslo_messaging.rpc.server [-] Exception during message handling: octavia.common.exceptions.ComputeBuildException: Failed to build compute instance due to: {'code': 500, 'created': '2021-03-10T17:21:29Z', 'message': "Build of instance 5b8c2928-aca0-40f6-89ba-a9812a218309 aborted: Flavor's disk is too small for requested image. Flavor disk is 3221225472 bytes, image is 3771727872 bytes.", 'details': 'Traceback (most recent call last):\n File "/opt/stack/nova/nova/compute/manager.py", line 2393, in _build_and_run_instance\n accel_info=accel_info)\n File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 3851, in spawn\n block_device_info=block_device_info)\n File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 4240, in _create_image\n injection_info, fallback_from_host)\n File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 4368, in _create_and_inject_local_root\n instance, size, fallback_from_host)\n File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 9968, in _try_fetch_image_cache\n trusted_certs=instance.trusted_certs)\n File "/opt/stack/nova/nova/virt/libvirt/imagebackend.py", line 275, in cache\n *args, **kwargs)\n File "/opt/stack/nova/nova/virt/libvirt/imagebackend.py", line 642, in create_image\n self.verify_base_size(base, size)\n File "/opt/stack/nova/nova/virt/libvirt/imagebackend.py", line 331, in verify_base_size\n flavor_size=size, image_size=base_size)\nnova.exception.FlavorDiskSmallerThanImage: Flavor\'s disk is too small for requested image. Flavor disk is 3221225472 bytes, image is 3771727872 bytes.\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/opt/stack/nova/nova/compute/manager.py", line 2217, in _do_build_and_run_instance\n filter_properties, request_spec, accel_uuids)\n File "/opt/stack/nova/nova/compute/manager.py", line 2475, in _build_and_run_instance\n reason=e.format_message())\nnova.exception.BuildAbortException: Build of instance 5b8c2928-aca0-40f6-89ba-a9812a218309 aborted: Flavor\'s disk is too small for requested image. Flavor disk is 3221225472 bytes, image is 3771727872 bytes.\n'}

Revision history for this message
Ian Wienand (iwienand) wrote :

That seems about exactly the size of the EFI partition [1].

Not really sure what to do with that ... I guess "-s" is sizing the root partition only

[1] https://opendev.org/openstack/diskimage-builder/src/branch/master/diskimage_builder/elements/block-device-efi/block-device-default.yaml#L10

Revision history for this message
Carlos Goncalves (cgoncalves) wrote :
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.