Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Category names contain spaces for images #32

Closed
bhagemeier opened this Issue Feb 28, 2013 · 15 comments

Comments

Projects
None yet
5 participants
Contributor

bhagemeier commented Feb 28, 2013

Hi there,

when querying resources on a system, the image categories can contain spaces in them. For example:

Category: OpenSuSE 12.1 Minimal; scheme="http://schemas.openstack.org/template/os#"; class="mixin"; title="This is an OS OpenSuSE 12.1 Minimal VM image"; rel="http://schemas.ogf.org/occi/infrastructure#os_tpl"; location="https://myhost.mydomain:1234/OpenSuSE 12.1 Minimal/"

Should encoding be used to avoid these spaces? They don't seem to comply with the specification.

Best regards,
Björn

Collaborator

dizz commented Feb 28, 2013

Quickly thinking, it'd make sense to replace spaces with an underscore for the term & location values. For other values (title) the space can remain. Certainly needs a change as it is. Other thoughts/opinions?

Collaborator

alvarolopez commented Mar 4, 2013

Shouldn't the Category be the uuid of the image? One can have several images with the very same name (i.e. "OpenSuSE 12.1 Minimal"), but with different ids.

Collaborator

dizz commented Mar 4, 2013

No - the mixin only points to a image that can be instantiated. An image should be a unique template (collection of software). The UUID would be better associated with the VM as it is in the OCCI-OS implementation, where there are multiple VM instances of the same image.

Contributor

bhagemeier commented Mar 4, 2013

Hi,

from my point of view, images as well as VMs can have UUIDs. And like
Álvaro says, I can easily imaging (just done it a minute ago) multiple
distinct images with the same name (bad idea, I know).

Cheers,
Björn

On 04.03.2013 14:36, Andy Edmonds wrote :

No - the mixin only points to a image that can be instantiated. An image
should be a unique template (collection of software). The UUID would be
better associated with the VM as it is in the OCCI-OS implementation,
where there are multiple VM instances of the same image.


Reply to this email directly or view it on GitHub
#32 (comment).

Dipl.-Inform. Björn Hagemeier
Federated Systems and Data
Juelich Supercomputing Centre
Institute for Advanced Simulation

Phone: +49 2461 61 1584
Fax : +49 2461 61 6656
Email: b.hagemeier@fz-juelich.de
Skype: bhagemeier
WWW : http://www.fz-juelich.de/jsc

JSC is the coordinator of the
John von Neumann Institute for Computing
and member of the
Gauss Centre for Supercomputing



Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,

Prof. Dr. Sebastian M. Schmidt


Collaborator

alvarolopez commented Mar 4, 2013

Images do have UUIDs (the glance's id column). Consider the following real example from our glance installation:

+--------------------------------------+----------------------------------------------+--------+--------------------------------------+
| ID                                   | Name                                         | Status | Server                               |
+--------------------------------------+----------------------------------------------+--------+--------------------------------------+
| 486c139e-f34d-465c-959c-1b9c8bf60cfd | Ubuntu Server 10.04 JeOS                     | ACTIVE |                                      |
| 694f2673-7ea3-4690-a25e-c9dd4297519a | Ubuntu Server 10.04 JeOS                     | ACTIVE |                                      |
+--------------------------------------+----------------------------------------------+--------+--------------------------------------+

These are two different images with the same name. Even though I think that it is not correct to have different images with the same global name, this could happen (as in the example) when users upload their own images, that's why the
only unique key is the image's uuid.

Collaborator

dizz commented Mar 4, 2013

Fair point. I guess my initial reaction was one based on the fear of people confabulating occi.core.id and Category's term value. So long as they're not seen as the same then it's all gravy! :-)

arax commented Mar 6, 2013

I'm not familiar with OS, please excuse any misconceptions, I will call a physical file containing filesystem(s) an image and a collection of resources (this collection can be instantiated) a VM template.

Does infrastructure#os_tpl in OCCI-OS represent a VM template or a disk image? If it represents a VM template then the point made by @alvarolopez relates more to infrastructure#storage although I'm sure that VM templates in OS follow similar naming conventions.

I think that removing spaces from Category terms is a good place to start.

Collaborator

dizz commented Mar 6, 2013

infrasructure#os_tpl is a VM template where os == operating system and tpl == template

arax commented Mar 6, 2013

Ok, I thought as much, I just needed to be sure.

As the discussion goes on we are starting to mix storage with os_tpl and the initial point of this issue is getting lost. So here is my attempt to get things back on track:

"Category names contain spaces for images" should really be "Category terms contain spaces for os_tpl(s)" and it is about invalid terms in HTTP rendering breaking OCCI-OS' compatibility with rOCCI client.

GFD.185 – OCCI HTTP Rendering (v1.1) says the following:
term = LOALPHA *( LOALPHA | DIGIT | "-" | "_" )

Collaborator

dizz commented Mar 6, 2013

Ok a 2 min fix. I've it now in the right place (wsgi.py).

>>> name = "my name should not have spaces "
>>> name
'my name should not have spaces '
>>> name.strip().replace(' ', '_')
'my_name_should_not_have_spaces'
>>>

arax commented Mar 6, 2013

Thank you very much 👍

Collaborator

dizz commented Mar 6, 2013

I'm always happy to take payment in beer :-D

arax commented Mar 6, 2013

If we get a chance to meet in person at some event in the near future, I will be happy to settle this debt :-)

Collaborator

dizz commented Mar 7, 2013

Your on! :-)

@dizz dizz closed this Mar 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment