kiranchavala opened a new issue, #9842: URL: https://github.com/apache/cloudstack/issues/9842
ISSUE TYPE BUG/Improvement request COMPONENT NAME Component: Improvement, Bug CLOUDSTACK VERSION Cloudstack version 4.19.1 SUMMARY Cloudstack Doesn't check if the ISO is Bootable or not Steps to reproduce the issue 1. Create a normal iso using mkisofs command ``` root@server~# mkdir -p test-normal/data root@server~# cd test-normal/data root@server~# echo "testdata" >> sample.txt root@server~# cd .. root@server~# mkisofs -o test-normal.iso test-normal/data root@server~# file test-normal.iso test-normal.iso: ISO 9660 CD-ROM filesystem data 'CDROM' root@server# isoinfo -d -i test-normal.iso CD-ROM is in ISO 9660 format System id: LINUX Volume id: CDROM Volume set id: Publisher id: Data preparer id: Application id: GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE (C) 1997-2006 J.PEARSON/J.SCHILLING (C) 2006-2007 CDRKIT TEAM Copyright File id: Abstract File id: Bibliographic File id: Volume set size is: 1 Volume set sequence number is: 1 Logical block size is: 2048 Volume size is: 175 NO Joliet present NO Rock Ridge present ``` 2. Register the iso in Cloudstack and select the bootable option  3. Cloudstack registers the ISO successfully, even if the provided iso is not bootable Logs ``` 2024-10-23 08:39:46,359 DEBUG [storage.resource.NfsSecondaryStorageResource] (agentRequest-Handler-9:null) Executing command [mount ]. 2024-10-23 08:39:46,363 DEBUG [storage.resource.NfsSecondaryStorageResource] (agentRequest-Handler-9:null) Successfully executed process [26048] for command [mount ]. 2024-10-23 08:39:46,363 DEBUG [storage.resource.NfsSecondaryStorageResource] (agentRequest-Handler-9:null) Some device already mounted at /mnt/SecStorage/6a754ba7-5d09-3f5e-b9e8-1f828d742e9c, no need to mount NFS://10.0.32.4/acs/secondary/ref-trl-7501-k-Mu24-jithin-raju/ref-trl-7501-k-Mu24-jithin-raju-sec1 2024-10-23 08:39:46,409 INFO [storage.template.HttpTemplateDownloader] (agentRequest-Handler-9:null) No credentials configured for host=10.0.35.225:9000 2024-10-23 08:39:46,427 INFO [storage.template.HttpTemplateDownloader] (pool-1-thread-9:null) Starting download from http://10.0.35.225:9000/test-normal.iso to /mnt/SecStorage/6a754ba7-5d09-3f5e-b9e8-1f828d742e9c/template/tmpl/2/216/dnld17747170857641032116tmp_ remoteSize=(350.00 KB) 358400 , max size=(50.00 GB) 53687091200 2024-10-23 08:39:46,437 DEBUG [utils.script.Script] (pool-1-thread-9:null) Executing command [/bin/bash -c file /mnt/SecStorage/6a754ba7-5d09-3f5e-b9e8-1f828d742e9c/template/tmpl/2/216/dnld17747170857641032116tmp_ | cut -d: -f2 ]. 2024-10-23 08:39:46,484 DEBUG [utils.script.Script] (pool-1-thread-9:null) Successfully executed process [26050] for command [/bin/bash -c file /mnt/SecStorage/6a754ba7-5d09-3f5e-b9e8-1f828d742e9c/template/tmpl/2/216/dnld17747170857641032116tmp_ | cut -d: -f2 ]. 2024-10-23 08:39:46,486 DEBUG [utils.imagestore.ImageStoreUtil] (pool-1-thread-9:null) File at path /mnt/SecStorage/6a754ba7-5d09-3f5e-b9e8-1f828d742e9c/template/tmpl/2/216/dnld17747170857641032116tmp_ looks like an iso : ISO 9660 CD-ROM filesystem data 'CDROM' 2024-10-23 08:39:46,487 DEBUG [storage.template.HttpTemplateDownloader] (pool-1-thread-9:null) Verified format of downloading file /mnt/SecStorage/6a754ba7-5d09-3f5e-b9e8-1f828d742e9c/template/tmpl/2/216/dnld17747170857641032116tmp_ is supported 2024-10-23 08:39:46,488 INFO [storage.template.DownloadManagerImpl] (pool-1-thread-9:null) Download Completion for jobId: 9fcd94db-67f7-4311-aed2-4f765c5d582b, status=DOWNLOAD_FINISHED 2024-10-23 08:39:46,489 INFO [storage.template.DownloadManagerImpl] (pool-1-thread-9:null) local: /mnt/SecStorage/6a754ba7-5d09-3f5e-b9e8-1f828d742e9c/template/tmpl/2/216/dnld17747170857641032116tmp_, bytes=(350.00 KB) 358400, error=Downloaded (350.00 KB) 358400 bytes (download complete remote=(350.00 KB) 358400 bytes), pct=100 ``` ---- If we compare with an actual bootable ISO for example, there is no difference For example register a bootable iso like TinyCore/ubuntu22 http://tinycorelinux.net/15.x/x86/release/Core-current.iso ``` root@server~# file TinyCore-8.0.iso TinyCore-8.0.iso: ISO 9660 CD-ROM filesystem data (DOS/MBR boot sector) 'TinyCore' (bootable) root@ref-trl-7501-k-Mu24-jithin-raju-kvm1:~# isoinfo -d -i TinyCore-8.0.iso CD-ROM is in ISO 9660 format System id: LINUX Volume id: TinyCore Volume set id: Publisher id: Data preparer id: Application id: MKISOFS ISO9660/HFS/UDF FILESYSTEM BUILDER & CDRECORD CD/DVD/BluRay CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING Copyright File id: Abstract File id: Bibliographic File id: Volume set size is: 1 Volume set sequence number is: 1 Logical block size is: 2048 Volume size is: 8133 El Torito VD version 1 found, boot catalog is in sector 44 Joliet with UCS level 3 found Rock Ridge signatures version 1 found Eltorito validation header: Hid 1 Arch 0 (x86) ID '' Key 55 AA Eltorito defaultboot header: Bootid 88 (bootable) Boot media 0 (No Emulation Boot) Load segment 0 Sys type 0 Nsect 4 Bootoff 2D 45 ``` ``` root@ref-trl-7501-k-Mu24-jithin-raju-kvm1:~# isoinfo -d -i ubuntu-22.04.3-live-server-amd64.iso CD-ROM is in ISO 9660 format System id: Volume id: Ubuntu-Server 22.04.3 LTS amd64 Volume set id: Publisher id: Data preparer id: XORRISO-1.5.4 2021.01.30.150001, LIBISOBURN-1.5.4, LIBISOFS-1.5.4, LIBBURN-1.5.4 Application id: Copyright File id: Abstract File id: Bibliographic File id: Volume set size is: 1 Volume set sequence number is: 1 Logical block size is: 2048 Volume size is: 1041695 El Torito VD version 1 found, boot catalog is in sector 606 Joliet with UCS level 3 found Rock Ridge signatures version 1 found Eltorito validation header: Hid 1 Arch 0 (x86) ID '' Key 55 AA Eltorito defaultboot header: Bootid 88 (bootable) Boot media 0 (No Emulation Boot) Load segment 0 Sys type 0 Nsect 4 Bootoff 25F 607 ``` ``` 2024-10-22 11:02:18,366 INFO [storage.template.HttpTemplateDownloader] (pool-1-thread-5:null) Starting download from http://10.0.3.122/iso/TinyCore-8.0.iso to /mnt/SecStorage/6a754ba7-5d09-3f5e-b9e8-1f828d742e9c/template/tmpl/2/208/dnld11866851479231868961tmp_ remoteSize=(16.00 MB) 16777216 , max size=(50.00 GB) 53687091200 2024-10-22 11:02:18,384 DEBUG [utils.script.Script] (pool-1-thread-5:null) Executing command [/bin/bash -c file /mnt/SecStorage/6a754ba7-5d09-3f5e-b9e8-1f828d742e9c/template/tmpl/2/208/dnld11866851479231868961tmp_ | cut -d: -f2 ]. 2024-10-22 11:02:18,431 DEBUG [utils.script.Script] (pool-1-thread-5:null) Successfully executed process [21742] for command [/bin/bash -c file /mnt/SecStorage/6a754ba7-5d09-3f5e-b9e8-1f828d742e9c/template/tmpl/2/208/dnld11866851479231868961tmp_ | cut -d: -f2 ]. 2024-10-22 11:02:18,432 DEBUG [utils.imagestore.ImageStoreUtil] (pool-1-thread-5:null) File at path /mnt/SecStorage/6a754ba7-5d09-3f5e-b9e8-1f828d742e9c/template/tmpl/2/208/dnld11866851479231868961tmp_ looks like an iso : ISO 9660 CD-ROM filesystem data (DOS/MBR boot sector) 'TinyCore' (bootable) ``` Expected Behaviour Cloudstack should fail the iso registration if the bootable option is selected and the provided iso doesn't contain a bootable record. Cloudstack should check for Boot record using the output of the following commands ``` file ubuntu-22.04.3-live-server-amd64.iso isoinfo -d -i ubuntu-22.04.3-live-server-amd64.iso ``` Actual Behaviour Cloudstack registers the iso successfully -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
