[one-users] REQUIREMENTS attribute in VM definition file howto

Vladimir Kozhukalov kozhukalov at gmail.com
Mon May 24 00:39:32 PDT 2010


Thanks.
Yes, it works. The REQUIREMENTS statement must be one unbroken string. But
while opennebula kernel successfully parses such a string, the opennebula
user scripts, onevm for example have some problems when gets command "onevm
show VMID". The error is "illegal charecter &". It is because you must use
nokogiri ruby XML library. I am using debian lenny and this distribution
does not have nokogiri native package and even backports.org does not
provide this package. So I had to backport libnokogiri-ruby1.8 from debian
sid. And it works fine. May be my expirience will be usefull for someone
else.



2010/5/20 Carlos Martín Sánchez <cmartins at fdi.ucm.es>

> Hi Vladimir,
>
> I think your problem is that you have to define your requirement as one
> string.
> Try
> REQUIREMENTS = "HOSTNAME = \"virtual1\" & HYPERVISOR != \"kvm\""
> instead of
>
> REQUIREMENTS = "HOSTNAME = \"virtual1\"" & "HYPERVISOR != \"kvm\""
>
> Regards,
> Carlos
>
> Carlos Martín, Cloud Technology Engineer/Researcher
> DSA Research Group: web http://dsa-research.org and blog
> http://blog.dsa-research.org
> OpenNebula Open Source Toolkit for Cloud Computing:
> http://www.OpenNebula.org
>
>
> 2010/5/20 Vladimir Kozhukalov <kozhukalov at gmail.com>
>
>> I have a problem with defining REQUIREMENTS attribute. Ihave one KVM node
>> and a VM template. I try to define in the template
>>
>> REQUIREMENTS = "HOSTNAME = \"virtual1\"" & "HYPERVISOR = \"kvm\""
>>
>> onevm create myvm.template works fine and my VM is correctly deployed and
>> startted on my node, but when I define my REQUIREMENTS attribute in the
>> following manner
>>
>> REQUIREMENTS = "HOSTNAME = \"virtual1\"" & "HYPERVISOR != \"kvm\""
>>
>> I am waiting that my KVM node is not matching this definition (HYPERVISOR
>> != \"kvm\"), and absolutly surprising for me  that VM  was again
>> successfully deployed and started on my KVM node. When I try to know how my
>> REQUIREMENTS definition had been parsed  I see the following
>>
>> oneadmin at cloud1:/srv/cloud/images$ onevm show 48
>> VIRTUAL MACHINE 48
>> INFORMATION
>> ID             : 48
>> NAME           : service4
>> STATE          : ACTIVE
>> LCM_STATE      : RUNNING
>> START TIME     : 05/20 17:48:15
>> END TIME       : -
>> DEPLOY ID:     : one-48
>>
>> VIRTUAL MACHINE
>> TEMPLATE
>> CONTEXT=[
>>   FILES=/srv/cloud/images/machines/test_ssh/init.sh,
>>   GATEWAY=a.b.c.d,
>>   HOSTNAME=service4,
>>   IP=a.b.c.d,
>>   NETMASK=255.255.255.0,
>>   TARGET=hdc ]
>> CPU=0.5
>> DISK=[
>>   BUS=ide,
>>   READONLY=no,
>>   SOURCE=/srv/cloud/images/disks/debian-amd64.qcow2,
>>   TARGET=hda,
>>   TYPE=block ]
>> FEATURES=[
>>   ACPI=no,
>>   PAE=no ]
>> GRAPHICS=[
>>   LISTEN=127.0.0.1,
>>   PORT=5903,
>>   TYPE=vnc ]
>> HYPERVISOR="kvm""
>> MEMORY=512
>> NAME=service4
>> NIC=[
>>   BRIDGE=br288,
>>   IP=a.b.c.d,
>>   MAC=00:03:00:00:00:00,
>>   MODEL=rtl8139,
>>   NETWORK=vlan288,
>>   VNID=2 ]
>> OS=[
>>   BOOT=hd ]
>> REQUIREMENTS=HOSTNAME = "virtual1"
>> VMID=48
>> oneadmin at cloud1:/srv/cloud/images$
>>
>>
>>
>>
>>
>>  oneadmin at cloud1:/srv/cloud/images/$ onehost show 0
>> HOST 0
>> INFORMATION
>> ID                    : 0
>> NAME                  : virtual1
>> STATE                 : MONITORED
>> IM_MAD                : im_kvm
>> VM_MAD                : vmm_kvm
>> TM_MAD                : tm_nfs
>>
>> HOST
>> SHARES
>> MAX MEM               : 8196940
>> USED MEM (REAL)       : 7950416
>> USED MEM (ALLOCATED)  : 2097152
>> MAX CPU               : 400
>> USED CPU (REAL)       : 14
>> USED CPU (ALLOCATED)  : 200
>> RUNNING VMS           : 4
>>
>> MONITORING
>> INFORMATION
>> ARCH=x86_64
>> CPUSPEED=2593
>> FREECPU=386.0
>> FREEMEMORY=7317328
>> HOSTNAME=virtual1
>> HYPERVISOR=kvm
>> MODELNAME=Dual-Core AMD Opteron(tm) Processor 2218
>> NETRX=0
>> NETTX=0
>> TOTALCPU=400
>> TOTALMEMORY=8196940
>> USEDCPU=14.0
>> USEDMEMORY=7950416
>> oneadmin at cloud1:/srv/cloud/images/$
>>
>>
>>
>> --
>> Best regards,
>> Kozhukalov Vladimir
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opennebula.org
>> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>>
>>
>


-- 
Best regards,
Kozhukalov Vladimir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20100524/cfa786b2/attachment-0003.htm>


More information about the Users mailing list