KubeNow icon indicating copy to clipboard operation
KubeNow copied to clipboard

QCOW image format not accepted by certain OpenStack providers

Open stephenmoloney opened this issue 6 years ago • 11 comments

Issue

Some cloud providers do not accept qcow2 image format

Error message:

Unable to set 'disk_format' to 'qcow2'. Reason: u'qcow2' is not one of [None, u'raw']

Failed validating u'enum' in schema[u'properties'][u'disk_format']:
    {u'description': u'Format of the disk',
     u'enum': [None, u'raw'],
     u'type': [u'null', u'string']}

On instance[u'disk_format']:
    u'qcow2'

Potential solution(s)

  • (1) release multiple image formats and make downloadable format configurable

  • (2) let the client download the .qcow2 image format and do any conversions necessary prior to upload to the cloud provider

relates to #356

stephenmoloney avatar Apr 01 '18 23:04 stephenmoloney

Hi @stephenmoloney! Thanks for testing KubeNow, and for opening this issue. I assume we are talking about OpenStack here.

Releasing raw images would be a bit harder IMO. First, it's more expensive, and second it's slower to save on the backend storage. Since we are using the free version of Travis, builds need to be faster or they will be killed. Therefore, I'd be more keen to solution 2.

I know that @andersla and @sneumann had this problem with image format in the past and they have found a workaround with it. Maybe it's time to merge efforts and get the logic officially supported.

mcapuccini avatar Apr 03 '18 12:04 mcapuccini

Hi, I didn't have a proper solution, and manually converted the image following https://docs.openstack.org/image-guide/convert-images.html and manually uploaded to the images available. Yours, Steffen

sneumann avatar Apr 03 '18 13:04 sneumann

@mcapuccini I'm not entirely satisfied that manual intervention is a good thing... As I suppose KubeNow is aiming to be it just works solution. If the client does the conversion, then perhaps it should be supported in some sort of script in the code to do the conversion prior to upload (with a prompt maybe). The conversion takes a long time too though so I'm not sure about this either.

@sneumann Do you know what size that upload was?

stephenmoloney avatar Apr 03 '18 14:04 stephenmoloney

@stephenmoloney agreed, it should be automatic. Pinging @andersla for any thoughts on this.

mcapuccini avatar Apr 03 '18 15:04 mcapuccini

Yes I think it would be possible to quite easily download the qcow2 image into the user temp dir (as is don now already) and there convert it into raw and then continue with then upload.

andersla avatar Apr 03 '18 18:04 andersla

@stephenmoloney if you have slow connection, you could start an instance in OpenStack so you can do the first deployment from the tenancy. In this way download/upload of the image should be way faster. I like the idea of converting the image prior upload.

mcapuccini avatar Apr 04 '18 09:04 mcapuccini

@mcapuccini That's sounds like a good idea, effectively, I take it you mean run kn apply inside a running instance in the opencloud stack. Beats waiting hours/days for an upload.

So in that case, I'll make some changes to do a local conversion where the disc_format raw is specified in the terraform variables file.

It might be a few days before I get a chance. I'll ping back when the PR is looking a bit more ready.

stephenmoloney avatar Apr 04 '18 16:04 stephenmoloney

Sure, no worries! Just let us know when it's ready 🙂

mcapuccini avatar Apr 04 '18 16:04 mcapuccini

Same error. Could you please let me know if you have fixed it? or else, how can i convert file to iso? i cant see it under tmp even after the download.

kunalrdeshmukh avatar Jul 26 '19 05:07 kunalrdeshmukh

I think @andersla has a solution for this. You could also try this: https://docs.openstack.org/image-guide/convert-images.html

mcapuccini avatar Jul 26 '19 07:07 mcapuccini

Thanks. So trick was to add qemu-img convert -f qcow2 -O <desired_file_format> $filename <output file name> command on line 70 of bin/image-create-openstack.sh file.

bin folder is inside my_deployment folder which is created as a result of kn init openstack my_deployment command.

kunalrdeshmukh avatar Jul 26 '19 18:07 kunalrdeshmukh