[one-users] Java OCA code dependency

Shashank Rachamalla shashank.rachamalla at hexagrid.com
Fri Apr 30 02:47:52 PDT 2010


Hi Carlos,

Thanks for the inputs. I don't think there will any problems with the
current behavior. Is there any way I can get the Host Name for the Host on
which a Virtual Machine is currently running ( given the Virtual Machine ID
) ?

The following is the XML output returned by vm.info().getMessage() for a
particular VM whose ID is 23. I don't see Host information listed anywhere
except in the HISTORY section.

If the VM is running, can the value of vm.xpath("/VM/HISTORY/HOSTNAME") be
considered as the Host Name of Host the VM is currently running on ?

<VM>
    <ID>23</ID>
    <UID>0</UID>
    <NAME>ReactOS</NAME>
    <LAST_POLL>0</LAST_POLL>
    <STATE>3</STATE>
    <LCM_STATE>3</LCM_STATE>
    <STIME>1272620457</STIME>
    <ETIME>0</ETIME>
    <DEPLOY_ID>one-23</DEPLOY_ID>
    <MEMORY>0</MEMORY>
    <CPU>0</CPU>
    <NET_TX>0</NET_TX>
    <NET_RX>0</NET_RX>
    <TEMPLATE>
        <CPU>1</CPU>
        <DISK>
            <CLONE>no</CLONE>
            <SOURCE>/mnt/onenfs/ReactOS-LiveCD.iso</SOURCE>
            <TARGET>hdb</TARGET>
            <TYPE>cdrom</TYPE>
        </DISK>
        <GRAPHICS>
            <LISTEN>127.0.0.1</LISTEN>
            <PORT>5</PORT>
            <TYPE>vnc</TYPE>
        </GRAPHICS>
        <MEMORY>100</MEMORY>
        <NAME>ReactOS</NAME>
        <OS>
            <BOOT>cdrom</BOOT>
        </OS>
        <VMID>23</VMID>
    </TEMPLATE>
    <HISTORY>
        <SEQ>0</SEQ>
        <HOSTNAME>localhost</HOSTNAME>
        <HID>4</HID>
        <STIME>1272620486</STIME>
        <ETIME>0</ETIME>
        <PSTIME>1272620486</PSTIME>
        <PETIME>1272620486</PETIME>
        <RSTIME>1272620486</RSTIME>
        <RETIME>0</RETIME>
        <ESTIME>0</ESTIME>
        <EETIME>0</EETIME>
        <REASON>0</REASON>
    </HISTORY>
</VM>



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

> Hi Shashank,  I'm copying your email to the list (I guess you meant to send
> it here):
>
>
> Hi
>>
>> Thanks for guiding me through the examples. I will go through them to gain
>> a better understanding. Consider the following code where I am able to fetch
>> information w.r.t Virtual Machines providing invalid user name and password.
>>
>>             Client oneClient = new Client("someuser:password","
>> http://localhost:2633/RPC2");
>>             int vmID = 2;
>>
>>             VirtualMachine vm  = new VirtualMachine(vmID,oneClient);
>>
>>             vm.info();
>>             System.out.println(vm.getName());
>>             System.out.println(vm.stateStr());
>>
>> The output of the above code is:
>> ReactOS
>> DONE
>>
>> Please note that there is only one valid user with name shashank as shown
>> below.
>>
>> Also, I have noticed that operations which tend to change the state of
>> cloud entity objects are not allowed with these invalid credentials. Only
>> operations which involve fetching state information are allowed. Is this a
>> desired behavior ?
>>
>> root at shashank:/# oneuser list
>>   ID USER            PASSWORD
>> ENABLE
>>    0 shashank        8b832b62abf2bd5180f6a225e4b99cac1392ea10
>> True
>> root at shashank:/# onehost list
>>   ID NAME                      RVM   TCPU   FCPU   ACPU    TMEM    FMEM
>> STAT
>>    4 localhost                   1    200     78     78 1801900 1256364
>> on
>> root at shashank:/# onevm list
>>   ID     USER     NAME STAT CPU     MEM        HOSTNAME        TIME
>>    3 shashank  ReactOS runn   0  524288       localhost 00 00:07:59
>> root at shashank:/#
>>
>>
>
> Yes, right now this is how OpenNebula works. The xml-rpc server side, in
> the ONE core, allows information request for some pools without checking who
> is asking.
> If you need to change this behaviour for some reason, let us know and we'll
> help you to narrow down the c++ methods you have to modify.
>
> 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
>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
>


-- 
Regards,
Shashank Rachamalla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20100430/35b21703/attachment.htm>


More information about the Users mailing list