Bug 1654615

Summary: disk-image-create fails while creating an image with iscsi-boot with "get_image_element_array: command not found"
Product: Red Hat OpenStack Reporter: Luis Arizmendi <larizmen>
Component: diskimage-builderAssignee: Yolanda Robla <yroblamo>
Status: CLOSED ERRATA QA Contact: mlammon
Severity: high Docs Contact:
Priority: high    
Version: 14.0 (Rocky)CC: bfournie, ccopello, dtantsur, larizmen, mburns, yroblamo
Target Milestone: z1Keywords: Triaged, ZStream
Target Release: 14.0 (Rocky)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: diskimage-builder-2.19.0-1.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-18 13:03:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
complete output with error none

Description Luis Arizmendi 2018-11-29 09:03:23 UTC
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

Comment 1 Bob Fournier 2018-12-11 13:42:37 UTC
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

Comment 2 Luis Arizmendi 2018-12-13 11:30:28 UTC
Created attachment 1514013 [details]
complete output with error

Comment 3 Yolanda Robla 2018-12-19 09:40:18 UTC
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 ?

Comment 4 Luis Arizmendi 2018-12-21 10:12:09 UTC
(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

Comment 5 Yolanda Robla 2019-01-02 08:29:18 UTC
Can you check the version of diskimage-builder that you are using? Going to try locally to see if i can replicate the issue.

Comment 6 Luis Arizmendi 2019-01-02 08:46:11 UTC
(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

Comment 7 Yolanda Robla 2019-01-02 10:08:09 UTC
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

Comment 10 mlammon 2019-03-06 22:45:00 UTC
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

Comment 11 mlammon 2019-03-07 18:49:50 UTC
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

Comment 14 errata-xmlrpc 2019-03-18 13:03:24 UTC
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

Comment 15 Red Hat Bugzilla 2023-09-14 04:43:03 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days