Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Closed

Category names contain spaces for images #32

bhagemeier opened this issue Feb 28, 2013 · 15 comments

Comments

@bhagemeier
Copy link
Contributor

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

@dizz
Copy link
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?

@tmetsch
Copy link
Owner

tmetsch commented Feb 28, 2013

@alvarolopez
Copy link
Collaborator

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.

@dizz
Copy link
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.

@bhagemeier
Copy link
Contributor Author

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


@alvarolopez
Copy link
Collaborator

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.

@dizz
Copy link
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
Copy link

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.

@dizz
Copy link
Collaborator

dizz commented Mar 6, 2013

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

@arax
Copy link

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 | "-" | "_" )

@dizz
Copy link
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
Copy link

arax commented Mar 6, 2013

Thank you very much 👍

@dizz
Copy link
Collaborator

dizz commented Mar 6, 2013

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

@arax
Copy link

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 :-)

@dizz
Copy link
Collaborator

dizz commented Mar 7, 2013

Your on! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants