<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 1, 2016, at 4:24 PM, Tadas <<a href="mailto:tadas@ring.lt" class="">tadas@ring.lt</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta content="text/html =harset=utf-8" http-equiv="Content-Type" class="">
<div style="WORD-WRAP: break-word; webkit-nbsp-mode: space; -webkit-line-break: after-white-space" dir="ltr" ='lass="" '="" class="">
<div dir="ltr" class="">
<div style="font-size: 12pt; font-family: Calibri;" class="">
<div class="">Thank you for reply!</div>
<div class="">Im trying to send JSON-formated shutdown command to windows guest vm now.
Here’s small script I’ve written to test that:</div>
<div class=""><a title="http://pastebin.com/usAYc7Ww" href="http://pastebin.com/usAYc7Ww" class="">http://pastebin.com/usAYc7Ww</a></div>
<div class=""> </div>
<div class="">But still I get no reaction from ovirt agent. Surely I’m missing
something.</div></div></div></div></div></blockquote><div><br class=""></div><div>Yes the newline character send a ‘\n’ at the end and the name key must be surrounded by two underscores like in the replies __name__ not name</div><br class=""><blockquote type="cite" class=""><div class=""><div style="WORD-WRAP: break-word; webkit-nbsp-mode: space; -webkit-line-break: after-white-space" dir="ltr" ='lass="" '="" class=""><div dir="ltr" class=""><div style="font-size: 12pt; font-family: Calibri;" class="">
<div class=""> </div>
<div style="font-size: small; text-decoration: none; font-family: Calibri; font-weight: normal; font-style: normal; display: inline;" class="">
<div style="FONT: 10pt tahoma" class="">
<div class=""> </div>
<div style="BACKGROUND: #f5f5f5" class="">
<div style="font-color: black" class=""><b class="">From:</b> <a title="vfeenstr@redhat.com" href="mailto:vfeenstr@redhat.com" class="">Vinzenz Feenstra</a> </div>
<div class=""><b class="">Sent:</b> Friday, July 01, 2016 2:53 PM</div>
<div class=""><b class="">To:</b> <a title="tadas@ring.lt" href="mailto:tadas@ring.lt" class="">tadas@ring.lt</a> </div>
<div class=""><b class="">Cc:</b> <a title="users@ovirt.org" href="mailto:users@ovirt.org" class="">users@ovirt.org</a> </div>
<div class=""><b class="">Subject:</b> Re: [ovirt-users] Communicating with ovirt
agent</div></div></div>
<div class=""> </div></div>
<div style="font-size: small; text-decoration: none; font-family: Calibri; font-weight: normal; font-style: normal; display: inline;" class="">
<div class=""> </div>
<div class="">
<blockquote type="cite" class="">
<div ='lass="" '="" class="">On Jul 1, 2016, at 12:05 PM, Tadas <<a ='ref="mailto:tadas@ring.lt" '="" class="">tadas@ring.lt</a>> =rote:</div>
<div class=""> </div>
<div class="">
<div ='lass="" '="" class=""><br class="">is there any documentation o oVirt guest agent
=ommands?<br class="">To be more precise: i need to pass commands to =Virt guest agent
from<br class="">hypervisor.<br class="">Reading =nfo works fine:<br class=""><br class="">socat
=var/lib/libvirt/qemu/channel/target/domain-20-<br ='lass="" '="" class="">win7_32bit/com.redhat.serial.0 -<br class=""><br ='lass="" '="" class="">{"applications":
["Python 2.7.12rc1", "SPICE Guest Tools", =Total<br class="">Commander (Remove or
Repair)", "Python 2.7 =ywin32-216", "Microsoft<br class="">.NET Framework 4.6.1", "Git
=ersion 2.9.0", "WinRAR 5.40 beta 2 (32-<br class="">bit)", =Notepad++"], "__name__":
"applications"}<br class="">{"__name__": =host-name", "name":
"WIN7_32BIT"}<br class="">{"__name__": =os-version", "version": "Win 7”}<br ='lass="" '="" class=""></div></div></blockquote>
<div class=""> </div>
<div class="">Every =ommand has to be send as a whole JSON object and sent as line
=erminated by a \n character</div>
<div class=""> </div>
<div class="">The =ommands available are currently not documented however.</div>
<div class=""> </div>
<div class="">{“__name__”: “name”,=… args}</div>
<div class=""> </div>
<div class="">- name: =hutdown</div>
<div class=""> parameters:</div>
<div class=""><span style="WHITE-SPACE: pre" ='lass="Apple-tab-span" '="" class=""></span>- =imeout:
optional integer (seconds)</div>
<div class=""><span style="WHITE-SPACE: pre" ='lass="Apple-tab-span" '="" class="">=/span>- reboot:
optional boolean</span></div>
<div class=""><span style="WHITE-SPACE: pre" ='lass="Apple-tab-span" '="" class=""></span>- =essage:
string</div>
<div class=""> </div>
<div class="">- =ame: refresh</div>
<div class=""> parameters:</div>
<div class=""><span style="WHITE-SPACE: pre" ='lass="Apple-tab-span" '="" class=""></span>-
=piVersion: optiona integer </div>
<div class=""> =nbsp; this defines
what information can be =xchanged</div>
<div class=""> </div>
<div class="">- =ame: hibernate:</div>
<div class=""> parameters:</div>
<div class=""><span style="WHITE-SPACE: pre" ='lass="Apple-tab-span" '="" class=""></span>- state:
=isk or mem (default is disk if not specified)</div>
<div class=""> </div>
<div class="">if you need more you can look here: <a ='ref="https://github.com/oVirt/ovirt-guest-agent/blob/master/ovirt-guest=agent/OVirtAgentLogic.py#L306" '="" class="">https://github.com/oVirt/ovirt-guest-agent/blob/master/ovirt-gu=st-agent/OVirtAgentLogic.py#L306</a>
at the parseCommand =unction</div>
<div class="">or just ask here :-)</div><br class="">
<blockquote ='ype="cite" '="" class="">
<div class="">
<div class=""><br ='lass="" '="" class=""><br class="">I'm unable to find how to send command (lets =ay
"shutdown") to agent?.<br class="">echo "shutdown" | socat
=var/lib/libvirt/qemu/channel/target/domain-20-<br ='lass="" '="" class="">win7_32bit/com.redhat.kvm-vdi.0 -<br class="">Does=not seem to
work<br class="">Thank you for your help.<br ='lass="" '="" class="">_______________________________________________<br ='lass="" '="" class="">Users
mailing list<br class=""><a ='ref="mailto:Users@ovirt.org" '="" class="">Users@ovirt.org</a><br ='lass="" '="" class=""><a href="http://lists.ovirt.org/mailman/listinfo/users" class="">http://lists.ovirt.org/mailman/listinfo/users</a><br ='lass="" '="" class=""></div></div></blockquote></div><br class="">=</div></div></div></div>
_______________________________________________<br class="">Users mailing list<br class=""><a href="mailto:Users@ovirt.org" class="">Users@ovirt.org</a><br class="">http://lists.ovirt.org/mailman/listinfo/users<br class=""></div></blockquote></div><br class=""></body></html>