[ovirt-users] Communicating with ovirt agent

Tadas tadas at ring.lt
Fri Jul 1 14:51:58 UTC 2016


Thank you very much. Seems to work now.

From: Vinzenz Feenstra 
Sent: Friday, July 01, 2016 5:37 PM
To: Tadas 
Cc: users at ovirt.org 
Subject: Re: [ovirt-users] Communicating with ovirt agent


  On Jul 1, 2016, at 4:24 PM, Tadas <tadas at ring.lt> wrote:

  Thank you for reply!
  Im trying to send JSON-formated shutdown command to windows guest vm now. Here’s small script I’ve written to test that:
  http://pastebin.com/usAYc7Ww

  But still I get no reaction from ovirt agent. Surely I’m missing something.

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




  From: Vinzenz Feenstra 
  Sent: Friday, July 01, 2016 2:53 PM
  To: tadas at ring.lt 
  Cc: users at ovirt.org 
  Subject: Re: [ovirt-users] Communicating with ovirt agent


    On Jul 1, 2016, at 12:05 PM, Tadas <tadas at ring.lt> =rote:


    is there any documentation o oVirt guest agent =ommands?
    To be more precise: i need to pass commands to =Virt guest agent from
    hypervisor.
    Reading =nfo works fine:

    socat =var/lib/libvirt/qemu/channel/target/domain-20-
    win7_32bit/com.redhat.serial.0 -

    {"applications": ["Python 2.7.12rc1", "SPICE Guest Tools", =Total
    Commander (Remove or Repair)", "Python 2.7 =ywin32-216", "Microsoft
    .NET Framework 4.6.1", "Git =ersion 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”}


  Every =ommand has to be send as a whole JSON object and sent as line =erminated by a \n character

  The =ommands available are currently not documented however.

  {“__name__”: “name”,=… args}

  - name: =hutdown
    parameters:
  - =imeout: optional integer (seconds)
  =/span>- reboot: optional boolean
  - =essage: string

  - =ame: refresh
    parameters:
  - =piVersion: optiona integer 
          =nbsp;   this defines what information can be =xchanged

  - =ame: hibernate:
    parameters:
  - state: =isk 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-gu=st-agent/OVirtAgentLogic.py#L306 at the parseCommand =unction
  or just ask here :-)




    I'm unable to find how to send command (lets =ay "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 at ovirt.org
    http://lists.ovirt.org/mailman/listinfo/users


  =
  _______________________________________________
  Users mailing list
  Users at ovirt.org
  http://lists.ovirt.org/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20160701/a22ae949/attachment-0001.html>


More information about the Users mailing list