Description of problem: In order to boot from cinder volume an ironic baremetal node following this [1] procedure, you need to create the image including iscsi-boot using disk-image-create as follows: export DIB_CLOUD_INIT_DATASOURCES="ConfigDrive, OpenStack" export DIB_LOCAL_IMAGE=/home/stack/user-images/baremetal/boot-volume/centos7-baremetal.qcow2 sudo disk-image-create centos7 vm cloud-init-datasources dhcp-all-interfaces iscsi-boot dracut-regenerate block-device-efi -o centos7-image-whole-boot-volume NOTE: centos7-baremetal.qcow2 is just the latest centos image But the run breaks when it tries to use "get_image_element_array" command because it does not find it: ... ... ... 2018-11-29 08:49:58.244 | +++ get_image_element_array 2018-11-29 08:49:58.250 | /tmp/in_target.d/pre-install.d/../environment.d/open-iscsi-config: line 2: get_image_element_array: command not found 2018-11-29 08:49:58.251 | ++ eval declare -A 'image_elements=()' 2018-11-29 08:49:58.251 | +++ image_elements=() 2018-11-29 08:49:58.251 | +++ declare -A image_elements 2018-11-29 08:49:58.251 | ++ found=0 2018-11-29 08:49:58.251 | ++ '[' 0 = 0 ']' 2018-11-29 08:49:58.251 | ++ echo 'The dracut-regenerate element is required!' 2018-11-29 08:49:58.251 | The dracut-regenerate element is required! 2018-11-29 08:49:58.251 | ++ exit 1 ... ... ... [1] https://docs.openstack.org/ironic/rocky/admin/boot-from-volume.html Version-Release number of selected component (if applicable): disk-image-create 2.17.1 How reproducible: Always reproducible Steps to Reproduce: 1. Try to create an image with the above disk-image-create command Actual results: It fails with "get_image_element_array command not found" Expected results: An image with iscsi-boot is created
Please provide the command you used and the full output. There is an issue with image create in RHEL 7.6 [1] that has a workaround here [2]. Its likely that this is the issue you are hitting. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1646976 [2] https://bugzilla.redhat.com/show_bug.cgi?id=1643273#c10
Created attachment 1514013 [details] complete output with error
Hi, i am not aware of this element and we are not including it in our images, so i guess this hasn't passed our testing. However, Dmitry was working on a similar patch and he has tested on our environment: http://git.openstack.org/cgit/openstack/diskimage-builder/commit/?id=f0f3e3bac46c62d99adbbd0b0f1e47706e107f13. Luis, this element will help you? It is iscsi related, please can you look and check if that makes sense to apply instead of iscsi-boot ?
(In reply to Yolanda Robla from comment #3) > Hi, i am not aware of this element and we are not including it in our > images, so i guess this hasn't passed our testing. However, Dmitry was > working on a similar patch and he has tested on our environment: > http://git.openstack.org/cgit/openstack/diskimage-builder/commit/ > ?id=f0f3e3bac46c62d99adbbd0b0f1e47706e107f13. > Luis, this element will help you? It is iscsi related, please can you look > and check if that makes sense to apply instead of iscsi-boot ? Checking what iscsi-boot does [1] I'm not sure that's enough and, besides that, if people follow upstream guide for boot ironic nodes from volume, they will try to use iscsi-boot and head to this issue. I think it could be a good idea to include this element as part of our testing not that we support this feature. [1] https://docs.openstack.org/diskimage-builder/latest/elements/iscsi-boot/README.html [2] https://docs.openstack.org/ironic/rocky/admin/boot-from-volume.html
Can you check the version of diskimage-builder that you are using? Going to try locally to see if i can replicate the issue.
(In reply to Yolanda Robla from comment #5) > Can you check the version of diskimage-builder that you are using? Going to > try locally to see if i can replicate the issue. disk-image-create 2.17.1
Hi Luis, you are right, i was able to reproduce the issue. It performs a check on the incorrect phase of dib. I proposed this patch: https://review.openstack.org/#/c/627949/ Can you check if that works for you? Also, when you build the image, switch the order of the elements: sudo disk-image-create centos7 vm cloud-init-datasources dhcp-all-interfaces dracut-regenerate iscsi-boot block-device-efi -o centos7-image-whole-boot-volume Otherwise, it will not pass the check
Environment: diskimage-builder-2.19.0-1.el7ost.noarch I ran the following steps successfully without error: wget https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2 export DIB_CLOUD_INIT_DATASOURCES="ConfigDrive, OpenStack" export DIB_LOCAL_IMAGE=/home/stack/CentOS-7-x86_64-GenericCloud.qcow2 sudo disk-image-create centos7 vm cloud-init-datasources dhcp-all-interfaces dracut-regenerate iscsi-boot block-device-efi -o centos7-image-whole-boot-volume [root@undercloud-0 ~]# ls -ltr .cache/image-create/ total 633944 -rw-r--r--. 1 root root 0 Mar 6 16:58 CentOS-7-x86_64-GenericCloud.qcow2.xz.tgz.lock -rw-------. 1 root root 271600308 Mar 6 16:58 CentOS-7-x86_64-GenericCloud.qcow2.xz -rw-r--r--. 1 root root 377555801 Mar 6 16:59 CentOS-7-x86_64-GenericCloud.qcow2.xz.tgz drwxr-xr-x. 2 root root 6 Mar 6 16:59 source-repositories drwxr-xr-x. 3 root root 20 Mar 6 16:59 yum
I followed up with Yolanda and we removed the cloud-init-datasources sudo disk-image-create centos7 vm dhcp-all-interfaces dracut-regenerate iscsi-boot block-device-efi -o centos7-image-whole-boot-volume 2>&1 | tee out.log The file was indeed produced! -rw-r--r--. 1 root root 579665920 Mar 7 13:30 centos7-image-whole-boot-volume.qcow2
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:0446
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days