<div dir="ltr">Hi Miloš,<div class="gmail_extra"><br><br><div class="gmail_quote">On 6 June 2013 10:37, Miloš Kozák <span dir="ltr"><<a href="mailto:milos.kozak@lejmr.com" target="_blank">milos.kozak@lejmr.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><div><div class="h5">
Hi,<br>
<br>
Template:<br>
ACPI="yes"<br>
CPU="1"<br>
DISK=[<br>
IMAGE="ttylinux-per",<br>
IMAGE_UNAME="oneadmin" ]<br>
GRAPHICS=[<br>
LISTEN="0.0.0.0",<br>
TYPE="vnc" ]<br>
MEMORY="1024"<br>
NAME="ttylinux"<br>
OS=[<br>
ARCH="i686",<br>
BOOT="hd" ]<br>
RAW=[<br>
TYPE="kvm" ]<br>
TEMPLATE_ID="1"<br>
VCPU="2"<br>
<br>
<br>
States:<br>
<br>
110 oneadmin oneadmin one-110 shut 0 0K kvasi.k131
0d 00h01<br>
occi-compute show 110<br>
<COMPUTE href='<a href="http://127.0.0.1:4567/compute/110" target="_blank">http://127.0.0.1:4567/compute/110</a>'><br>
<ID>110</ID><br>
<USER href='<a href="http://127.0.0.1:4567/user/0" target="_blank">http://127.0.0.1:4567/user/0</a>'
name='oneadmin'/><br>
<GROUP>oneadmin</GROUP><br>
<CPU>1</CPU><br>
<MEMORY>1024</MEMORY><br>
<NAME>one-110</NAME><br>
<STATE>ACTIVE</STATE><br>
<DISK id='0'><br>
<STORAGE href='<a href="http://127.0.0.1:4567/storage/76" target="_blank">http://127.0.0.1:4567/storage/76</a>'
name='ttylinux-per'/><br>
<TYPE>FILE</TYPE><br>
<TARGET>hda</TARGET><br>
</DISK><br>
</COMPUTE><br>
<br>
After poweroff:<br>
<br>
onevm show 110<br>
VIRTUAL MACHINE 110 INFORMATION<br>
ID : 110<br>
NAME : one-110<br>
USER : oneadmin<br>
GROUP : oneadmin<br>
STATE : ACTIVE<br>
LCM_STATE : SHUTDOWN_POWEROFF<br>
RESCHED : No<br>
HOST : kvasi.k13132.local<br>
START TIME : 06/03 10:00:41<br>
END TIME : -<br>
DEPLOY ID : one-110<br>
<br>
VIRTUAL MACHINE MONITORING<br>
NET_RX : 0K<br>
NET_TX : 0K<br>
USED MEMORY : 0K<br>
USED CPU : 0<br>
<br>
PERMISSIONS<br>
OWNER : um-<br>
GROUP : ---<br>
OTHER : ---<br>
<br>
VIRTUAL MACHINE TEMPLATE<br>
ACPI="yes"<br>
CPU="1"<br>
DISK=[<br>
CLONE="NO",<br>
DATASTORE="emc-spc",<br>
DATASTORE_ID="104",<br>
DEV_PREFIX="hd",<br>
DISK_ID="0",<br>
DRIVER="raw",<br>
IMAGE="ttylinux-per",<br>
IMAGE_ID="76",<br>
IMAGE_UNAME="oneadmin",<br>
PERSISTENT="YES",<br>
READONLY="NO",<br>
SAVE="YES",<br>
SOURCE="/dev/vg-c/lv-one-76",<br>
TARGET="hda",<br>
TM_MAD="shared_lvm",<br>
TYPE="FILE" ]<br>
GRAPHICS=[<br>
LISTEN="0.0.0.0",<br>
PORT="6010",<br>
TYPE="vnc" ]<br>
MEMORY="1024"<br>
NAME="one-110"<br>
OS=[<br>
ARCH="i686",<br>
BOOT="hd" ]<br>
RAW=[<br>
TYPE="kvm" ]<br>
TEMPLATE_ID="1"<br>
VCPU="2"<br>
VMID="110"<br>
<br>
VIRTUAL MACHINE HISTORY<br>
SEQ HOST REASON START TIME
PROLOG_TIME<br>
0 kvasi.k13132.lo user 06/03 10:00:56 0d 00h04m10s 0d
00h00m00s<br>
1 kvasi.k13132.lo none 06/03 10:05:26 0d 00h00m26s 0d
00h00m00s<br>
[oneadmin@kvasi occi]$ occi-compute show 110<br>
<COMPUTE href='<a href="http://127.0.0.1:4567/compute/110" target="_blank">http://127.0.0.1:4567/compute/110</a>'><br>
<ID>110</ID><br>
<USER name='oneadmin' href='<a href="http://127.0.0.1:4567/user/0%27/" target="_blank">http://127.0.0.1:4567/user/0'/</a>><br>
<GROUP>oneadmin</GROUP><br>
<CPU>1</CPU><br>
<MEMORY>1024</MEMORY><br>
<NAME>one-110</NAME><br>
<STATE>ACTIVE</STATE><br>
<DISK id='0'><br>
<STORAGE name='ttylinux-per' href='<a href="http://127.0.0.1:4567/storage/76%27/" target="_blank">http://127.0.0.1:4567/storage/76'/</a>><br>
<TYPE>FILE</TYPE><br>
<TARGET>hda</TARGET><br>
</DISK><br>
</COMPUTE><br>
<br>
<br>
Is that all you need to know? BTW it is ONE 3.8.3.<br></div></div></div></blockquote><div><br></div><div><br></div><div style>The state of the VirtualMachine is ACTIVE, that's why OCCI expose also the ACTIVE state</div>
<div class="gmail_quote"><br></div>onevm:</div><div class="gmail_quote"><br><span style="color:rgb(80,0,80)">STATE : ACTIVE</span><br style="color:rgb(80,0,80)"><span style="color:rgb(80,0,80)">LCM_STATE : SHUTDOWN_POWEROFF</span><br style="color:rgb(80,0,80)">
<div style><br></div><div style>occi:</div><div style><br><span style="color:rgb(80,0,80)"> <STATE>ACTIVE</STATE></span><br></div><div style><span style="color:rgb(80,0,80)"><br></span></div>The VirtualMachine will stay in that state until it disappears from the hypervisor, if the action does not succeed after a while the lcm_state will change to running.<br>
<br>I think the problem is how you are specifying the ACPI attr, you have to include it in a FEATURES section:<br><a href="http://opennebula.org/documentation:rel4.0:kvmg#features">http://opennebula.org/documentation:rel4.0:kvmg#features</a><br>
</div><div class="gmail_quote">Cheers</div><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><div><div class="h5">
<br>
<br></div></div>
BTW I am sorry for resending. First, I sent it directly outside of
the mailing list..<div class="im"><br>
<br>
<div>Dne 3.6.2013 9:53, Daniel Molina
napsal(a):<br>
</div>
</div><blockquote type="cite">
<div dir="ltr">Hi,
<div><div class="h5"><div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On 2 June 2013 10:10, Miloš Kozák <span dir="ltr"><<a href="mailto:milos.kozak@lejmr.com" target="_blank">milos.kozak@lejmr.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> Hi,<br>
thank you for the answer. I tried to verify that. It is
quite easy to sent LCM_STATES to XML, thought. But at
this point I would rather tried to resolve it with
VM_STATE. I am afraid that there might be a bug. Source
from compute.js: <br>
<br>
function VMStateBulletStr(vm){<br>
var vm_state = vm.COMPUTE.STATE;<br>
var state_html = "";<br>
switch (vm_state) {<br>
case "INIT":<br>
case "PENDING":<br>
case "HOLD":<br>
case "STOPPED":<br>
case "SUSPENDED":<br>
case "POWEROFF":<br>
state_html = '<img
style="display:inline-block;margin-right:5px;;"
src="images/yellow_bullet.png" alt="'+vm_state+'"
title="'+vm_state+'" />';<br>
break;<br>
case "ACTIVE":<br>
case "DONE":<br>
state_html = '<img
style="display:inline-block;margin-right:5px;"
src="images/green_bullet.png" alt="'+vm_state+'"
title="'+vm_state+'"/>';<br>
break;<br>
case "FAILED":<br>
state_html = '<img
style="display:inline-block;margin-right:5px;"
src="images/red_bullet.png" alt="'+vm_state+'"
title="'+vm_state+'"/>';<br>
break;<br>
};<br>
return state_html;<br>
}<br>
<br>
As I read it, the XML should contain states as poweroff
and so on, but it gives only done, pending, done and
active. I ran small script on a VM:<br>
<br>
until [ `sleep 0.7` ]; do occi-compute show 109 | grep
STATE; done;<br>
<br>
And triggered all thinkable commands on the VM. When I
tryed poweroff and shutdown it prevailed in ACTIVE. That
is why I think there might by a problem.. <br>
<br>
I tried to resolve it on my own, but I dont know
ruby....<br>
<br>
</div>
</blockquote>
<div><br>
</div>
<div>Could you check the states with onevm show and
confirm that the action (shutdown/power off) doesn't fail.
Note that you will need ACPI activated on your VMs to run
these actions.</div>
<div><br>
</div>
<div>Cheers</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> <br>
Thanks for answer,<br>
Milos<br>
<br>
<div>Dne 26.4.2013 11:23, Daniel Molina napsal(a):<br>
</div>
<div>
<div>
<blockquote type="cite">
<div dir="ltr">Hi ,
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On 25 April 2013
09:28, Miloš Kozák <span dir="ltr"><<a href="mailto:milos.kozak@lejmr.com" target="_blank">milos.kozak@lejmr.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
I am running opennebula 3.8.3 and OCCI
self-service portal. My problem is that
the VM indication is misleading. There 3
statuses - green, yellow, red. When I stop
VM it turns to yellow, if anything is
wrong red.. that is perfectly correct but
the VM is indicated by green for shutdown,
poweroff and all other statuses.. I was
trying to fix compute.js, but it didnt
worked out.. So I assume there is a deeper
problem? Can you confirm that?<br>
</blockquote>
<div><br>
</div>
When using OCCI the VM xml that is sent in a
OCCI /compute/:id GET request include the
VM_STATE [1]. <br>
<br>
VM_STATE=%w{INIT PENDING HOLD ACTIVE STOPPED
SUSPENDED DONE FAILED <br>
POWEROFF}<br>
<br>
The problem is that the states you are
looking for are LCM_STATES. <br>
<br>
LCM_STATE=%w{LCM_INIT PROLOG BOOT RUNNING
MIGRATE SAVE_STOP SAVE_SUSPEND<br>
SAVE_MIGRATE PROLOG_MIGRATE PROLOG_RESUME
EPILOG_STOP EPILOG<br>
SHUTDOWN CANCEL FAILURE CLEANUP UNKNOWN
HOTPLUG SHUTDOWN_POWEROFF<br>
BOOT_UNKNOWN BOOT_POWEROFF BOOT_SUSPENDED
BOOT_STOPPED} </div>
<div class="gmail_quote"><br>
</div>
<div class="gmail_quote">If you want to
include this information you have to modify
the VirtualMachineOCCI class to include
these states [2]</div>
<div class="gmail_quote"><br>
</div>
<div class="gmail_quote">Hope this helps</div>
<div class="gmail_quote"><br>
</div>
<div class="gmail_quote">[1] <a href="https://github.com/OpenNebula/one/blob/release-3.8.3/src/oca/ruby/OpenNebula/VirtualMachine.rb" target="_blank">https://github.com/OpenNebula/one/blob/release-3.8.3/src/oca/ruby/OpenNebula/VirtualMachine.rb</a></div>
<div class="gmail_quote">[2] <a href="https://github.com/OpenNebula/one/blob/release-3.8.3/src/cloud/occi/lib/VirtualMachineOCCI.rb" target="_blank">https://github.com/OpenNebula/one/blob/release-3.8.3/src/cloud/occi/lib/VirtualMachineOCCI.rb</a></div>
<div class="gmail_quote"><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
Thank you, Milos<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
Daniel Molina<br>
</div>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr">
<div>Join us at <a href="http://opennebulaconf.com/" target="_blank">OpenNebulaConf2013</a>
in Berlin, 24-26 September, 2013<br>
</div>
<div>--</div>
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" target="_blank">dmolina@opennebula.org</a>
| @OpenNebula</div>
</div>
</div></div></div>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Join us at <a href="http://opennebulaconf.com/" target="_blank">OpenNebulaConf2013</a> in Berlin, 24-26 September, 2013<br></div><div>--</div>
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" target="_blank">dmolina@opennebula.org</a> | @OpenNebula</div>
</div></div>