1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-22 22:03:39 +03:00

Storage display bug in OCCI

git-svn-id: http://svn.opennebula.org/one/trunk@888 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
Constantino Vázquez Blanco 2009-10-23 13:47:46 +00:00
parent e00b7f3f43
commit c7c2de3773
4 changed files with 20 additions and 21 deletions

View File

@ -17,14 +17,14 @@ case key
%>
DISK = [ type = "swap",
size=<%= img['size']%>,
dev=<%= img['dev']%> ]
target=<%= img['dev']%> ]
<%
end
when "DISK"
image.each do |img|
%>
DISK = [ type = "disk",
dev=<%= img['dev']%>,
target=<%= img['dev']%>,
source=<%= img['source']%>,
image_id=<%= img['image']%> ]
<%
@ -33,7 +33,7 @@ DISK = [ type = "disk",
image.each do |img|
%>
DISK = [ type = "fs",
dev=<%= img['dev']%>,
target=<%= img['dev']%>,
size=<%= img['size']%>,
format=<%= @config[:fs_format]||"ext3"%> ]
<% end %>

View File

@ -17,14 +17,14 @@ case key
%>
DISK = [ type = "swap",
size=<%= img['size']%>,
dev=<%= img['dev']%> ]
target=<%= img['dev']%> ]
<%
end
when "DISK"
image.each do |img|
%>
DISK = [ type = "disk",
dev=<%= img['dev']%>,
target=<%= img['dev']%>,
source=<%= img['source']%>,
image_id=<%= img['image']%> ]
<%
@ -33,7 +33,7 @@ DISK = [ type = "disk",
image.each do |img|
%>
DISK = [ type = "fs",
dev=<%= img['dev']%>,
target=<%= img['dev']%>,
size=<%= img['size']%>,
format=<%= @config[:fs_format]||"ext3"%> ]
<% end %>

View File

@ -9,33 +9,33 @@ OS = [ kernel = /vmlinuz,
kernel_cmd = "ro xencons=tty console=tty1"]
<% if vm_info['STORAGE']
vm_info['STORAGE'].each do |key, image|
image=[image].flatten
vm_info['STORAGE'].each do |key, image|
image=[image].flatten
case key
when "SWAP"
image.each do |img|
%>
DISK = [ type = "swap",
size=<%= img['size']%>,
dev=<%= img['dev']%> ]
size=<%= img['size']%>,
target=<%= img['dev']%> ]
<%
end
when "DISK"
image.each do |img|
%>
DISK = [ type = "disk",
dev=<%= img['dev']%>,
source=<%= img['source']%>,
image_id=<%= img['image']%> ]
target=<%= img['dev']%>,
source=<%= img['source']%>,
image_id=<%= img['image']%> ]
<%
end
when "FS"
image.each do |img|
%>
DISK = [ type = "fs",
dev=<%= img['dev']%>,
size=<%= img['size']%>,
format=<%= @config[:fs_format]||"ext3"%> ]
target=<%= img['dev']%>,
size=<%= img['size']%>,
format=<%= @config[:fs_format]||"ext3"%> ]
<% end %>
<% end %>
<% end %>

View File

@ -13,12 +13,11 @@ class VirtualMachineOCCI < VirtualMachine
template['DISK'].each do |disk|
next if !disk
case disk['TYPE']
when "disk"%>
<DISK type="disk" href="<%= base_url%>/storage/<%= disk['IMAGE_ID']%>" dev="<%= disk['DEV']%>"/><%
when "swap"%>
<DISK type="swap" size="<%= disk['SIZE']%>" dev="<%= disk['DEV']%>"/><%
when "fs"%>
<DISK type="fs" size="<%= disk['SIZE']%>" format="<%= disk['FORMAT']%>" dev="<%= disk['DEV']%>"/><%
<DISK type="swap" size="<%= disk['SIZE']%>" dev="<%= disk['TARGET']%>"/><% when "fs" %>
<DISK type="fs" size="<%= disk['SIZE']%>" format="<%= disk['FORMAT']%>" dev="<%= disk['TARGET']%>"/><%
else %>
<DISK type="disk" href="<%= base_url%>/storage/<%= disk['IMAGE_ID']%>" dev="<%= disk['TARGET']%>"/><%
end
end %>
</STORAGE>