<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">As far as I know, Horizon is not using import workflow at all.</div><div class="gmail_default" style="font-family:verdana,sans-serif">Horizon needs to support import workflow in order to make UI work the same way as CLI.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br clear="all"></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Thanks & Best Regards,<br></div>Abhishek Kekane<br></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 26, 2020 at 7:35 PM Sean McGinnis <<a href="mailto:sean.mcginnis@gmx.com">sean.mcginnis@gmx.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
On 10/24/20 3:37 PM, Tony Liu wrote:<br>
> Hi,<br>
><br>
> The initial issue I saw was "The Store URI was malformed." from<br>
> Horizon when creating image by URL [1].<br>
><br>
> It works fine with Glance CLI as the following.<br>
> ========<br>
> glance image-create --container-format bare --disk-format qcow2 --name cirros-test<br>
> glance image-import --import-method web-download --uri <a href="https://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img" rel="noreferrer" target="_blank">https://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img</a> cirros-test<br>
> ========<br>
><br>
> When I look into it, I see that UI and CLI work differently, they are<br>
> handled by different workflow in Glance. Why is that?<br>
> Why not UI follows the same workflow as CLI?<br>
No input, but adding the [horizon] tag to the subject line to try to get<br>
the right set of eyes on it.<br>
><br>
> The root cause is that, [1] redirect to [2] and redirect to [3].<br>
> One issue here is that, query is not supported in [4]. pieces.query<br>
> is dropped. When I attached query parameters, I got 403. And that's<br>
> because, the workflow for UI is checking quota policy when adding<br>
> location. It needs to get the size of image by HEAD request.<br>
> But the signature in [3] is for GET request. So that HEAD request<br>
> is forbidden by S3.<br>
><br>
> I don't think we can get an URL with signature for HEAD request in<br>
> such case. So I go for an ugly workaround to skip the size check.<br>
> Any ideas to make it work better?<br>
><br>
> Is quota policy involved in CLI workflow? Again, can we make UI<br>
> work the same way as CLI?<br>
><br>
> [1] <a href="https://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img" rel="noreferrer" target="_blank">https://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img</a><br>
> [2] <a href="https://github.com/cirros-dev/cirros/releases/download/0.5.1/cirros-0.5.1-x86_64-disk.img" rel="noreferrer" target="_blank">https://github.com/cirros-dev/cirros/releases/download/0.5.1/cirros-0.5.1-x86_64-disk.img</a><br>
> [3] <a href="https://github-production-release-asset-2e65be.s3.amazonaws.com/219785102/6ebfbc00-5fb5-11ea-91bd-96a6baa1496d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20201024%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20201024T191926Z&X-Amz-Expires=300&X-Amz-Signature=0f49887e19f40bb969f0b033fba3c8986edc55fccdbea4b6003ef799fc055712&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=219785102&response-content-disposition=attachment%3B%20filename%3Dcirros-0.5.1-x86_64-disk.img&response-content-type=application%2Foctet-stream" rel="noreferrer" target="_blank">https://github-production-release-asset-2e65be.s3.amazonaws.com/219785102/6ebfbc00-5fb5-11ea-91bd-96a6baa1496d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20201024%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20201024T191926Z&X-Amz-Expires=300&X-Amz-Signature=0f49887e19f40bb969f0b033fba3c8986edc55fccdbea4b6003ef799fc055712&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=219785102&response-content-disposition=attachment%3B%20filename%3Dcirros-0.5.1-x86_64-disk.img&response-content-type=application%2Foctet-stream</a><br>
> [4] <a href="https://github.com/openstack/glance_store/blob/488d3e2fe31e4fc7a461e9de8b20df481d78daa2/glance_store/_drivers/http.py#L121" rel="noreferrer" target="_blank">https://github.com/openstack/glance_store/blob/488d3e2fe31e4fc7a461e9de8b20df481d78daa2/glance_store/_drivers/http.py#L121</a><br>
><br>
><br>
> Thanks!<br>
> Tony<br>
><br>
><br>
<br>
</blockquote></div>