cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Add API/UI option to send guest command via qemu agent

Open tanganellilore opened this issue 1 year ago • 5 comments

ISSUE TYPE
  • Enhancement Request
  • Feature Idea
COMPONENT NAME
API/UI/Backend
CLOUDSTACK VERSION
4.19
CONFIGURATION
OS / ENVIRONMENT
SUMMARY

Hi team,

I notice that actally, for vm that have qemu agent installed, is not possible through cloudstack send command to the host, like vmware guest agent tool. This is possible with qemu agent and i notiche that freeze for example was implemented with this class: https://github.com/apache/cloudstack/blob/main/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/utils/qemu/QemuCommand.java

But is not implemented for all type of command and I don't see any API that cover it ( and also via UI I can't see any "form").

This is something that you are interested to implemet?

STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS

tanganellilore avatar Aug 23 '24 07:08 tanganellilore

@tanganellilore you can do it on kvm host by virsh command

weizhouapache avatar Aug 23 '24 08:08 weizhouapache

Hi @weizhouapache ,

yes clear, this is what I'm doing now, call the CS Api, retrieve in wich host is allocated the vm, access to the host and send the virsh command. But have an "orchestrator" that can also send command, without access to the kvm host it will be a good enhancement to me.

I notice that this is already present for snapshot, so I thing can be implemented without big deal, at lease on api level.

tanganellilore avatar Aug 23 '24 08:08 tanganellilore

@tanganellilore @DaanHoogland technically it is simple, (just API, no database/vo changes at all)

However, I wonder if it is necessary. It is easy to do on kvm host. Integration such features with ACS will make ACS unnecessarily bigger, IMHO.

weizhouapache avatar Aug 26 '24 07:08 weizhouapache

Hi @weizhouapache ,

i understood that is simple to do it on KVM host, but only if you can access to KVM host, otherwhise no way to do it.

Let me do a simple use case. User that deploy the vm is not the admin of cloudstack/kvm infrastrutcture and can't access on it, so to run a command after provisioning, without usage of cloudstack or virsh command (he can't access to kvm host), he need to use something different like cloud-init. One more specific use-case is the configuration of vm network, when dhcp is not possibile and we use a L2 shared. It's will be very usefull have a kvm command that set network remotley without access to kvm hosts.

I' m using vmware,a nd with it is very simple send command thorugh vmware with guest agent installed, and I thing that it will be a very usefull features, cosidering that command is already implemented in backend. We need simply allow the usage of it via API and very basic command validation (or also without it).

tanganellilore avatar Aug 26 '24 08:08 tanganellilore

Moreover, we need to considering also that normal user not see in which host the vm is allocated and also the instancename assigned on kvm side

tanganellilore avatar Aug 26 '24 12:08 tanganellilore

thanks @tanganellilore this is a good improvement request @DaanHoogland has added it to 4.21.0.0 milestone, we will try to make it happen

weizhouapache avatar Nov 20 '24 15:11 weizhouapache

Hi team,

Any news on it? How can help?

Thanks

tanganellilore avatar Jul 23 '25 20:07 tanganellilore

I am afraid nobody has taken time to work on this, @tanganellilore .

You’ll have to find someone willing to implement it. cc @weizhouapache.

DaanHoogland avatar Jul 23 '25 20:07 DaanHoogland

Hi team, Can i try to implementat INT and submit a PR for this? Just to help you on it

tanganellilore avatar Sep 27 '25 09:09 tanganellilore

Hi team, Can i try to implementat INT and submit a PR for this? Just to help you on it

Of course @tanganellilore , that will be very wecome. We will review but then also need to look for someone testing it.

DaanHoogland avatar Oct 01 '25 08:10 DaanHoogland