Uploading .iso image with REST API creates <id>.meta with wrong DISKTYPE value

When creating file (.iso image) with the web GUI the .meta file has DISKTYPE=ISOF, but when using REST, DISKTYPE=DATA and the file is not listed on the "Attach CD" drop down when creating a new vm. Using API is the only way for me cos I can't find a fix to a connection problem from Firefox/Fedora 39 to the web GUI, so all transfers end up as "suspended by the system". I am using the following POST to crate the file: curl -k -u "admin@internal:secretpw" -X POST \ -H "Content-Type: application/xml" \ -d '<disk><name>Rocky-9-latest-x86_64-boot.iso</name><alias>Rocky-9-latest-x86_64-boot.iso</alias>\ <description>Rocky-9-latest-x86_64-boot.iso</description>\ <provisioned_size>1068498944</provisioned_size><format>raw</format>\ <storage_domains><storage_domain><name>isos</name>\ </storage_domain></storage_domains></disk>' \ https://ovirtsvc.adm.cnt.uksw.edu.pl/ovirt-engine/api/disks The resulting <id>.meta is: CAP=1068498944 CTIME=1732282300 DESCRIPTION={"DiskAlias":"Rocky-9-latest-x86_64-boot.iso","DiskDescription":"Rocky-9-latest-x86_64-boot.iso"} DISKTYPE=DATA [...] FORMAT=RAW [...]TYPE=SPARSE VOLTYPE=LEAF EOF

I don't see where you set <content_type>“iso”</content_type>

I'll also include some comments I provided a fellow employee on the topic (Note in my case I am using PowerShell and JSON so the formatting is going to be a bit different, but you'll get the idea) This is a description of how I handle the uploads (I used a little code samples, hopefully the variable names make sense): Create $ImageTransferSession Wait til $ImageTransferSession.phase -eq "transferring" Create a filestream to read the source file in chunks I used $DefaultBlockSize = 64MB Loop through each chunk of the source file until done In Powershell (like curl) I sent each chunk individually $Headers = @{"Accept" = "application/json";"ContentType" = "application/octet-stream";"Content-Range" = "bytes $($numBytesRead - $ReadBlock)-$($numBytesRead)/*";"Authorization" = "Bearer $($access_token)"; "All-Content"="true";"Content-Length" = "$($ReadBlock)"} $Body = [System.IO.MemoryStream]::new($Buffer, 0, $ReadBlock) Invoke-RestMethod -Uri "$($ImageTransferSession.proxy_url)?flush=y" -Headers $Headers -Body $Body -Method PUT -ContentType "application/octet-stream" -EV WebError After each I checked the Image Transfer Status When all the chunks are sent close the file stream and check the image transfer status SIZE to match the source file size Finalize the Image Transfer Status if sizes match, cancel if not ALSO NOTE: I used "proxy_url" NOT "transfer_url", so the traffic passes THROUGH OLVM, instead of trying to connect directly to the KVM hosts, which requires additional authentication handling The web response error also gets written into the /var/log/ovirt-engine/engine.log
participants (2)
-
itsavant@gmail.com
-
markul11@protonmail.com