Hi Daniel,<br><br>(adding user list in CC)<br><br>Thanks, the first option is working right;<br>the xml output of command line does not reflect the DRIVER attribute, but it is present on the deployment.0 and also on the sunstone portal, and the images are working ok.<br>
<br>[root@one01 ~]# cat /var/lib/one/161/deployment.0 <br><domain type='kvm' xmlns:qemu='<a href="http://libvirt.org/schemas/domain/qemu/1.0">http://libvirt.org/schemas/domain/qemu/1.0</a>'><br>    <name>one-161</name><br>
    <memory>1048576</memory><br>    <os><br>        <type arch='x86_64'>hvm</type><br>        <boot dev='hd'/><br>    </os><br>    <devices><br>        <emulator>/usr/bin/kvm</emulator><br>
        <disk type='file' device='disk'><br>            <source file='/var/lib/one//161/images/disk.0'/><br>            <target dev='hda'/><br>            <driver name='qemu' type='qcow2' cache='default'/><br>
        </disk><br><br>cheers,<br>Víctor<br><br><div class="gmail_quote">2012/8/6 Daniel Molina <span dir="ltr"><<a href="mailto:dmolina@opennebula.org" target="_blank">dmolina@opennebula.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Victor,<br>
<div><div class="h5"><br>
On 5 August 2012 15:04, Victor Mendez <<a href="mailto:vmendez@pic.es">vmendez@pic.es</a>> wrote:<br>
> Hi Daniel,<br>
><br>
> We have a Opennebula 3.2 installed from scratch.<br>
> I am using the OCCI attribute in occi-compute command line client, in a XML<br>
> with:<br>
>     <DRIVER type='qcow2'/><br>
><br>
> when I use the sunstone templates, like:<br>
> ....<br>
> DISK=[<br>
>   BUS=ide,<br>
>   DRIVER=qcow2,<br>
>   FORMAT=ext3,<br>
>   IMAGE_ID=4,<br>
>   TARGET=hda,<br>
>   TYPE=fs ]<br>
> ...<br>
><br>
> to create a new VM from the sunstone portal, It works without problem, with<br>
> a:<br>
> [root@one01 ~]# cat /var/lib/one/97/deployment.0<br>
> <domain type='kvm' xmlns:qemu='<a href="http://libvirt.org/schemas/domain/qemu/1.0" target="_blank">http://libvirt.org/schemas/domain/qemu/1.0</a>'><br>
>     <name>one-97</name><br>
>     <vcpu>1</vcpu><br>
>     <memory>1048576</memory><br>
>     <os><br>
>         <type arch='x86_64'>hvm</type><br>
>         <boot dev='hd'/><br>
>     </os><br>
>     <devices><br>
>         <emulator>/usr/bin/kvm</emulator><br>
>         <disk type='file' device='disk'><br>
>             <source file='/var/lib/one//97/images/disk.0'/><br>
>             <target dev='hda' bus='ide'/><br>
>             <driver name='qemu' type='qcow2' cache='default'/><br>
>         </disk><br>
> .....<br>
><br>
> but wen I do a occi-compute create with the xml <DRIVER type='qcow2'/><br>
> attribute, I get:<br>
> [root@one01 ~]# cat /var/lib/one/156/deployment.0<br>
> <domain type='kvm' xmlns:qemu='<a href="http://libvirt.org/schemas/domain/qemu/1.0" target="_blank">http://libvirt.org/schemas/domain/qemu/1.0</a>'><br>
>     <name>one-156</name><br>
>     <memory>1048576</memory><br>
>     <os><br>
>         <type arch='x86_64'>hvm</type><br>
>         <boot dev='hd'/><br>
>     </os><br>
>     <devices><br>
>         <emulator>/usr/bin/kvm</emulator><br>
>         <disk type='file' device='disk'><br>
>             <source file='/var/lib/one//156/images/disk.0'/><br>
>             <target dev='hda'/><br>
>             <driver name='qemu' type='raw' cache='default'/><br>
>         </disk><br>
> ...<br>
><br>
> instead of the expected type='qcow2', failing to boot the image "raw" wich<br>
> actually is a "qcow2"<br>
><br>
> Is this a bug or something to be configured in the .erb?<br>
> using a [root@one01 ~]# cat /etc/one/occi_templates/small-vmdirac.erb<br>
> .....<br>
> DISK=[<br>
>   BUS=ide,<br>
>   DRIVER=qcow2,<br>
>   FORMAT=ext3,<br>
>   IMAGE_ID=4,<br>
>   TARGET=hda,<br>
>   TYPE=fs ]<br>
><br>
> as instance type in the xml occi-compute create, it is working ok, but this<br>
> is breaking our dynamic configuration with the occi command line and<br>
> appropiate IMAGE_ID, etc depending on changing conditions.<br>
><br>
> What can we do to have the qcow2 functionality in occi command line, please?<br>
<br>
</div></div>In order to achieve this, you can:<br>
<br>
a) Modify the common.erb file to include the driver attribute from the<br>
user xml, since this is not supported in the current implementation.<br>
<br>
diff --git a/src/cloud/occi/etc/templates/common.erb<br>
b/src/cloud/occi/etc/templates/comm<br>
index 4dd2fba..2f58bd8 100644<br>
--- a/src/cloud/occi/etc/templates/common.erb<br>
+++ b/src/cloud/occi/etc/templates/common.erb<br>
@@ -11,6 +11,9 @@<br>
 <% @vm_info.each('DISK') do |disk| %><br>
     <% if disk.attr('STORAGE','href') %><br>
       DISK = [ IMAGE_ID = <%= disk.attr('STORAGE','href').split('/').last %><br>
+          <% if disk['DRIVER'] %><br>
+              ,DRIVER = <%= disk['DRIVER'] %><br>
+          <% end %><br>
            ]<br>
     <% end %><br>
 <% end %><br>
<br>
The user will specify the DRIVER in the DISK xml as follows:<br>
<br>
    <COMPUTE><br>
        ...<br>
        <DISK><br>
            <STORAGE href="<a href="http://www.opennebula.org/storage/0" target="_blank">http://www.opennebula.org/storage/0</a>"/><br>
            <DRIVER>qcow2</DRIVER><br>
        </DISK><br>
<br>
<br>
b) Instead of specifying the driver in the disk, you can specify it in<br>
the image, and the VM will use the image value if none is defined in<br>
the disk section. Therefore the driver depends on the image template<br>
and not on the VM.<br>
<br>
<a href="http://opennebula.org/documentation:rel3.6:img_template#template_attributes" target="_blank">http://opennebula.org/documentation:rel3.6:img_template#template_attributes</a><br>
<br>
Hope this helps.<br>
<br>
<br>
BTW for this kind of questions please use the mailing list<br>
(<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a>), so<br>
other users can benefit from it. Would you mind to forward it to the<br>
list if it works?<br>
<br>
Cheers<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Daniel Molina<br>
Project Engineer<br>
OpenNebula - The Open Source Solution for Data Center Virtualization<br>
<a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:dmolina@opennebula.org">dmolina@opennebula.org</a> | @OpenNebula<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><span style="color:rgb(153,153,153)">Víctor Méndez Muñoz<br>LHCb Tier1 Contact<br><font size="1">Port d'Informació Científica (PIC)      </font></span><font size="1"><br style="color:rgb(153,153,153)">
<span style="color:rgb(153,153,153)">Tel: +34935813772   Web: </span><a style="color:rgb(153,153,153)" href="http://www.pic.es/" target="_blank">http://www.pic.es</a><br><br><font color="#999999">PIC is maintained through a collaboration agreement between CIEMAT (Ministerio de Ciencia e Innovación), <br>
ECO (Generalitat de Catalunya), Universitat Autònoma de Barcelona and IFAE</font></font><br style="color:rgb(153,153,153)"><font size="1"><span style="color:rgb(153,153,153)"></span><span style="color:rgb(153,153,153)">___________________________________</span></font>
<font size="1"><br style="color:rgb(153,153,153)"></font><div style="color:rgb(153,153,153)"><font size="1">
IFAE provides the e-mail service used by PIC and requires this notice:<br>Avis - Aviso - Legal Notice:  <a href="http://www.ifae.es/legal.html" target="_blank">http://www.ifae.es/legal.html</a></font></div><br><br>