4a424ecabb
Fix cases of 'mkfs' failing because the partitions never showed up. Partition mappings will now be updated instead of just adding them with 'kpartx'. That means that 'kpartx' will also remove devmappings for deleted partitions. Traceback of failing mkfs call: 2020-05-11 22:03:25.523 | INFO diskimage_builder.block_device.utils [-] Calling [sudo sync] 2020-05-11 22:03:25.539 | INFO diskimage_builder.block_device.utils [-] Calling [sudo kpartx -avs /dev/loop0] 2020-05-11 22:03:25.581 | INFO diskimage_builder.block_device.utils [-] Calling [sudo mkfs -t ext4 -i 4096 -J size=64 -L cloudimg-rootfs -U 21c6f9eb-4d52-4e5c-b9b7-796735de8909 -q /dev/mapper/loop0p1] 2020-05-11 22:03:25.700 | ERROR diskimage_builder.block_device.blockdevice [-] Create failed; rollback initiated 2020-05-11 22:03:25.700 | Traceback (most recent call last): 2020-05-11 22:03:25.700 | File "/home/zuul/dib/lib/python3.6/site-packages/diskimage_builder/block_device/blockdevice.py", line 406, in cmd_create 2020-05-11 22:03:25.700 | node.create() 2020-05-11 22:03:25.700 | File "/home/zuul/dib/lib/python3.6/site-packages/diskimage_builder/block_device/level2/mkfs.py", line 133, in create 2020-05-11 22:03:25.700 | exec_sudo(cmd) 2020-05-11 22:03:25.700 | File "/home/zuul/dib/lib/python3.6/site-packages/diskimage_builder/block_device/utils.py", line 143, in exec_sudo 2020-05-11 22:03:25.700 | raise e 2020-05-11 22:03:25.700 | diskimage_builder.block_device.exception.BlockDeviceSetupException: exec_sudo failed 2020-05-11 22:03:25.700 | INFO diskimage_builder.block_device.level0.localloop [-] loopdev detach 2020-05-11 22:03:25.701 | INFO diskimage_builder.block_device.utils [-] Calling [sudo losetup -d /dev/loop0] 2020-05-11 22:03:25.732 | INFO diskimage_builder.block_device.level0.localloop [-] Remove image file [/tmp/dib_image.muyw7t1h/image0.raw] 2020-05-11 22:03:25.734 | ERROR diskimage_builder.block_device.blockdevice [-] Rollback complete, exiting 2020-05-11 22:03:25.740 | Traceback (most recent call last): 2020-05-11 22:03:25.740 | File "/home/zuul/dib/bin/dib-block-device", line 8, in <module> 2020-05-11 22:03:25.740 | sys.exit(main()) 2020-05-11 22:03:25.740 | File "/home/zuul/dib/lib/python3.6/site-packages/diskimage_builder/block_device/cmd.py", line 120, in main 2020-05-11 22:03:25.740 | return bdc.main() 2020-05-11 22:03:25.740 | File "/home/zuul/dib/lib/python3.6/site-packages/diskimage_builder/block_device/cmd.py", line 115, in main 2020-05-11 22:03:25.740 | self.args.func() 2020-05-11 22:03:25.740 | File "/home/zuul/dib/lib/python3.6/site-packages/diskimage_builder/block_device/cmd.py", line 36, in cmd_create 2020-05-11 22:03:25.740 | self.bd.cmd_create() 2020-05-11 22:03:25.740 | File "/home/zuul/dib/lib/python3.6/site-packages/diskimage_builder/block_device/blockdevice.py", line 406, in cmd_create 2020-05-11 22:03:25.740 | node.create() 2020-05-11 22:03:25.740 | File "/home/zuul/dib/lib/python3.6/site-packages/diskimage_builder/block_device/level2/mkfs.py", line 133, in create 2020-05-11 22:03:25.740 | exec_sudo(cmd) 2020-05-11 22:03:25.740 | File "/home/zuul/dib/lib/python3.6/site-packages/diskimage_builder/block_device/utils.py", line 143, in exec_sudo 2020-05-11 22:03:25.740 | raise e 2020-05-11 22:03:25.740 | diskimage_builder.block_device.exception.BlockDeviceSetupException: exec_sudo failed Change-Id: I374f7f22f9e93ef35eb5813712ca59e75f0733e8 Related-Bug: #1698337 |
||
---|---|---|
.zuul.d | ||
bin | ||
contrib | ||
diskimage_builder | ||
doc | ||
playbooks | ||
releasenotes | ||
roles | ||
tests | ||
.gitignore | ||
.gitreview | ||
.testr.conf | ||
bindep.txt | ||
LICENSE | ||
lower-constraints.txt | ||
pylint.cfg | ||
README.rst | ||
requirements.txt | ||
setup.cfg | ||
setup.py | ||
test-requirements.txt | ||
tox.ini |
Image building tools for OpenStack
diskimage-builder
is a flexible suite of components for
building a wide-range of disk images, filesystem images and ramdisk
images for use with OpenStack.
This repository has the core functionality for building such images, both virtual and bare metal. Images are composed using elements; while fundamental elements are provided here, individual projects have the flexibility to customise the image build with their own elements.
For example:
$ DIB_RELEASE=bionic disk-image-create -o ubuntu-bionic.qcow2 vm ubuntu
will create a bootable Ubuntu Bionic based qcow2
image.
diskimage-builder
is useful to anyone looking to produce
customised images for deployment into clouds. These tools are the
components of TripleO that are
responsible for building disk images. They are also used extensively to
build images for testing OpenStack itself, particularly with nodepool.
Platforms supported include Ubuntu, CentOS, RHEL and Fedora.
Full documentation, the source of which is in
doc/source/
, is published at:
Copyright
Copyright 2012 Hewlett-Packard Development Company, L.P. Copyright (c) 2012 NTT DOCOMO, INC.
All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.