Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

qemu-guest-agent #2267

Closed
prologic opened this issue Mar 4, 2018 · 4 comments
Closed

qemu-guest-agent #2267

prologic opened this issue Mar 4, 2018 · 4 comments

Comments

@prologic
Copy link

prologic commented Mar 4, 2018

RancherOS Version: (ros os version)

dm3:~# ros os list
rancher/os:v1.2.0 local latest running

Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.)

root@vz1:~# pveversion
pve-manager/5.1-42/724a6cb3 (running kernel: 4.13.13-4-pve)
root@vz1:~# qm list | grep idm3
       302 idm3                 running    1024              32.00 13285

Neither the open-vm-tools nor the kvm-vm-tools seem to play nicely with Proxmox VE and QEMU guests here.

idm3:~# ros service list | grep tools
enabled  open-vm-tools
enabled  kvm-vm-tools

What I did to work-around this and get this working?

`. Switch consoles to something sensible

$ sudo ros console switch alpine
  1. Install the qemu-guest-agent
apk -U add qemu-guest-agent
  1. Run it!
$ qemu-ga -d

How did I test it?

From your Proxmox VE host; run this:

root@vz1:~# qm agent 302 ping
root@vz1:~# echo $?
0

According to the docs this shows that the communication between Host hypervisor (Proxmox VE + QEMU) and Guest (rancherOS) is working.

Can we get qemu-agent-tools available in the next version of RancherOS?

@ikappas
Copy link

ikappas commented Apr 4, 2018

This will also help running rancher os with Synology Virtual Machine Manager

@JacieChao
Copy link
Contributor

We are going to support the qemu-guest-agent service in milestone v1.4.0.

How to use it?

  1. Please start a RancherOS guest by Proxmox VE,QEMU, libvirt,etc. For example, I started a RancherOS guest by libvirt.
[root@test ~]# virsh list
 Id      Name                          Status
----------------------------------------------------
 1     rancheros                      running

The qemu-guest-agent service have been added to ros service list but not enable by default.

[rancher@rancher ~]$ sudo ros service list | grep guest
disabled qemu-guest-agent

As we see, we can't communicate with RancherOS guest without qemu-guest-agent service from our host.

[root@test ~]# virsh qemu-agent-command rancheros '{"execute":"guest-ping"}'
error:Guest agent is not responding: QEMU guest agent is not connected
  1. Enable and start qemu-guest-agent service on RancherOS.
[rancher@rancher ~]$ sudo ros service list | grep guest
enabled  qemu-guest-agent

[rancher@rancher ~]$ sudo system-docker ps | grep guest
c63974fb7144        rancher/os-qemuguestagent:v1.3.0   "/usr/bin/ros entr..."   12 seconds ago      Up 11 seconds                           qemu-guest-agent
  1. Test communication
[root@test ~]# virsh qemu-agent-command rancheros '{"execute":"guest-ping"}'
{"return":{}}

[root@test ~]# virsh qemu-agent-command rancheros '{"execute":"guest-info"}'
{"return":{"version":"2.10.1","supported_commands":[{"enabled":true,"name":"guest-sync-delimited","success-response":true},{"enabled":true,"name":"guest-sync","success-response":true},{"enabled":true,"name":"guest-suspend-ram","success-response":false},{"enabled":true,"name":"guest-suspend-hybrid","success-response":false},{"enabled":true,"name":"guest-suspend-disk","success-response":false},{"enabled":true,"name":"guest-shutdown","success-response":false},{"enabled":true,"name":"guest-set-vcpus","success-response":true},{"enabled":true,"name":"guest-set-user-password","success-response":true},{"enabled":true,"name":"guest-set-time","success-response":true},{"enabled":true,"name":"guest-set-memory-blocks","success-response":true},{"enabled":true,"name":"guest-ping","success-response":true},{"enabled":true,"name":"guest-network-get-interfaces","success-response":true},{"enabled":true,"name":"guest-info","success-response":true},{"enabled":true,"name":"guest-get-vcpus","success-response":true},{"enabled":true,"name":"guest-get-users","success-response":true},{"enabled":true,"name":"guest-get-timezone","success-response":true},{"enabled":true,"name":"guest-get-time","success-response":true},{"enabled":true,"name":"guest-get-osinfo","success-response":true},{"enabled":true,"name":"guest-get-memory-blocks","success-response":true},{"enabled":true,"name":"guest-get-memory-block-info","success-response":true},{"enabled":true,"name":"guest-get-host-name","success-response":true},{"enabled":true,"name":"guest-get-fsinfo","success-response":true},{"enabled":true,"name":"guest-fstrim","success-response":true},{"enabled":true,"name":"guest-fsfreeze-thaw","success-response":true},{"enabled":true,"name":"guest-fsfreeze-status","success-response":true},{"enabled":true,"name":"guest-fsfreeze-freeze-list","success-response":true},{"enabled":true,"name":"guest-fsfreeze-freeze","success-response":true},{"enabled":true,"name":"guest-file-write","success-response":true},{"enabled":true,"name":"guest-file-seek","success-response":true},{"enabled":true,"name":"guest-file-read","success-response":true},{"enabled":true,"name":"guest-file-open","success-response":true},{"enabled":true,"name":"guest-file-flush","success-response":true},{"enabled":true,"name":"guest-file-close","success-response":true},{"enabled":true,"name":"guest-exec-status","success-response":true},{"enabled":true,"name":"guest-exec","success-response":true}]}}

@prologic
Copy link
Author

Ahh this is lovely! Thank you! Look forward to v1.4.0

@kingsd041
Copy link
Contributor

qemu-agent-tools is already supported in rancheros v1.4.0-rc1 and I have tested it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants