kimchi-project / kimchi

An HTML5 management interface for KVM guests
https://github.com/kimchi-project/kimchi/releases/latest
Other
3.1k stars 364 forks source link

Error when editing a template created using a disk image (raw or qcow2) #931

Closed Styx13 closed 8 years ago

Styx13 commented 8 years ago

Hello

Currently using Kimchi cc81ef3c41392501bc027731a7da3fe676f96d2c and I noticed an error when trying to edit a template that has been created using a disk image.

Steps to reproduce the error: 1) create a template using a disk image (pick Local Image File and give the full path to a raw image) 2) once the template is created, selection action > edit 3) on the edit panel, do any required change (add memory for example) and click save The following error will appear:

KCHTMPL0016E: Specify a path to source media (ISO, disk or remote ISO) to create a template

I believe it is related to this part of the code: https://github.com/kimchi-project/kimchi/blob/master/vmtemplate.py#L138-L150

        base_imgs = []
        for d in args.get('disks', []):
            if 'base' in d.keys():
                base_imgs.append(d)
                if scan:
                    distro, version = imageinfo.probe_image(d['base'])

                if 'size' not in d.keys():
                    d_info = imageinfo.probe_img_info(d['base'])
                    d['size'] = d_info['virtual-size']

        if len(base_imgs) == 0:
            raise MissingParameter("KCHTMPL0016E")
pvital commented 8 years ago

Hello @Styx13

Yeap, I could reproduce your issue and the reason of the error message is exactly the one you pointed. However, the issue happens because the backend code is not synchronized with fronted UI.

The commits between 8a465f9 and 7d89153 have changed the backend to identify the installation media while creating/editing a template (exactly this part of code you pointed), but the frontend still doesn't reflect this change.

I'm gonna take a look better and see what we can do until fronted is not updated.

ramonmedeiros commented 8 years ago

Patch sent to ML: http://lists.ovirt.org/pipermail/kimchi-devel/2016-April/014592.html