Closed bhagemeier closed 11 years ago
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?
Seems like the fix should go here: https://github.com/tmetsch/occi-os/blob/stable/folsom/occi_os_api/wsgi.py#L175
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.
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.
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 https://github.com/tmetsch/occi-os/issues/32#issuecomment-14380868.
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,
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.
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! :-)
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.
infrasructure#os_tpl
is a VM template where os
== operating system and tpl
== template
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 | "-" | "_" )
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'
>>>
Thank you very much :+1:
I'm always happy to take payment in beer :-D
If we get a chance to meet in person at some event in the near future, I will be happy to settle this debt :-)
Your on! :-)
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