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

Carlos Martín Sánchez cmartins at fdi.ucm.es
Thu May 20 07:31:23 PDT 2010


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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20100520/465e2586/attachment-0002.htm>


More information about the Users mailing list