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