--Apple-Mail=_3BE0665E-6368-4F14-B7B6-B74A6939D809
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
On Jul 1, 2016, at 12:05 PM, Tadas <tadas(a)ring.lt> wrote:
=20
=20
is there any documentation o oVirt guest agent commands?
To be more precise: i need to pass commands to oVirt guest agent from
hypervisor.
Reading info works fine:
=20
socat /var/lib/libvirt/qemu/channel/target/domain-20-
win7_32bit/com.redhat.serial.0 -
=20
{"applications": ["Python 2.7.12rc1", "SPICE Guest Tools",
"Total
Commander (Remove or Repair)", "Python 2.7 pywin32-216", "Microsoft
.NET Framework 4.6.1", "Git version 2.9.0", "WinRAR 5.40 beta 2 (32-
bit)", "Notepad++"], "__name__": "applications"}
{"__name__": "host-name", "name": "WIN7_32BIT"}
{"__name__": "os-version", "version": "Win 7=E2=80=9D}
Every command has to be send as a whole JSON object and sent as line =
terminated by a \n character
The commands available are currently not documented however.
{=E2=80=9C__name__=E2=80=9D: =E2=80=9Cname=E2=80=9D, =E2=80=A6 args}
- name: shutdown
parameters:
- timeout: optional integer (seconds)
- reboot: optional boolean
- message: string
- name: refresh
parameters:
- apiVersion: optiona integer=20
this defines what information can be exchanged
- name: hibernate:
parameters:
- state: disk or mem (default is disk if not specified)
if you need more you can look here: =
https://github.com/oVirt/ovirt-guest-agent/blob/master/ovirt-guest-agent/O=
VirtAgentLogic.py#L306 =
<
https://github.com/oVirt/ovirt-guest-agent/blob/master/ovirt-guest-agent/=
OVirtAgentLogic.py#L306> at the parseCommand function
or just ask here :-)
=20
=20
I'm unable to find how to send command (lets say "shutdown") to =
agent?.
echo "shutdown" | socat =
/var/lib/libvirt/qemu/channel/target/domain-20-
win7_32bit/com.redhat.kvm-vdi.0 -
Does not seem to work
Thank you for your help.
_______________________________________________
Users mailing list
Users(a)ovirt.org
http://lists.ovirt.org/mailman/listinfo/users
--Apple-Mail=_3BE0665E-6368-4F14-B7B6-B74A6939D809
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=utf-8
<html><head><meta http-equiv=3D"Content-Type"
content=3D"text/html =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" =
class=3D""><br class=3D""><div><blockquote
type=3D"cite" class=3D""><div =
class=3D"">On Jul 1, 2016, at 12:05 PM, Tadas <<a =
href=3D"mailto:tadas@ring.lt"
class=3D"">tadas(a)ring.lt</a>&gt; =
wrote:</div><br class=3D"Apple-interchange-newline"><div
class=3D""><div =
class=3D""><br class=3D"">is there any documentation o oVirt
guest agent =
commands?<br class=3D"">To be more precise: i need to pass commands to =
oVirt guest agent from<br class=3D"">hypervisor.<br
class=3D"">Reading =
info works fine:<br class=3D""><br class=3D"">socat =
/var/lib/libvirt/qemu/channel/target/domain-20-<br =
class=3D"">win7_32bit/com.redhat.serial.0 -<br
class=3D""><br =
class=3D"">{"applications": ["Python 2.7.12rc1",
"SPICE Guest Tools", =
"Total<br class=3D"">Commander (Remove or Repair)", "Python
2.7 =
pywin32-216", "Microsoft<br
class=3D"">.NET Framework
4.6.1", "Git =
version 2.9.0", "WinRAR 5.40 beta 2 (32-<br
class=3D"">bit)", =
"Notepad++"], "__name__": "applications"}<br
class=3D"">{"__name__": =
"host-name", "name": "WIN7_32BIT"}<br
class=3D"">{"__name__": =
"os-version", "version": "Win 7=E2=80=9D}<br =
class=3D""></div></div></blockquote><div><br
class=3D""></div><div>Every =
command has to be send as a whole JSON object and sent as line =
terminated by a \n character</div><div><br
class=3D""></div><div>The =
commands available are currently not documented however.</div><div><br =
class=3D""></div><div>{=E2=80=9C__name__=E2=80=9D:
=E2=80=9Cname=E2=80=9D,=
=E2=80=A6 args}</div><div><br
class=3D""></div><div>- name: =
shutdown</div><div> parameters:</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>-
=
timeout: optional integer (seconds)</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre"> =
</span>- reboot: optional boolean</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>-
=
message: string</div><div><br
class=3D""></div><div>- =
name: refresh</div><div>
parameters:</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>-
=
apiVersion: optiona integer </div><div>
=
this defines what information can be =
exchanged</div><div><br class=3D""></div><div>- =
name: hibernate:</div><div>
parameters:</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>-
state: =
disk or mem (default is disk if not specified)</div><div><br =
class=3D""></div><div>if you need more you can look here:
<a =
href=3D"https://github.com/oVirt/ovirt-guest-agent/blob/master/ovirt...
-agent/OVirtAgentLogic.py#L306" =
class=3D"">https://github.com/oVirt/ovirt-guest-agent/blob/m...
est-agent/OVirtAgentLogic.py#L306</a> at the parseCommand =
function</div><div>or just ask here :-)</div><br
class=3D""><blockquote =
type=3D"cite" class=3D""><div class=3D""><div
class=3D""><br =
class=3D""><br class=3D"">I'm unable to find how to send
command (lets =
say "shutdown") to agent?.<br class=3D"">echo
"shutdown" | socat =
/var/lib/libvirt/qemu/channel/target/domain-20-<br =
class=3D"">win7_32bit/com.redhat.kvm-vdi.0 -<br
class=3D"">Does=
not seem to work<br class=3D"">Thank you for your help.<br =
class=3D"">_______________________________________________<br =
class=3D"">Users mailing list<br class=3D""><a =
href=3D"mailto:Users@ovirt.org"
class=3D"">Users(a)ovirt.org</a><br =
class=3D"">http://lists.ovirt.org/mailman/listinfo/users<br =
class=3D""></div></div></blockquote></div><br
class=3D""></body></html>=
--Apple-Mail=_3BE0665E-6368-4F14-B7B6-B74A6939D809--